mirror of https://github.com/acidanthera/audk.git
1. Add keyboard support for tree pane, now you can press "ENTER" on a module/package/platform to open it, just like double-click.
2. Add check point when opening a node of tree, ignore the node whose id is null. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1463 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9481cdac18
commit
78b5fb8265
|
@ -17,6 +17,8 @@ package org.tianocore.frameworkwizard;
|
|||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
@ -106,7 +108,8 @@ import org.tianocore.frameworkwizard.toolchain.Preferences;
|
|||
It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener
|
||||
|
||||
**/
|
||||
public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, MenuListener {
|
||||
public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListener, TreeSelectionListener,
|
||||
MenuListener {
|
||||
///
|
||||
/// Define class Serial Version UID
|
||||
///
|
||||
|
@ -1758,7 +1761,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||
//
|
||||
SplashScreen ss = new SplashScreen();
|
||||
ss.setVisible(true);
|
||||
|
||||
|
||||
//
|
||||
// Set current workspace and check
|
||||
// Check if exists WORKSPACE
|
||||
|
@ -1776,7 +1779,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||
// Init Global Data
|
||||
//
|
||||
GlobalData.init();
|
||||
|
||||
|
||||
//
|
||||
// Close splash screen
|
||||
//
|
||||
|
@ -2016,6 +2019,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||
dmtnRoot.add(dmtnPlatformDescription);
|
||||
iTree = new ITree(dmtnRoot);
|
||||
iTree.addMouseListener(this);
|
||||
iTree.addKeyListener(this);
|
||||
jScrollPaneTree.setViewportView(iTree);
|
||||
}
|
||||
|
||||
|
@ -2494,6 +2498,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||
id = iTree.getSelectNode().getId();
|
||||
intCategory = iTree.getSelectCategory();
|
||||
|
||||
//
|
||||
// If id is null, return directly
|
||||
//
|
||||
if (id == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// If the node is not opened yet
|
||||
// Insert top level elements first
|
||||
|
@ -3402,4 +3413,22 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void keyTyped(KeyEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void keyPressed(KeyEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public void keyReleased(KeyEvent arg0) {
|
||||
if (arg0.getSource() == this.iTree) {
|
||||
if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
|
||||
this.doubleClickModuleTreeNode();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue