diff options
author | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-05 07:34:32 +0000 |
---|---|---|
committer | hche10x <hche10x@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-09-05 07:34:32 +0000 |
commit | 78b5fb82653276a1f8726ff2557854fc692c8f28 (patch) | |
tree | eb22991e7d4e42a1101800ba9cc88d13fa937db7 | |
parent | 9481cdac188b126dfea3178be6ca84c8d6e0e005 (diff) | |
download | edk2-78b5fb82653276a1f8726ff2557854fc692c8f28.zip edk2-78b5fb82653276a1f8726ff2557854fc692c8f28.tar.gz edk2-78b5fb82653276a1f8726ff2557854fc692c8f28.tar.bz2 |
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
-rw-r--r-- | Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index 9d065b5..59bb752 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java @@ -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();
+ }
+ }
+ }
}
|