diff options
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui')
15 files changed, 0 insertions, 2636 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java deleted file mode 100644 index d02c121433..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java +++ /dev/null @@ -1,318 +0,0 @@ -/** @file
-
- The file is used to provid 6 kinds of arch in one jpanel
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.util.Vector;
-
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class ArchCheckBox extends JPanel {
-
- ///
- /// Define class members
- ///
- private static final long serialVersionUID = 4792669775676953990L;
-
- private JCheckBox jCheckBoxIa32 = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JCheckBox jCheckBoxEbc = null;
-
- private JCheckBox jCheckBoxArm = null;
-
- private JCheckBox jCheckBoxPpc = null;
-
- /**
- * This method initializes jCheckBoxIa32
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIa32() {
- if (jCheckBoxIa32 == null) {
- jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 55, 20));
- jCheckBoxIa32.setText("IA32");
- jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIa32;
- }
-
- /**
- * This method initializes jCheckBoxX64
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20));
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBoxIpf
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20));
- jCheckBoxIpf.setText("IPF");
- jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBoxEbc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEbc() {
- if (jCheckBoxEbc == null) {
- jCheckBoxEbc = new JCheckBox();
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(160, 0, 53, 20));
- jCheckBoxEbc.setText("EBC");
- jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxEbc;
- }
-
- /**
- * This method initializes jCheckBoxArm
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxArm() {
- if (jCheckBoxArm == null) {
- jCheckBoxArm = new JCheckBox();
- jCheckBoxArm.setBounds(new java.awt.Rectangle(213, 0, 54, 20));
- jCheckBoxArm.setText("ARM");
- jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxArm;
- }
-
- /**
- * This method initializes jCheckBoxPpc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPpc() {
- if (jCheckBoxPpc == null) {
- jCheckBoxPpc = new JCheckBox();
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(267, 0, 53, 20));
- jCheckBoxPpc.setText("PPC");
- jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxPpc;
- }
-
- /**
- * This is the default constructor
- */
- public ArchCheckBox() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(320, 20);
- this.setLayout(null);
- this.add(getJCheckBoxIa32(), null);
- this.add(getJCheckBoxX64(), null);
- this.add(getJCheckBoxIpf(), null);
- this.add(getJCheckBoxEbc(), null);
- this.add(getJCheckBoxArm(), null);
- this.add(getJCheckBoxPpc(), null);
- this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
-
- public Vector<String> getSelectedItemsVector() {
- Vector<String> v = new Vector<String>();
- if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
- v.addElement(jCheckBoxIa32.getText());
- }
- if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
- v.addElement(jCheckBoxX64.getText());
- }
- if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
- v.addElement(jCheckBoxIpf.getText());
- }
- if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
- v.addElement(jCheckBoxEbc.getText());
- }
- if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
- v.addElement(jCheckBoxArm.getText());
- }
- if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
- v.addElement(jCheckBoxPpc.getText());
- }
- return v;
- }
-
- public String getSelectedItemsString() {
- String s = "";
- if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
- s = s + jCheckBoxIa32.getText() + " ";
- }
- if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
- s = s + jCheckBoxX64.getText() + " ";
- }
- if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
- s = s + jCheckBoxIpf.getText() + " ";
- }
- if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
- s = s + jCheckBoxEbc.getText() + " ";
- }
- if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
- s = s + jCheckBoxArm.getText() + " ";
- }
- if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
- s = s + jCheckBoxPpc.getText() + " ";
- }
- return s.trim();
- }
-
- public void setAllItemsSelected(boolean isSelected) {
- this.jCheckBoxIa32.setSelected(isSelected);
- this.jCheckBoxX64.setSelected(isSelected);
- this.jCheckBoxIpf.setSelected(isSelected);
- this.jCheckBoxEbc.setSelected(isSelected);
- this.jCheckBoxArm.setSelected(isSelected);
- this.jCheckBoxPpc.setSelected(isSelected);
- }
-
- public void setSelectedItems(Vector<String> v) {
- setAllItemsSelected(false);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setSelected(true);
- continue;
- }
- }
- }
- }
-
- public void setAllItemsEnabled(boolean isEnabled) {
- this.jCheckBoxIa32.setEnabled(isEnabled);
- this.jCheckBoxX64.setEnabled(isEnabled);
- this.jCheckBoxIpf.setEnabled(isEnabled);
- this.jCheckBoxEbc.setEnabled(isEnabled);
- this.jCheckBoxArm.setEnabled(isEnabled);
- this.jCheckBoxPpc.setEnabled(isEnabled);
- }
-
- public void setEnabledItems(Vector<String> v) {
- setAllItemsEnabled(false);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setEnabled(true);
- continue;
- }
- }
- }
- }
-
- public void setDisabledItems(Vector<String> v) {
- setAllItemsEnabled(true);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setEnabled(false);
- continue;
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java deleted file mode 100644 index 836ed7b386..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java +++ /dev/null @@ -1,263 +0,0 @@ -/** @file
-
- The file is used to popup a exit confirmation window when program exists
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-/**
- The class is used to popup a exit confirmation window when program exists
- It extends JDialog and implements ActionListener and WindowListener
-
- **/
-public class ExitConfirm extends JDialog implements ActionListener, WindowListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -5875921789385911029L;
-
- private JPanel jContentPane = null;
-
- private JLabel jLabelMessage = null;
-
- private JLabel jLabelResume = null;
-
- private JLabel jLabelExit = null;
-
- private JButton jButtonResume = null;
-
- private JButton jButtonExit = null;
-
- public boolean isCancel = false;
-
- /**
- This method initializes jButtonResume
-
- @return javax.swing.JButton jButtonResume
-
- **/
- private JButton getJButtonResume() {
- if (jButtonResume == null) {
- jButtonResume = new JButton();
- jButtonResume.setText("Resume");
- jButtonResume.setSize(new java.awt.Dimension(90, 20));
- jButtonResume.setLocation(new java.awt.Point(150, 105));
- jButtonResume.setMnemonic('R');
- jButtonResume.addActionListener(this);
- }
- return jButtonResume;
- }
-
- /**
- This method initializes jButtonExit
-
- @return javax.swing.JButton jButtonExit
-
- **/
- private JButton getJButtonExit() {
- if (jButtonExit == null) {
- jButtonExit = new JButton();
- jButtonExit.setText("Exit");
- jButtonExit.setSize(new java.awt.Dimension(90, 20));
- jButtonExit.setLocation(new java.awt.Point(260, 105));
- jButtonExit.setMnemonic('x');
- jButtonExit.addActionListener(this);
- }
- return jButtonExit;
- }
-
- /**
- Main clasee, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ExitConfirm(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This method initializes this
-
- @return void
-
- **/
- private void initialize() {
- this.setSize(500, 170);
- this.setTitle("Exit");
- this.setResizable(false);
- this.setContentPane(getJContentPane());
- this.addWindowListener(this);
- //
- //Set DO_NOTHING_ON_CLOSE when click Close button on title bar
- //
- this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- centerWindow();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelExit = new JLabel();
- jLabelExit.setSize(new java.awt.Dimension(450, 20));
- jLabelExit.setLocation(new java.awt.Point(25, 70));
- jLabelResume = new JLabel();
- jLabelResume.setSize(new java.awt.Dimension(450, 20));
- jLabelResume.setLocation(new java.awt.Point(25, 40));
- jLabelMessage = new JLabel();
- jLabelMessage.setSize(new java.awt.Dimension(450, 20));
- jLabelMessage.setLocation(new java.awt.Point(25, 10));
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(jLabelMessage, null);
- jContentPane.add(jLabelResume, null);
- jContentPane.add(jLabelExit, null);
- jContentPane.add(getJButtonResume(), null);
- jContentPane.add(getJButtonExit(), null);
- }
- return jContentPane;
- }
-
- /**
- Call setWarningMessage to set messages of frame when it is used for Setup
-
- **/
- public void setSetupMessage() {
- String strTitle = "Exit Setup";
- String strMessage = "Setup is not complete. If you quit now, the program will not be installed.";
- String strResume = "You may run the setup program at a later time to complete the installation.";
- String strExit = "To continue installing, click Resume. To quit the Setup program, click Exit.";
- setWarningMessage(strTitle, strMessage, strResume, strExit);
- }
-
- /**
- Call setWarningMessage to set messages of frame when it is used for Module Main GUI
-
- **/
- public void setModuleMessage() {
- String strTitle = "Exit";
- String strMessage = "Do you really want to quit now?";
- String strResume = "All unsaved module information will be lost.";
- String strExit = "To continue editing the module, click Resume. To quit the program, click Exit.";
- setWarningMessage(strTitle, strMessage, strResume, strExit);
- }
-
- /**
- Set message information via input data
-
- @param strTitle The title value
- @param strMessage The main message value
- @param strResume The resume message value
- @param strExit The exit message value
-
- **/
- private void setWarningMessage(String strTitle, String strMessage, String strResume, String strExit) {
- this.setTitle(strTitle);
- jLabelMessage.setText(strMessage);
- jLabelResume.setText(strResume);
- jLabelExit.setText(strExit);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listern all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- //
- //Set isCancel true when click button "Exit"
- //
- Object obj = arg0.getSource();
- if (obj == jButtonResume) {
- isCancel = false;
- }
- if (obj == jButtonExit) {
- isCancel = true;
- }
- this.setVisible(false);
- }
-
- /**
- Make the window in the center of the screen
-
- **/
- private void centerWindow() {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosed(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosing(WindowEvent arg0) {
- isCancel = false;
- this.setVisible(false);
- }
-
- public void windowDeactivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeiconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowIconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowOpened(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java deleted file mode 100644 index c5a51fd3e6..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java +++ /dev/null @@ -1,227 +0,0 @@ -/** @file
-
- The file is used to override JComboBox to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-
-/**
- The class is used to override JComboBox to provides customized interfaces
- It extends JComboBox implements KeyListener, MouseListener and FocusListener
-
-
-
- **/
-public class IComboBox extends JComboBox implements KeyListener, MouseListener, FocusListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1940262568168458911L;
-
- public void focusGained(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
- *
- * Override focusLost to exit edit mode
- *
- */
- public void focusLost(FocusEvent arg0) {
- this.closeEdit();
- }
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- JFrame jf = new JFrame();
- jf.setSize(500, 200);
- JPanel jp = new JPanel();
- jp.setLayout(null);
- IComboBox icb = new IComboBox();
- jp.add(icb, null);
- jf.setContentPane(jp);
- jf.setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public IComboBox() {
- super();
- init();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(320, 20);
- this.setEditable(false);
- this.editor.addActionListener(this);
- this.addMouseListener(this);
- this.addKeyListener(this);
- this.getEditor().getEditorComponent().addKeyListener(this);
- this.getEditor().getEditorComponent().addFocusListener(this);
- this.setToolTipText("<html>Double Click to add an entry, then finish by press ENTER.<br>"
- + "Selecting DELETE will remove selected entry.</html>");
- }
-
- public void keyPressed(KeyEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- *
- * Override keyReleased to listen key action
- *
- */
- public void keyReleased(KeyEvent arg0) {
- //
- //Add new item to list when press ENTER
- //
- if (arg0.getSource() == this.getEditor().getEditorComponent()) {
- if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
- String strCurrentText = this.getEditor().getItem().toString().trim();
- if (strCurrentText.length() == 0) {
- if (this.getItemCount() > 0) {
- this.setSelectedIndex(0);
- }
- } else {
- this.addItem(strCurrentText);
- this.setSelectedItem(strCurrentText);
- }
- this.setEditable(false);
- }
-
- if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE) {
- closeEdit();
- }
- }
-
- if (arg0.getSource() == this) {
- //
- //Remove item from the list when press DEL
- //
- if (arg0.getKeyCode() == KeyEvent.VK_DELETE) {
- int intSelected = this.getSelectedIndex();
- if (intSelected > -1) {
- this.removeItemAt(this.getSelectedIndex());
- if (this.getItemCount() > 0) {
- this.setSelectedIndex(0);
- } else {
- this.removeAllItems();
- }
- }
- }
- }
- }
-
- public void keyTyped(KeyEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- * Override mouseClicked to enter edit mode when double click mouse
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- this.setEditable(true);
- this.getEditor().setItem("");
- }
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Exit edit mode
-
- **/
- private void closeEdit() {
- this.setEditable(false);
- this.getEditor().setItem("");
- }
-
- /**
- Set the input item as selected
-
- @param item the item which is needed to be set selected
-
- **/
- public void setSelectedItem(Object item) {
- boolean isFind = false;
- //
- // If the input value is not in the default list, add it to the list
- //
- if (item != null) {
- for (int index = 0; index < this.getItemCount(); index++) {
- if (this.getItemAt(index).equals(item)) {
- isFind = true;
- break;
- }
- }
- //
- // Add this item to IComboBox if not found
- //
- if (!isFind && !item.toString().equals("")) {
- super.addItem(item);
- }
- }
-
- //
- // Call super function to set the item selected.
- //
- super.setSelectedItem(item);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java deleted file mode 100644 index 4708191ac9..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java +++ /dev/null @@ -1,280 +0,0 @@ -/** @file
-
-
- The file is used to override DefaultMutableTreeNode to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-
-/**
- The class is used to override DefaultMutableTreeNode to provides customized interfaces
- It extends DefaultMutableTreeNode
-
-
-
- **/
-public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1947340717458069548L;
-
- //
- // Static final definitions for all kinds of node
- //
- public static final int MSA_HEADER = 100;
-
- public static final int MSA_LIBRARYCLASSDEFINITIONS = 101;
-
- public static final int MSA_PACKAGEDEPENDENCIES = 102;
-
- public static final int MSA_SOURCEFILES = 103;
-
- public static final int MSA_PROTOCOLS = 104;
-
- public static final int MSA_EVENTS = 105;
-
- public static final int MSA_HOBS = 106;
-
- public static final int MSA_PPIS = 107;
-
- public static final int MSA_VARIABLES = 108;
-
- public static final int MSA_BOOTMODES = 109;
-
- public static final int MSA_SYSTEMTABLES = 110;
-
- public static final int MSA_DATAHUBS = 111;
-
- public static final int MSA_HIIPACKAGES = 112;
-
- public static final int MSA_GUIDS = 113;
-
- public static final int MSA_EXTERNS = 114;
-
- public static final int MSA_PCDS = 115;
-
- public static final int MSA_BUILDOPTIONS = 117;
-
- public static final int MSA_USEREXTENSIONS = 118;
-
- public static final int MSA_MODULEDEFINITIONS = 119;
-
- public static final int SPD_HEADER = 200;
-
- public static final int SPD_LIBRARYCLASSDECLARATIONS = 201;
-
- public static final int SPD_MSAFILES = 202;
-
- public static final int SPD_PACKAGEHEADERS = 203;
-
- public static final int SPD_GUIDDECLARATIONS = 204;
-
- public static final int SPD_PROTOCOLDECLARATIONS = 205;
-
- public static final int SPD_PPIDECLARATIONS = 206;
-
- public static final int SPD_PCDDECLARATIONS = 207;
-
- public static final int SPD_PACKAGEDEFINITIONS = 208;
-
- public static final int SPD_INDUSTRYSTDINCLUDES = 209;
-
- public static final int FPD_PLATFORMHEADER = 300;
-
- public static final int FPD_FLASH = 301;
-
- public static final int FPD_FRAMEWORKMODULES = 302;
-
- public static final int FPD_PCDDYNAMICBUILDDECLARATIONS = 303;
-
- public static final int FPD_BUILDOPTIONS = 304;
-
- public static final int FPD_PLATFORMDEFINITIONS = 305;
-
- public static final int WORKSPACE = 0;
-
- public static final int MODULE_DESCRIPTION = 1;
-
- public static final int PACKAGE_DESCRIPTION = 2;
-
- public static final int PLATFORM_DESCRIPTION = 3;
-
- public static final int MODULE = 4;
-
- public static final int PACKAGE = 5;
-
- public static final int PLATFORM = 6;
-
- public static final int MODULE_PACKAGE = 7;
-
- public static final int MODULE_PACKAGE_LIBRARY = 8;
-
- public static final int MODULE_PACKAGE_MODULE = 9;
-
- //
- //Static final definitions for operation
- //
- public static final int OPERATION_NULL = 0;
-
- public static final int OPERATION_ADD = 1;
-
- public static final int OPERATION_UPDATE = 2;
-
- public static final int OPERATION_DELETE = 4;
-
- public static final int OPERATION_ADD_UPDATE = 3;
-
- public static final int OPERATION_ADD_DELETE = 5;
-
- public static final int OPERATION_UPDATE_DELETE = 6;
-
- public static final int OPERATION_ADD_UPDATE_DELETE = 7;
-
- //
- //Define 4 node attributes
- //
- private int category = 0;
-
- private String nodeName = "";
-
- private boolean isOpening = false;
-
- private Identification id = null;
-
- private IDefaultMutableTreeNode belongNode = null;
-
- /**
- This is the default constructor
-
- **/
- public IDefaultMutableTreeNode() {
- super();
- }
-
- /**
- This is the overrided constructor
- Init clase members with input data
-
- @param strNodeName The name of node
- @param intCategory The category of node
- @param bolIsOpened to identify if the node is opening or not
- @param identification The Identification of node
-
- **/
- public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
- Identification identification, IDefaultMutableTreeNode idmtBelongNode) {
- super(strNodeName);
- this.nodeName = strNodeName;
- this.category = intCategory;
- this.isOpening = bolIsOpening;
- this.id = identification;
- this.belongNode = idmtBelongNode;
- }
-
- /**
- Get category of node
-
- @return The category of node
-
- **/
- public int getCategory() {
- return category;
- }
-
- /**
- Set category of node
-
- @param category The input data of node category
-
- **/
- public void setCategory(int category) {
- this.category = category;
- }
-
- /**
- Get name of node
-
- @return The name of node
-
- **/
- public String getNodeName() {
- return nodeName;
- }
-
- /**
- Set name of node
-
- @param nodeName The input data of node name
-
- **/
- public void setNodeName(String nodeName) {
- this.nodeName = nodeName;
- }
-
- /**
- Get identification of node
-
- @return
-
- **/
- public Identification getId() {
- return id;
- }
-
- /**
- Set identification of node
-
- @param id
-
- **/
- public void setId(Identification id) {
- this.id = id;
- }
-
- /**
- get isOpening of node
-
- @return
-
- **/
- public boolean isOpening() {
- return isOpening;
- }
-
- /**
- Set isOpening of node
-
- @param isOpening
-
- **/
- public void setOpening(boolean isOpening) {
- this.isOpening = isOpening;
- }
-
- public String toString() {
- return this.nodeName;
- }
-
- public IDefaultMutableTreeNode getBelongNode() {
- return belongNode;
- }
-
- public void setBelongNode(IDefaultMutableTreeNode belongNode) {
- this.belongNode = belongNode;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java deleted file mode 100644 index dc668e7ed3..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java +++ /dev/null @@ -1,76 +0,0 @@ -/** @file
-
- The file is used to override DefaultDesktopManager to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.DefaultDesktopManager;
-import javax.swing.JComponent;
-
-/**
- The class is used to override DefaultDesktopManager to provides customized interfaces
- It extends DefaultDesktopManager
-
-
-
- **/
-public class IDesktopManager extends DefaultDesktopManager {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4596986878722011062L;
-
- /**
- Main class, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#dragFrame(javax.swing.JComponent, int, int)
- *
- * Override dragFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void dragFrame(JComponent f, int newX, int newY) {
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#endDraggingFrame(javax.swing.JComponent)
- *
- * Override endDraggingFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void endDraggingFrame(JComponent f) {
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#beginResizingFrame(javax.swing.JComponent, int)
- *
- * Override beginResizingFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void beginResizingFrame(JComponent f, int direction) {
-
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java deleted file mode 100644 index 1fc7c4c156..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java +++ /dev/null @@ -1,163 +0,0 @@ -/** @file
-
- The file is used to override Dialog to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JDialog;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- The class is used to override Dialog to provides customized interfaces
- It extends JDialog implements ActionListener
-
-
-
- **/
-public class IDialog extends JDialog implements ActionListener {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7692623863358631984L;
- //
- //Define class members
- //
- private boolean isEdited = false;
-
- public int returnType = DataType.RETURN_TYPE_CANCEL;
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- IDialog id = new IDialog();
- id.setVisible(true);
- }
-
- /**
- This is the default constructor
- **/
- public IDialog() {
- super();
- initialize();
- }
-
- /**
- This is the override constructor
-
- @param parentFrame The parent frame which open the dialog
- @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog
- **/
- public IDialog(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This is the override constructor
-
- @param parentFrame The parent frame which open the dialog
- @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog
- **/
- public IDialog(IDialog parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
- this.setResizable(false);
- }
-
- /**
- Start the dialog at the center of screen
-
- @param intWidth The width of the dialog
- @param intHeight The height of the dialog
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the dialog at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
- /**
- Get if the dialog has been edited
-
- @retval true - The dialog has been edited
- @retval false - The dialog hasn't been edited
-
- **/
- public boolean isEdited() {
- return isEdited;
- }
-
- /**
- Set if the dialog has been edited
-
- @param isEdited The input data which identify if the dialog has been edited
-
- **/
- public void setEdited(boolean isEdited) {
- this.isEdited = isEdited;
- }
-
- /**
- Check the input data is empty or not
-
- @param strValue The input data which need be checked
-
- @retval true - The input data is empty
- @retval fals - The input data is not empty
-
- **/
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- /**
- Display the dialog
-
- **/
- public int showDialog() {
- this.setVisible(true);
- return returnType;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java deleted file mode 100644 index 5f3341f696..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java +++ /dev/null @@ -1,264 +0,0 @@ -/** @file
-
- The file is used to override Frame to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- The class is used to override Frame to provides customized interfaces
- It extends JFrame implements ActionListener and WindowListener
-
- **/
-public class IFrame extends JFrame implements ActionListener, WindowListener, ComponentListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3324138961029300427L;
-
- //
- //Define class members
- //
- private ExitConfirm ec = null;
-
- //
- // To indicate the status while quit
- // 0 - When setup (Default)
- // 1 - Whne editing module
- //
- private int intExitType = 0;
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- IFrame i = new IFrame();
- i.setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public IFrame() {
- super();
- initialize();
- }
-
- /**
- This method initializes this
-
- **/
- public void initialize() {
- this.setResizable(false);
- this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- this.addWindowListener(this);
- this.addComponentListener(this);
- }
-
- /**
- Start the dialog at the center of screen
-
- @param intWidth The width of the dialog
- @param intHeight The height of the dialog
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window full of the screen
-
- **/
- protected void maxWindow() {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation(0, 0);
- this.setSize(d);
- }
-
- /**
- Start the dialog at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
- /**
- Set the exit window type
-
- @param ExitType The input data of ExitType
-
- **/
- protected void setExitType(int ExitType) {
- this.intExitType = ExitType;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to call this.onDisvisible()
- *
- */
- public void windowClosing(WindowEvent arg0) {
- //this.onDisvisible();
- }
-
- public void windowOpened(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosed(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowIconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeiconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeactivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Define the actions when exit
-
- **/
- public void onExit() {
- ec = new ExitConfirm(this, true);
- //
- //Show different warning message via different ExitType
- //
- switch (intExitType) {
- case 0:
- ec.setSetupMessage();
- break;
- case 1:
- ec.setModuleMessage();
- break;
- }
- ec.setVisible(true);
- if (ec.isCancel) {
- this.dispose();
- System.exit(0);
- }
- }
-
- /**
- Define the actions when disvisible
-
- **/
- public void onDisvisible() {
- ec = new ExitConfirm(this, true);
- //
- //Show different warning message via different ExitType
- //
- switch (intExitType) {
- case 0:
- ec.setSetupMessage();
- break;
- case 1:
- ec.setModuleMessage();
- break;
- }
- ec.setVisible(true);
- if (ec.isCancel) {
- this.dispose();
- }
- }
-
- public int showSaveDialog() {
- return JOptionPane.showConfirmDialog(this, "Save all changed files?", "Save", JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.WARNING_MESSAGE);
- }
-
- /**
- Check the input data is empty or not
-
- @param strValue The input data which need be checked
-
- @retval true - The input data is empty
- @retval fals - The input data is not empty
-
- **/
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- /**
- Display the dialog
-
- **/
- public void showDialog() {
- this.setVisible(true);
- }
-
- public void componentResized(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentMoved(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentShown(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentHidden(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java deleted file mode 100644 index f0d018605d..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java +++ /dev/null @@ -1,216 +0,0 @@ -/** @file
-
- The file is used to override JInternalFrame to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JDesktopPane;
-import javax.swing.JFrame;
-import javax.swing.JInternalFrame;
-import javax.swing.JPanel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- * The class is used to override JInternalFrame to provides customized
- * interfaces It extends JInternalFrame implements ActionListener
- *
- *
- *
- */
-public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener,
- FocusListener, ListSelectionListener, TableModelListener, MouseListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -609841772384875886L;
-
- //
- // Define class members
- //
- private boolean isEdited = false;
-
- /**
- * Main class, used for test
- *
- * @param args
- *
- */
- public static void main(String[] args) {
- JFrame jf = new JFrame();
- JPanel jp = new JPanel();
- JDesktopPane jdp = new JDesktopPane();
- IInternalFrame itf = new IInternalFrame();
- jdp.add(itf, 1);
- jf.setContentPane(jp);
- jf.setVisible(true);
- }
-
- /**
- * This is the default constructor
- *
- */
- public IInternalFrame() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- */
- private void initialize() {
- this.setBounds(new java.awt.Rectangle(0, 0, 520, 545));
- this.setMinimumSize(new java.awt.Dimension(520, 545));
- this.addComponentListener(this);
- }
-
- /**
- * Get if the InternalFrame has been edited
- *
- * @retval true - The InternalFrame has been edited
- * @retval false - The InternalFrame hasn't been edited
- *
- */
- public boolean isEdited() {
- return isEdited;
- }
-
- /**
- * Set if the InternalFrame has been edited
- *
- * @param isEdited
- * The input data which identify if the InternalFrame has been
- * edited
- *
- */
- public void setEdited(boolean isEdited) {
- this.isEdited = isEdited;
- }
-
- /**
- * Check the input data is empty or not
- *
- * @param strValue
- * The input data which need be checked
- *
- * @retval true - The input data is empty
- * @retval fals - The input data is not empty
- *
- */
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void componentHidden(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentMoved(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentResized(ComponentEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void componentShown(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void showStandard() {
-
- }
-
- public void showAdvanced() {
-
- }
-
- public void showXML() {
-
- }
-
- public void itemStateChanged(ItemEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void focusGained(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void focusLost(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void valueChanged(ListSelectionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseClicked(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java deleted file mode 100644 index 252c34ff72..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java +++ /dev/null @@ -1,231 +0,0 @@ -/** @file
-
- The file is used to override JTree to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.JTree;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-
-/**
- The class is used to override JTree to provides customized interfaces
- It extends JTree
-
- **/
-public class ITree extends JTree {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7907086164518295327L;
-
- //
- // Define class members
- //
- DefaultTreeModel treeModel = null;
-
- /**
- This is the default constructor
-
- **/
- public ITree() {
- super();
- }
-
- /**
- This is the overrided constructor
- Init class members with input data
-
- @param iDmtRoot The root node of the tree
-
- **/
- public ITree(IDefaultMutableTreeNode iDmtRoot) {
- super(iDmtRoot);
- treeModel = (DefaultTreeModel) this.getModel();
- }
-
- /**
- Get category of selected node
-
- @return The category of selected node
-
- **/
- public int getSelectCategory() {
- int intCategory = 0;
- TreePath path = this.getSelectionPath();
- IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
- intCategory = node.getCategory();
- return intCategory;
- }
-
- /**
- Add input node as child node for current selected node
-
- @param strNewNode The name of the node which need be added
-
- **/
- public void addNode(String strNewNode) {
- DefaultMutableTreeNode parentNode = null;
- DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(strNewNode);
- newNode.setAllowsChildren(true);
- TreePath parentPath = this.getSelectionPath();
-
- /**
- * Get parent node of new node
- */
- parentNode = (DefaultMutableTreeNode) (parentPath.getLastPathComponent());
-
- /**
- * Insert new node
- */
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Add input node as child node for current selected node
-
- @param newNode The node need be added
-
- **/
- public void addNode(IDefaultMutableTreeNode newNode) {
- IDefaultMutableTreeNode parentNode = null;
- newNode.setAllowsChildren(true);
- TreePath parentPath = this.getSelectionPath();
- parentNode = (IDefaultMutableTreeNode) (parentPath.getLastPathComponent());
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Add input node as child node for current selected node
-
- @param newNode The node need be added
-
- **/
- public void addNode(IDefaultMutableTreeNode parentNode, IDefaultMutableTreeNode newNode) {
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Remove the selected node
-
- @param strRemovedNode
-
- **/
- public void removeSelectedNode() {
- TreePath treePath = this.getSelectionPath();
- removeNodeByPath(treePath);
- }
-
- /**
- Remove the node by tree path
-
- @param strRemovedNode
-
- **/
- public void removeNodeByPath(TreePath treePath) {
- if (treePath != null) {
- DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
- TreeNode parent = (TreeNode) selectionNode.getParent();
- if (parent != null) {
- treeModel.removeNodeFromParent(selectionNode);
- }
- }
- }
-
- /**
- Return a node by input tree path
-
- @param treePath
- @return
-
- **/
- public IDefaultMutableTreeNode getNodeByPath(TreePath treePath) {
- if (treePath != null) {
- IDefaultMutableTreeNode selectionNode = (IDefaultMutableTreeNode) treePath.getLastPathComponent();
- return selectionNode;
- }
- return null;
- }
-
- /**
- Remove all child nodes under current node
-
- **/
- public void removeNodeChildrenByPath(TreePath treePath) {
- if (treePath != null) {
- DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
- for (int index = currentNode.getChildCount() - 1; index > -1; index--) {
- treeModel.removeNodeFromParent((DefaultMutableTreeNode) currentNode.getChildAt(index));
- }
- }
- }
-
- /**
- Remove all nodes of the tree
-
- **/
- public void removeAllNode() {
- DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
- rootNode.removeAllChildren();
- treeModel.reload();
- }
-
- public IDefaultMutableTreeNode getSelectNode() {
- TreePath treepath = this.getSelectionPath();
- IDefaultMutableTreeNode selectionNode = null;
- if (treepath != null) {
- selectionNode = (IDefaultMutableTreeNode) treepath.getLastPathComponent();
- }
- return selectionNode;
- }
-
- public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id) {
- for (int index = 0; index < node.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
- if (iNode.getId().equals(id)) {
- return iNode;
- }
- }
- return null;
- }
-
- public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id, int category) {
- for (int index = 0; index < node.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
- if (iNode.getId().equals(id) && iNode.getCategory() == category) {
- return iNode;
- }
- IDefaultMutableTreeNode childNode = getNodeById(iNode, id, category);
- if (childNode != null) {
- return childNode;
- }
- }
- return null;
- }
-
- public TreePath getPathOfNode(IDefaultMutableTreeNode node) {
- if (node != null) {
- TreePath treePath = new TreePath(treeModel.getPathToRoot(node));
- return treePath;
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java deleted file mode 100644 index 3641df0373..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java +++ /dev/null @@ -1,64 +0,0 @@ -/** @file
-
- The file is used to override JLabel to provides customized interfaces
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.JLabel;
-
-/**
- The class is used to override JLabel to provides customized interfaces
-
-
-
- **/
-public class StarLabel extends JLabel {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6702981027831543919L;
-
- /**
- Main class, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- This is the default constructor
-
- **/
- public StarLabel() {
- super();
- init();
- }
-
- /**
- To create a RED, BOLD and 14 size "*"
-
- **/
- private void init() {
- this.setText("*");
- this.setSize(new java.awt.Dimension(10, 20));
- this.setForeground(java.awt.Color.red);
- this.setFont(new java.awt.Font("DialogInput", java.awt.Font.BOLD, 14));
- this.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java deleted file mode 100644 index 6fbdf03ddd..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java +++ /dev/null @@ -1,203 +0,0 @@ -/** @file
-
- The file is used to override JList to create a List with CheckBox item
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.util.Vector;
-
-import javax.swing.JList;
-
-public class ICheckBoxList extends JList {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -2843059688070447632L;
-
- protected ICheckBoxListCellRenderer cellrenderer = new ICheckBoxListCellRenderer();
-
- protected ICheckBoxListener listener = new ICheckBoxListener(this);
-
- protected ICheckBoxListModel model = new ICheckBoxListModel();
-
- /**
- This the default Constructor
-
- **/
- public ICheckBoxList() {
- this(null);
- }
-
- /**
- This the override constructor to create checkbox item with input vector
-
- @param options
-
- **/
- public ICheckBoxList(Vector<ICheckBoxListItem> items) {
- if (items != null) {
- for (int index = 0; index < items.size(); index++) {
- model.addElement(items.elementAt(index));
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
- this.setCellRenderer(cellrenderer);
- this.setModel(model);
- this.addMouseListener(listener);
- this.addKeyListener(listener);
- }
-
- /**
- Set all items of the CheckBoxList component.
-
- @param items
-
- **/
- public void setAllItems(Vector<String> items) {
- if (items != null) {
- model.removeAllElements();
- for (int index = 0; index < items.size(); index++) {
- model.addElement(new ICheckBoxListItem(items.elementAt(index)));
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
- }
-
- /**
- Get All Checked Items of the CheckBoxList component.
-
- @return All Checked Items
- **/
- public Vector<ICheckBoxListItem> getAllCheckedItems() {
- Vector<ICheckBoxListItem> result = new Vector<ICheckBoxListItem>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement((ICheckBoxListItem) this.getModel().getElementAt(i));
- }
- }
- return result;
- }
-
- /**
- Get All Checked Items index of the CheckBoxList component.
-
- @return All Checked Items index
- **/
- public Vector<Integer> getAllCheckedItemsIndex() {
- Vector<Integer> result = new Vector<Integer>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement(i);
- }
- }
- return result;
- }
-
- /**
- Get All Checked Items String of the CheckBoxList component.
-
- @return Vector
- **/
- public Vector<String> getAllCheckedItemsString() {
- Vector<String> result = new Vector<String>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
- }
- }
- return result;
- }
-
- /**
- Get All Items String of the CheckBoxList component.
-
- @return Vector
- **/
- public Vector<String> getAllItemsString() {
- Vector<String> result = new Vector<String>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
- }
- return result;
- }
-
- /**
- Set Checked status for all input items.
-
- **/
- public void initCheckedItem(boolean bool, Vector<String> items) {
- if (items != null && items.size() != 0) {
- for (int indexI = 0; indexI < items.size(); indexI++) {
- for (int indexJ = 0; indexJ < model.size(); indexJ++) {
- if (items.elementAt(indexI).equals(model.getAllElements().elementAt(indexJ).getText())) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(indexJ);
- listItem.setChecked(bool);
- break;
- }
- }
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
-
- this.validate();
- }
-
- /**
- Set all items of the compontent checked
-
- **/
- public void setAllItemsChecked() {
- initCheckedItem(true, this.getAllItemsString());
- }
-
- /**
- Set all items of the compontent unchecked
-
- **/
- public void setAllItemsUnchecked() {
- initCheckedItem(false, this.getAllItemsString());
- }
-
- /**
- Remove all items of list
-
- **/
- public void removeAllItem() {
- model.removeAllElements();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java deleted file mode 100644 index 1b022fc908..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java +++ /dev/null @@ -1,76 +0,0 @@ -/** @file
-
- The file is used to create cell renderer for CheckBoxList Item
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
-
-class ICheckBoxListCellRenderer extends JCheckBox implements ListCellRenderer {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1718072217181674870L;
-
- protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
-
- /**
- This is the default Constructor
-
- **/
- public ICheckBoxListCellRenderer() {
- super();
- setOpaque(true);
- setBorder(noFocusBorder);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
- * Override to get attribute of the ICheckListCellRenderer
- *
- */
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
- boolean cellHasFocus) {
- ICheckBoxListItem item = (ICheckBoxListItem) value;
-
- setComponentOrientation(list.getComponentOrientation());
-
- if (item.isChecked()) {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- } else {
- if (isSelected) {
- setBackground(Color.LIGHT_GRAY);
- setForeground(list.getForeground());
- } else {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
- }
-
- if (value instanceof ICheckBoxListItem) {
- setText(item.getText());
- setSelected(item.isChecked());
- } else {
- setIcon(null);
- setText((value == null) ? "" : value.toString());
- }
-
- setEnabled(list.isEnabled());
- setFont(list.getFont());
-
- return this;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java deleted file mode 100644 index a087887e2f..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java +++ /dev/null @@ -1,84 +0,0 @@ -/** @file
-
- The file is used to create list item for CheckBox list
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-public class ICheckBoxListItem {
-
- //
- // Define Class Members
- //
- protected String text;
-
- protected boolean checked;
-
- protected boolean selected;
-
- /**
- This is the default constructor to set check box item string
-
- @param text
-
- **/
- public ICheckBoxListItem(String text) {
- this.text = text;
- }
-
- /**
- This is the override constructor to set check box item string and checked status
-
- @param text
- @param checked
-
- **/
- public ICheckBoxListItem(String text, boolean checked) {
- this.text = text;
- this.checked = checked;
- }
-
- /**
- set the checked status
- if true, set false
- if false, set true
-
- **/
- public void invertChecked() {
- checked = !checked;
- }
-
- public boolean isChecked() {
- return checked;
- }
-
- public void setChecked(boolean checked) {
- this.checked = checked;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public boolean isSelected() {
- return selected;
- }
-
- public void setSelected(boolean selected) {
- this.selected = selected;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java deleted file mode 100644 index f3bbe8a3a0..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java +++ /dev/null @@ -1,67 +0,0 @@ -/** @file
-
- The file is used to override DefaultListModel to create ICheckBoxListModel
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import javax.swing.*;
-import java.util.Vector;
-
-public class ICheckBoxListModel extends DefaultListModel {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8617800969723991017L;
-
- /**
- This is the default Constructor for the CheckBoxListModel object
-
- **/
- public ICheckBoxListModel() {
- }
-
- /**
- override DefaultListModel's add method
-
- @param index
- @param item
-
- **/
- public void add(int index, ICheckBoxListItem item) {
- super.add(index, item);
- }
-
- /**
- Add one item at tail
-
- @param item
-
- **/
- public void addElement(ICheckBoxListItem item) {
- super.addElement(item);
- }
-
- /**
- Get all elements of the list
-
- **/
- public Vector<ICheckBoxListItem> getAllElements() {
- Vector<ICheckBoxListItem> items = new Vector<ICheckBoxListItem>();
- ICheckBoxListItem[] objs = new ICheckBoxListItem[this.size()];
- this.copyInto(objs);
- for (int i = 0; i < size(); i++) {
- items.addElement(objs[i]);
- }
- return items;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java deleted file mode 100644 index e95d279e59..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java +++ /dev/null @@ -1,104 +0,0 @@ -/** @file
-
- The file is used to create listener for Checkbox List
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.awt.event.*;
-
-class ICheckBoxListener implements MouseListener, KeyListener {
-
- protected ICheckBoxList iCheckboxlist;
-
- /**
- This is the default constructor
-
- @param parent
-
- **/
- public ICheckBoxListener(ICheckBoxList parent) {
- iCheckboxlist = parent;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- * Override to deal with keyReleased event
- *
- *
- */
- public void keyReleased(KeyEvent e) {
- Object[] selectedValues = iCheckboxlist.getSelectedValues();
- int[] selectedIndices = iCheckboxlist.getSelectedIndices();
-
- for (int index = 0; index < selectedValues.length; index++) {
- ICheckBoxListItem item = (ICheckBoxListItem) selectedValues[index];
-
- if (iCheckboxlist.isEnabled()) {
- if (e.getKeyCode() == KeyEvent.VK_SPACE) {
- //
- //if press space key, then reverse all selected item.
- //
- item.invertChecked();
- }
- ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, selectedIndices[index]);
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- * Override to deal with mouse clicked event
- *
- */
- public void mouseClicked(MouseEvent e) {
- int index = iCheckboxlist.locationToIndex(e.getPoint());
- ICheckBoxListItem item = null;
- item = (ICheckBoxListItem) iCheckboxlist.getModel().getElementAt(index);
-
- if (item != null && iCheckboxlist.isEnabled()) {
- item.invertChecked();
- ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, index);
- }
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyPressed(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyTyped(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
|