diff options
Diffstat (limited to 'Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui')
4 files changed, 0 insertions, 1618 deletions
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java deleted file mode 100644 index ab2ffd07ee..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java +++ /dev/null @@ -1,334 +0,0 @@ -/** @file
-
- 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.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.far.AggregationOperation;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.far.PackageQuery;
-import org.tianocore.frameworkwizard.far.PackageQueryInterface;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class CreateStepFour extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -7397213364965470902L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextAreaInstruction = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel2 = null;
-
- private JTextField jTextFieldSaveToFile = null;
-
- private JButton jButtonBrowser = null;
-
- // private JScrollPane jScrollPane = null;
- private JButton jButtonCancel = null;
-
- private JButton jButtonFinish = null;
-
- private JButton jButtonPrevious = null;
-
- private IDefaultTableModel model = null;
-
- private CreateStepThree stepThree = null;
-
- // private JTable jTable = null;
- public CreateStepFour(IDialog iDialog, boolean modal, CreateStepThree stepThree) {
- this(iDialog, modal);
- this.stepThree = stepThree;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextAreaInstruction == null) {
- jTextAreaInstruction = new JTextArea();
- jTextAreaInstruction.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextAreaInstruction.setText("Step 4: Choose a file \n");
- jTextAreaInstruction.setEditable(false);
- }
- return jTextAreaInstruction;
- }
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextField1() {
- if (jTextFieldSaveToFile == null) {
- jTextFieldSaveToFile = new JTextField();
- jTextFieldSaveToFile.setBounds(new java.awt.Rectangle(147,70,412,20));
- }
- return jTextFieldSaveToFile;
- }
-
- /**
- * This method initializes jButtonBrowser
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrower() {
- if (jButtonBrowser == null) {
- jButtonBrowser = new JButton();
- jButtonBrowser.setBounds(new java.awt.Rectangle(570, 70, 100, 20));
- jButtonBrowser.setText("Browser...");
- jButtonBrowser.addMouseListener(this);
- }
- return jButtonBrowser;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- // private JScrollPane getJScrollPane() {
- // if (jScrollPane == null) {
- // jScrollPane = new JScrollPane();
- // jScrollPane.setBounds(new java.awt.Rectangle(139,85,500,100));
- // jScrollPane.setViewportView(getJTable());
- // }
- // return jScrollPane;
- // }
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFinish() {
- if (jButtonFinish == null) {
- jButtonFinish = new JButton();
- jButtonFinish.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonFinish.setText("Finish");
- jButtonFinish.addMouseListener(this);
- }
- return jButtonFinish;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- jButtonPrevious.setVisible(true);
- }
- return jButtonPrevious;
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepFour(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_FOUR_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel2 = new JLabel();
- jLabel2.setBounds(new java.awt.Rectangle(30,70,111,18));
- jLabel2.setText("File to Save: ");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(29,108,320,20));
- jLabel.setText("This FAR will depend on the following packages: ");
- jLabel.setVisible(false);
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- // jContentPane.add(getJScrollPane(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonFinish(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(jLabel2, null);
- jContentPane.add(getJTextField1(), null);
- jContentPane.add(getJButtonBrower(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonFinish) {
- //
- // Add some logic process here
- // Guid Check, File Check etc.
- //
- if (this.jTextFieldSaveToFile.getText() == null) {
- Log.wrn("Create far", "Please input the Far name!");
- }
- try {
- //
- // Create an output stream for JAR
- //
-
- Far far = new Far(new File(this.jTextFieldSaveToFile.getText()));
-
- far.creatFar(this.getPreviousStep().getPreviousStep().getSelectedPackages(),
- this.getPreviousStep().getPreviousStep().getSelectedPlatforms(), this.getPreviousStep()
- .getFileFilter(),
- this.getPreviousStep().getPreviousStep().getPreviousStep().getFarHeader());
- } catch (Exception exp) {
- Log.wrn("Create far", exp.getMessage());
- Log.err("Create far", exp.getMessage());
- return;
- }
- getPreviousStep().getPreviousStep().getPreviousStep().returnType = DataType.RETURN_TYPE_OK;
- getPreviousStep().getPreviousStep().dispose();
- getPreviousStep().dispose();
- this.setVisible(false);
- this.dispose();
- } else if (e.getSource() == jButtonBrowser) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
-
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldSaveToFile.setText(Tools.addPathExt(fc.getSelectedFile().getPath(),
- DataType.RETURN_TYPE_FAR_SURFACE_AREA));
- }
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepThree.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public CreateStepThree getPreviousStep() {
- return stepThree;
- }
-
- public void prepareTable() {
- model.setRowCount(0);
-
- List<PackageIdentification> packageList = new ArrayList<PackageIdentification>();
- //
- // Change here to get packages and platforms from FAR
- //
- List<PackageIdentification> selectedPackages = getPreviousStep().getPreviousStep().getSelectedPackages();
- PackageQueryInterface pq = new PackageQuery();
-
- Iterator<PackageIdentification> iter = selectedPackages.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- List<PackageIdentification> list = pq.getPackageDependencies(item.getSpdFile());
- packageList = AggregationOperation.union(list, packageList);
- }
-
- packageList = AggregationOperation.minus(packageList, selectedPackages);
-
- iter = packageList.iterator();
- while (iter.hasNext()) {
- String[] str = new String[3];
- PackageIdentification item = iter.next();
- str[2] = item.getName();
- str[1] = item.getVersion();
- str[0] = item.getGuid();
- model.addRow(str);
- }
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java deleted file mode 100644 index 0126b96f38..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java +++ /dev/null @@ -1,641 +0,0 @@ -/** @file
-
- 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.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.far.FarHeader;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-
-public class CreateStepOne extends IDialog implements MouseListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -8152099582923006900L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelLicense = null;
-
- private JTextArea jTextAreaLicense = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jLabelDescription = null;
-
- private JTextArea jTextAreaDescription = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JButton jButtonOk = null;
-
- private JScrollPane jScrollPaneLicense = null;
-
- private JScrollPane jScrollPaneDescription = null;
-
- private JLabel jLabelAbstract = null;
-
- private JTextField jTextFieldAbstract = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel6 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private StarLabel jStarLabel10 = null;
-
- private StarLabel jStarLabel12 = null;
-
- private JLabel jLabelURL = null;
-
- private JTextField jTextFieldURL = null;
-
- private JScrollPane jScrollPane = null;
-
- private CreateStepTwo stepTwo = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonNext = null;
-
- private FarHeader farHeader = new FarHeader();
-
- private JScrollPane jScrollPaneCopyright = null;
-
- private JTextArea jTextAreaCopyright = null;
-
- /**
- * This method initializes jTextFieldBaseName
- *
- * @return javax.swing.JTextField jTextFieldBaseName
- *
- */
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 520, 20));
- jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Drivers, of the Framework Archive.");
- }
- return jTextFieldBaseName;
- }
-
- /**
- * This method initializes jTextFieldGuid
- *
- * @return javax.swing.JTextField jTextFieldGuid
- *
- */
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 35, 410, 20));
- jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number (8-4-4-4-12)");
- }
- return jTextFieldGuid;
- }
-
- /**
- * This method initializes jTextFieldVersion
- *
- * @return javax.swing.JTextField jTextFieldVersion
- *
- */
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 60, 520, 20));
- jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01");
- }
- return jTextFieldVersion;
- }
-
- /**
- * This method initializes jButtonGenerateGuid
- *
- * @return javax.swing.JButton jButtonGenerateGuid
- *
- */
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(590, 35, 90, 20));
- jButtonGenerateGuid.setText("Generate");
- jButtonGenerateGuid.addMouseListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- * This method initializes jTextAreaLicense
- *
- * @return javax.swing.JTextArea jTextAreaLicense
- *
- */
- private JTextArea getJTextAreaLicense() {
- if (jTextAreaLicense == null) {
- jTextAreaLicense = new JTextArea();
- jTextAreaLicense.setText("");
- jTextAreaLicense.setLineWrap(true);
- jTextAreaLicense.setWrapStyleWord(true);
- jTextAreaLicense.setToolTipText("The License for this FAR file.");
- }
- return jTextAreaLicense;
- }
-
- /**
- * This method initializes jTextAreaDescription
- *
- * @return javax.swing.JTextArea jTextAreaDescription
- *
- */
- private JTextArea getJTextAreaDescription() {
- if (jTextAreaDescription == null) {
- jTextAreaDescription = new JTextArea();
- jTextAreaDescription.setLineWrap(true);
- jTextAreaDescription.setWrapStyleWord(true);
- jTextAreaDescription.setToolTipText("A verbose description of the FAR contents.");
- }
- return jTextAreaDescription;
- }
-
- /**
- * This method initializes jTextFieldSpecification
- *
- * @return javax.swing.JTextField jTextFieldSpecification
- *
- */
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
- jTextFieldSpecification.setBounds(new java.awt.Rectangle(160, 310, 520, 20));
- jTextFieldSpecification.setEditable(false);
- }
- return jTextFieldSpecification;
- }
-
- /**
- * This method initializes jScrollPaneLicense
- *
- * @return javax.swing.JScrollPane jScrollPaneLicense
- *
- */
- private JScrollPane getJScrollPaneLicense() {
- if (jScrollPaneLicense == null) {
- jScrollPaneLicense = new JScrollPane();
- jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setBounds(new java.awt.Rectangle(160, 220, 520, 60));
- jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- }
- return jScrollPaneLicense;
- }
-
- /**
- * This method initializes jScrollPaneDescription
- *
- * @return javax.swing.JScrollPane jScrollPaneDescription
- *
- */
- private JScrollPane getJScrollPaneDescription() {
- if (jScrollPaneDescription == null) {
- jScrollPaneDescription = new JScrollPane();
- jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setBounds(new java.awt.Rectangle(160, 110, 520, 60));
- jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- }
- return jScrollPaneDescription;
- }
-
- /**
- * This method initializes jTextFieldAbstract
- *
- * @return javax.swing.JTextField jTextFieldAbstract
- *
- */
- private JTextField getJTextFieldAbstract() {
- if (jTextFieldAbstract == null) {
- jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setBounds(new java.awt.Rectangle(160, 85, 520, 20));
- jTextFieldAbstract.setToolTipText("A one sentence description of this FAR package.");
- }
- return jTextFieldAbstract;
- }
-
- /**
- * This method initializes jTextFieldURL
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldURL() {
- if (jTextFieldURL == null) {
- jTextFieldURL = new JTextField();
- jTextFieldURL.setBounds(new java.awt.Rectangle(160, 285, 520, 20));
- jTextFieldURL.setToolTipText("A URL for the latest version of the license");
- }
- return jTextFieldURL;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jButtonCancel1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(590, 350, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(480, 350, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jScrollPaneCopyright
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneCopyright() {
- if (jScrollPaneCopyright == null) {
- jScrollPaneCopyright = new JScrollPane();
- jScrollPaneCopyright.setBounds(new java.awt.Rectangle(160, 175, 520, 40));
- jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());
- }
- return jScrollPaneCopyright;
- }
-
- /**
- * This method initializes jTextAreaCopyright
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaCopyright() {
- if (jTextAreaCopyright == null) {
- jTextAreaCopyright = new JTextArea();
- }
- return jTextAreaCopyright;
- }
-
- public static void main(String[] args) {
- CreateStepOne c = new CreateStepOne(new IFrame(), true);
- c.setVisible(true);
- }
-
- /**
- * This is the default constructor
- *
- */
- public CreateStepOne(IFrame iFrame, boolean modal) {
- super(iFrame, modal);
- initialize();
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldBaseName.setEnabled(!isView);
- this.jTextFieldGuid.setEnabled(!isView);
- this.jTextFieldVersion.setEnabled(!isView);
- this.jTextAreaLicense.setEnabled(!isView);
- this.jScrollPaneCopyright.setEnabled(!isView);
- this.jTextAreaCopyright.setEnabled(!isView);
- this.jTextAreaDescription.setEnabled(!isView);
- this.jTextFieldSpecification.setEnabled(!isView);
- this.jTextFieldAbstract.setEnabled(!isView);
- this.jButtonGenerateGuid.setEnabled(!isView);
- this.jButtonOk.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes this
- *
- */
- private void initialize() {
- this.setSize(700, 425);
- this.setContentPane(getJScrollPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_ONE_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jLabelURL = new JLabel();
- jLabelURL.setText("License URL");
- jLabelURL.setBounds(new java.awt.Rectangle(35, 285, 120, 20));
- jLabelBaseName = new JLabel();
- jLabelBaseName.setText("FAR Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(35, 10, 120, 20));
- jLabelGuid = new JLabel();
- jLabelGuid.setText("Guid Value");
- jLabelGuid.setBounds(new java.awt.Rectangle(35, 35, 120, 20));
- jLabelVersion = new JLabel();
- jLabelVersion.setText("Version");
- jLabelVersion.setBounds(new java.awt.Rectangle(35, 60, 120, 20));
- jLabelAbstract = new JLabel();
- jLabelAbstract.setText("Abstract");
- jLabelAbstract.setBounds(new java.awt.Rectangle(35, 85, 120, 20));
- jLabelDescription = new JLabel();
- jLabelDescription.setText("Description");
- jLabelDescription.setBounds(new java.awt.Rectangle(35, 110, 120, 20));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setBounds(new java.awt.Rectangle(35, 175, 120, 20));
- jLabelLicense = new JLabel();
- jLabelLicense.setText("License");
- jLabelLicense.setBounds(new java.awt.Rectangle(35, 220, 120, 20));
- jLabelSpecification = new JLabel();
- jLabelSpecification.setText("Specification");
- jLabelSpecification.setBounds(new java.awt.Rectangle(35, 310, 120, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
-
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelLicense, null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(jLabelDescription, null);
- jContentPane.add(jLabelSpecification, null);
- jContentPane.add(getJTextFieldSpecification(), null);
- jContentPane.add(getJScrollPaneLicense(), null);
- jContentPane.add(getJScrollPaneDescription(), null);
- jContentPane.add(jLabelAbstract, null);
- jContentPane.add(getJTextFieldAbstract(), null);
- jContentPane.add(jLabelURL, null);
- jContentPane.add(getJTextFieldURL(), null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(20, 10));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(20, 35));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(20, 60));
- jStarLabel6 = new StarLabel();
- jStarLabel6.setLocation(new java.awt.Point(20, 110));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(20, 175));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(20, 220));
- jStarLabel10 = new StarLabel();
- jStarLabel10.setLocation(new java.awt.Point(20, 85));
- jStarLabel12 = new StarLabel();
- jStarLabel12.setLocation(new java.awt.Point(20, 310));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel6, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(jStarLabel10, null);
- jContentPane.add(jStarLabel12, null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJScrollPaneCopyright(), null);
- }
- return jContentPane;
- }
-
- public boolean valid() {
- //
- // Check BaseName
- //
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Create far", "FAR Name must be entered.");
- return false;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Create far", "Incorrect data type for FAR Name");
- return false;
- }
- farHeader.setFarName(this.jTextFieldBaseName.getText());
-
- //
- // Check Guid
- //
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Create far", "A GUID must be entered.");
- return false;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Create far", "Incorrect data type for Guid");
- return false;
- }
- farHeader.setGuidValue(this.jTextFieldGuid.getText());
-
- //
- // Check Version
- //
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Create far", "A Version must be entered.");
- return false;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Create far", "Incorrect data type for Version");
- return false;
- }
- farHeader.setVersion(this.jTextFieldVersion.getText());
-
- //
- // Check Abstact
- //
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Create far", "An Abstract must be entered.");
- return false;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Create far", "Incorrect data type for Abstract");
- return false;
- }
- farHeader.setAbstractStr(this.jTextFieldAbstract.getText());
-
- //
- // Check Description
- //
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Create far", "A Description must be entered.");
- return false;
- }
- farHeader.setDescription(this.jTextAreaDescription.getText());
-
- //
- // Check Copyright
- //
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Create far", "The Copyright must be entered.");
- return false;
- }
- farHeader.setCopyright(this.jTextAreaCopyright.getText());
-
- //
- // Check License
- //
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Create far", "The License must be entered.");
- return false;
- }
- farHeader.setLicense(this.jTextAreaLicense.getText());
-
- farHeader.setSpecification(this.jTextFieldSpecification.getText());
- return true;
- }
-
- /**
- * 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) {
- if (strValue.length() > 0) {
- return false;
- }
- return true;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
- if (!valid()) {
- return ;
- }
- if (stepTwo == null) {
- stepTwo = new CreateStepTwo(this, true, this);
- }
- this.setVisible(false);
- stepTwo.setVisible(true);
- } else if (e.getSource() == jButtonGenerateGuid) {
- this.jTextFieldGuid.setText(Tools.generateUuidString());
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public FarHeader getFarHeader() {
- return farHeader;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java deleted file mode 100644 index 666082d3d4..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java +++ /dev/null @@ -1,294 +0,0 @@ -/** @file
-
- 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.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-public class CreateStepThree extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 7559888600474043337L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private JButton jButtonNext = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonPrevious = null;
-
- private JLabel jLabel = null;
-
- private ICheckBoxList jComboBoxFileFilter = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabel1 = null;
-
- private JTextField jTextField = null;
-
- Vector<String> v = new Vector<String>();
-
- private CreateStepTwo stepTwo = null;
-
- private CreateStepFour stepFour = null;
-
- public CreateStepThree(IDialog iDialog, boolean modal, CreateStepTwo stepTwo) {
- this(iDialog, modal);
- this.stepTwo = stepTwo;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Add additional file filter regular expressions in the text field, separated by space characters.\n");
- jTextArea.append("Note, for additional information about regular expressions, please reference PERL language regular expressions.");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxFileFilter() {
- if (jComboBoxFileFilter == null) {
- jComboBoxFileFilter = new ICheckBoxList();
- v.addElement(".svn");
- v.addElement("CVS");
- jComboBoxFileFilter.setAllItems(v);
- jComboBoxFileFilter.initCheckedItem(true, v);
- }
- return jComboBoxFileFilter;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 85, 640, 130));
- jScrollPane.setViewportView(getJComboBoxFileFilter());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextField() {
- if (jTextField == null) {
- jTextField = new JTextField();
- jTextField.setBounds(new java.awt.Rectangle(30, 250, 640, 20));
- }
- return jTextField;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepThree(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_THREE_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 220, 260, 20));
- jLabel1.setText("Input File Filter Pattern (regular expressions)");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 64, 160, 20));
- jLabel.setText("File Filter Pattern: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJTextField(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
-
- if (stepFour == null) {
- stepFour = new CreateStepFour(this, true, this);
- }
-
- this.setVisible(false);
- stepFour.setVisible(true);
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepTwo.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public Set<String> getFileFilter() {
- Set<String> result = new LinkedHashSet<String>();
- Vector<Integer> selected = jComboBoxFileFilter.getAllCheckedItemsIndex();
-
- Iterator<Integer> iter = selected.iterator();
-
- while (iter.hasNext()) {
- result.add(v.get(iter.next().intValue()));
- }
-
- String[] userdefined = jTextField.getText().split(" ");
-
- for (int i = 0; i < userdefined.length; i++) {
- if (!userdefined[i].trim().equalsIgnoreCase("")) {
- result.add(userdefined[i]);
- }
- }
-
- return result;
- }
-
- public CreateStepTwo getPreviousStep() {
- return stepTwo;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java deleted file mode 100644 index a2e3500c3a..0000000000 --- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java +++ /dev/null @@ -1,349 +0,0 @@ -/** @file
-
- 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.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class CreateStepTwo extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 3003841865197005528L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel1 = null;
-
- private ICheckBoxList jComboBoxPackage = null;
-
- private ICheckBoxList jComboBoxPlatform = null;
-
- private JButton jButtonNext = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPanePackage = null;
-
- private JScrollPane jScrollPanePlatform = null;
-
- private CreateStepThree stepThree = null;
-
- private Vector<PlatformIdentification> platformVector = null;
-
- private Vector<PackageIdentification> packageVector = null;
-
- private CreateStepOne stepOne = null;
-
- private JButton jButtonPrevious = null;
-
- public CreateStepTwo(IDialog iDialog, boolean modal, CreateStepOne stepOne) {
- this(iDialog, modal);
- this.stepOne = stepOne;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Choose at least one package or platform. ");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxPackage() {
- if (jComboBoxPackage == null) {
- jComboBoxPackage = new ICheckBoxList();
- WorkspaceTools wt = new WorkspaceTools();
- Vector<String> v = new Vector<String>();
- packageVector = wt.getAllPackages();
- Iterator<PackageIdentification> iter = packageVector.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- String str = item.getName() + " " + item.getVersion() + " [" + item.getPath() + "]";
- v.addElement(str);
- }
- jComboBoxPackage.setAllItems(v);
- }
- return jComboBoxPackage;
- }
-
- /**
- * This method initializes jComboBox1
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxPlatform() {
- if (jComboBoxPlatform == null) {
- jComboBoxPlatform = new ICheckBoxList();
- WorkspaceTools wt = new WorkspaceTools();
- Vector<String> v = new Vector<String>();
- platformVector = wt.getAllPlatforms();
- Iterator<PlatformIdentification> iter = platformVector.iterator();
- while (iter.hasNext()) {
- PlatformIdentification item = iter.next();
- String str = item.getName() + " " + item.getVersion() + " [" + item.getPath() + "]";
- v.addElement(str);
- }
- jComboBoxPlatform.setAllItems(v);
- }
- return jComboBoxPlatform;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePackage() {
- if (jScrollPanePackage == null) {
- jScrollPanePackage = new JScrollPane();
- jScrollPanePackage.setBounds(new java.awt.Rectangle(140,65,535,130));
- jScrollPanePackage.setViewportView(getJComboBoxPackage());
- }
- return jScrollPanePackage;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePlatform() {
- if (jScrollPanePlatform == null) {
- jScrollPanePlatform = new JScrollPane();
- jScrollPanePlatform.setBounds(new java.awt.Rectangle(140,200,535,110));
- jScrollPanePlatform.setViewportView(getJComboBoxPlatform());
- }
- return jScrollPanePlatform;
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepTwo(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_TWO_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 200, 100, 20));
- jLabel1.setText("Platforms: ");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 64, 100, 20));
- jLabel.setText("Packages:");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJScrollPanePackage(), null);
- jContentPane.add(getJScrollPanePlatform(), null);
- jContentPane.add(getJButtonPrevious(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepOne.setVisible(true);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
- if (jComboBoxPlatform.getAllCheckedItemsIndex().size() == 0
- && jComboBoxPackage.getAllCheckedItemsIndex().size() == 0) {
- Log.wrn("Create far", "Choose at least one package and/or platform.");
- return;
- }
-
- //
- // If some packages a Repackage=false, give a warning message
- //
- List<PackageIdentification> selectedPackages = getSelectedPackages();
- WorkspaceTools wt = new WorkspaceTools();
- List<PackageIdentification> allRepackablePackages = wt.getAllRepackagablePackages();
-
- List<PackageIdentification> unRepackablePackages = new Vector<PackageIdentification>();
- String msg = "Following selected packages: \n";
- Iterator<PackageIdentification> iter = selectedPackages.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (!allRepackablePackages.contains(item)) {
- unRepackablePackages.add(item);
- msg += item.getName() + "\n";
- }
- }
- msg += "is un-Repackagable. Do you want to continue? ";
-
- if (unRepackablePackages.size() > 0) {
- if(JOptionPane.showConfirmDialog(this, msg, "Warning", JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {
- return ;
- }
- }
-
- if (stepThree == null) {
- stepThree = new CreateStepThree(this, true, this);
- }
- this.setVisible(false);
- stepThree.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- public List<PackageIdentification> getSelectedPackages() {
- Vector<Integer> v = jComboBoxPackage.getAllCheckedItemsIndex();
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- for (int i = 0; i < v.size(); i++) {
- result.add(packageVector.get(v.get(i).intValue()));
- }
- return result;
- }
-
- public List<PlatformIdentification> getSelectedPlatforms() {
- Vector<Integer> v = jComboBoxPlatform.getAllCheckedItemsIndex();
- List<PlatformIdentification> result = new ArrayList<PlatformIdentification>();
- for (int i = 0; i < v.size(); i++) {
- result.add(platformVector.get(v.get(i).intValue()));
- }
- return result;
- }
-
- public CreateStepOne getPreviousStep() {
- return stepOne;
- }
-}
|