diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java index 9d065b51db..59bb752fa9 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(); + } + } + } }