From 2e39c71883a39e34ccbf8f9385c7997af8592fb6 Mon Sep 17 00:00:00 2001 From: wuyizhong Date: Mon, 11 Sep 2006 09:12:17 +0000 Subject: [PATCH] Fix EDKT263. Change save dialog to open dialog. Update all Frame's titles. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1510 6f19259b-4bc3-4df7-8a09-765794883524 --- .../far/FarStringDefinition.java | 36 +++++++++++++++++++ .../far/createui/CreateStepFour.java | 5 +-- .../far/createui/CreateStepOne.java | 5 +-- .../far/createui/CreateStepThree.java | 7 ++-- .../far/createui/CreateStepTwo.java | 6 ++-- .../far/deleteui/DeleteStepOne.java | 3 +- .../far/deleteui/DeleteStepTwo.java | 3 +- .../far/installui/InstallStepOne.java | 5 +-- .../far/installui/InstallStepTwo.java | 3 +- .../far/updateui/UpdateStepOne.java | 5 +-- .../far/updateui/UpdateStepTwo.java | 3 +- 11 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java new file mode 100644 index 0000000000..71adab4d82 --- /dev/null +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java @@ -0,0 +1,36 @@ +package org.tianocore.frameworkwizard.far; + +public class FarStringDefinition { + + /// + /// Definition for all step's title string + /// + public static final String CREATE_STEP_ONE_TITLE = + "Create Framework Archive(FAR) - Step 1: Set FAR's basic information"; + public static final String CREATE_STEP_TWO_TITLE = + "Create Framework Archive(FAR) - Step 2: Choose Packages and Platforms"; + public static final String CREATE_STEP_THREE_TITLE = + "Create Framework Archive(FAR) - Step 3: Set file filter"; + public static final String CREATE_STEP_FOUR_TITLE = + "Create Framework Archive(FAR) - Step 4: Choose target file and finish"; + + public static final String DELETE_STEP_ONE_TITLE = + "Delete Framework Archive(FAR) - Step 1: Choose FAR from framework database"; + public static final String DELETE_STEP_TWO_TITLE = + "Delete Framework Archive(FAR) - Step 2: Choose delete mode and finish"; + + public static final String UPDATE_STEP_ONE_TITLE = + "Update Framework Archive(FAR) - Step 1: Browse FAR file"; + public static final String UPDATE_STEP_TWO_TITLE = + "Update Framework Archive(FAR) - Step 2: Summary"; + + public static final String INSTALL_STEP_ONE_TITLE = + "Install Framework Archive(FAR) - Step 1: Browse FAR file"; + public static final String INSTALL_STEP_TWO_TITLE = + "Install Framework Archive(FAR) - Step 2: Set path for packages or/and platforms"; + + /// + /// + /// + +} diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java index 314d0d0b1e..2422724280 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java @@ -35,6 +35,7 @@ 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; @@ -194,7 +195,7 @@ public class CreateStepFour extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Create Framework Archive(FAR) - Step 4: Finish"); + this.setTitle(FarStringDefinition.CREATE_STEP_FOUR_TITLE); this.centerWindow(); } @@ -207,7 +208,7 @@ public class CreateStepFour extends IDialog implements MouseListener { if (jContentPane == null) { jLabel2 = new JLabel(); jLabel2.setBounds(new java.awt.Rectangle(30,70,111,18)); - jLabel2.setText("Select File to Save: "); + 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 following packages: "); diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java index 7439c82c0e..32d2da4278 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java @@ -30,6 +30,7 @@ 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 { @@ -397,7 +398,7 @@ public class CreateStepOne extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 425); this.setContentPane(getJScrollPane()); - this.setTitle("Create Framework Archive(FAR) - Step 1: Set FAR's baseic information"); + this.setTitle(FarStringDefinition.CREATE_STEP_ONE_TITLE); this.centerWindow(); } @@ -600,7 +601,7 @@ public class CreateStepOne extends IDialog implements MouseListener { // Add some logic process here // if (!valid()) { - return; + return ; } if (stepTwo == null) { stepTwo = new CreateStepTwo(this, true, this); diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java index 53a6f6f519..380081066b 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java @@ -26,6 +26,8 @@ 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; @@ -76,8 +78,7 @@ public class CreateStepThree extends IDialog implements MouseListener { if (jTextArea == null) { jTextArea = new JTextArea(); jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50)); - jTextArea.setText("Step 2: Set File Filter\n"); - jTextArea.append("Add more file filter regular expressions in text field separated with space. \n"); + jTextArea.setText("Add more file filter regular expressions in text field separated with space. \n"); jTextArea.append("Note that regular expressions please reference PERL language. "); jTextArea.setEditable(false); } @@ -195,7 +196,7 @@ public class CreateStepThree extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Create Framework Archive(FAR) - Step 3: Set File Filter"); + this.setTitle(FarStringDefinition.CREATE_STEP_THREE_TITLE); this.centerWindow(); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java index 75c4bc83c0..240ebef2a7 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java @@ -29,6 +29,7 @@ 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; @@ -84,8 +85,7 @@ public class CreateStepTwo extends IDialog implements MouseListener { if (jTextArea == null) { jTextArea = new JTextArea(); jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50)); - jTextArea.setText("Step 1: Choose Packages and Platforms\n"); - jTextArea.append("Choose at least one package or platform. "); + jTextArea.setText("Choose at least one package or platform. "); jTextArea.setEditable(false); } return jTextArea; @@ -209,7 +209,7 @@ public class CreateStepTwo extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Create Framework Archive(FAR) - Step 2: Choose Packages and Platform"); + this.setTitle(FarStringDefinition.CREATE_STEP_TWO_TITLE); this.centerWindow(); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java index f861eeed06..c22097c7c7 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java @@ -35,6 +35,7 @@ import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.far.AggregationOperation; import org.tianocore.frameworkwizard.far.FarIdentification; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.far.PackageQuery; import org.tianocore.frameworkwizard.far.PackageQueryInterface; import org.tianocore.frameworkwizard.packaging.PackageIdentification; @@ -253,7 +254,7 @@ public class DeleteStepOne extends IDialog implements ListSelectionListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Delete Framework Archive(FAR) - Step 1: Choose FAR from framework database"); + this.setTitle(FarStringDefinition.DELETE_STEP_ONE_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java index 012d23bb6c..718fe18b18 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java @@ -33,6 +33,7 @@ import javax.swing.JRadioButton; import org.tianocore.frameworkwizard.common.DataType; import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.far.FarIdentification; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.platform.PlatformIdentification; import org.tianocore.frameworkwizard.workspace.WorkspaceTools; @@ -174,7 +175,7 @@ public class DeleteStepTwo extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Delete Framework Archive(FAR) - Step 2: Choose Delete Mode"); + this.setTitle(FarStringDefinition.DELETE_STEP_TWO_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java index fabee7a8cd..bfc84486a7 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java @@ -38,6 +38,7 @@ import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.far.DistributeRule; import org.tianocore.frameworkwizard.far.Far; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.workspace.Workspace; @@ -220,7 +221,7 @@ public class InstallStepOne extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Install Framework Archive(FAR) - Step 1: Choose FAR file"); + this.setTitle(FarStringDefinition.INSTALL_STEP_ONE_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); } @@ -309,7 +310,7 @@ public class InstallStepOne extends IDialog implements MouseListener { fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT)); fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace())); - int result = fc.showSaveDialog(new JPanel()); + int result = fc.showOpenDialog(new JPanel()); if (result == JFileChooser.APPROVE_OPTION) { jLabelWarning.setVisible(false); jTable.setVisible(false); diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java index 35793436a1..7087634b52 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java @@ -41,6 +41,7 @@ import org.tianocore.frameworkwizard.common.Log; import org.tianocore.frameworkwizard.common.Tools; import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.far.Far; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.platform.PlatformIdentification; import org.tianocore.frameworkwizard.workspace.Workspace; @@ -287,7 +288,7 @@ public class InstallStepTwo extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Install Framework Archive(FAR) - Step 2: Set Path for Packages and Platforms"); + this.setTitle(FarStringDefinition.INSTALL_STEP_TWO_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); } diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java index 47d3db52e4..bea6f7c7a0 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java @@ -36,6 +36,7 @@ import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.common.ui.IFrame; import org.tianocore.frameworkwizard.far.Far; import org.tianocore.frameworkwizard.far.FarIdentification; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.workspace.Workspace; import org.tianocore.frameworkwizard.workspace.WorkspaceTools; @@ -200,7 +201,7 @@ public class UpdateStepOne extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Update Framework Archive(FAR) - Step 1: Choose FAR File"); + this.setTitle(FarStringDefinition.UPDATE_STEP_ONE_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); } @@ -276,7 +277,7 @@ public class UpdateStepOne extends IDialog implements MouseListener { fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT)); fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace())); - int result = fc.showSaveDialog(new JPanel()); + int result = fc.showOpenDialog(new JPanel()); if (result == JFileChooser.APPROVE_OPTION) { this.jTextFieldFarFile.setText(Tools.addPathExt(fc.getSelectedFile().getPath(), DataType.RETURN_TYPE_FAR_SURFACE_AREA)); diff --git a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java index 45e6e97991..0ead2cf6dc 100644 --- a/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java +++ b/Tools/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java @@ -41,6 +41,7 @@ import org.tianocore.frameworkwizard.common.ui.IDialog; import org.tianocore.frameworkwizard.far.AggregationOperation; import org.tianocore.frameworkwizard.far.DistributeRule; import org.tianocore.frameworkwizard.far.Far; +import org.tianocore.frameworkwizard.far.FarStringDefinition; import org.tianocore.frameworkwizard.packaging.PackageIdentification; import org.tianocore.frameworkwizard.platform.PlatformIdentification; import org.tianocore.frameworkwizard.workspace.Workspace; @@ -220,7 +221,7 @@ public class UpdateStepTwo extends IDialog implements MouseListener { private void initialize() { this.setSize(700, 400); this.setContentPane(getJContentPane()); - this.setTitle("Update Framework Archive(FAR) - Step 2: Summary"); + this.setTitle(FarStringDefinition.UPDATE_STEP_TWO_TITLE); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2); }