1. Fix bug for wrong Variable name in msa file

2. Release cursor after saving files.
3. Adjust some file's coding style.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1183 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
hche10x 2006-08-03 08:07:13 +00:00
parent f28c083051
commit 43dc3851cf
9 changed files with 543 additions and 374 deletions

View File

@ -35,13 +35,13 @@ import javax.swing.ImageIcon;
public class About extends IDialog { public class About extends IDialog {
/// ///
/// Define class Serial Version UID /// Define Class Serial Version UID
/// ///
private static final long serialVersionUID = 2958136136667310962L; private static final long serialVersionUID = 2958136136667310962L;
// ///
//Define class members /// Define Class Members
// ///
private JPanel jContentPane = null; private JPanel jContentPane = null;
private JLabel jLabel = null; private JLabel jLabel = null;
@ -70,11 +70,6 @@ public class About extends IDialog {
return jButtonOK; return jButtonOK;
} }
public static void main(String[] args) {
About a = new About();
a.setVisible(true);
}
/** /**
This is the default constructor This is the default constructor

View File

@ -51,14 +51,21 @@ import org.tianocore.frameworkwizard.workspace.Workspace;
import org.tianocore.frameworkwizard.workspace.WorkspaceTools; import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
import javax.swing.JComboBox; import javax.swing.JComboBox;
public class Clone extends IDialog { /**
The class is used to provide functions to clone workspace, module, package and platform
/** It extends IDialog
Define class members
**/ **/
public class Clone extends IDialog {
///
/// Define Class Serial Version UID
///
private static final long serialVersionUID = -5469299324965727137L; private static final long serialVersionUID = -5469299324965727137L;
///
/// Define Class Members
///
private JPanel jContentPane = null; private JPanel jContentPane = null;
private JLabel jLabelType = null; private JLabel jLabelType = null;
@ -93,16 +100,20 @@ public class Clone extends IDialog {
private JButton jButtonGenerateGuid = null; private JButton jButtonGenerateGuid = null;
private JLabel jLabelBelong = null;
private JComboBox jComboBoxExistingPackage = null;
///
/// Define members not for UI
///
private int mode = -1; private int mode = -1;
private Vector<PackageIdentification> packages = null; private Vector<PackageIdentification> packages = null;
private WorkspaceTools wt = new WorkspaceTools(); private WorkspaceTools wt = new WorkspaceTools();
private JLabel jLabelBelong = null;
private JComboBox jComboBoxExistingPackage = null;
private Identification oldId = null; private Identification oldId = null;
private Identification newId = null; private Identification newId = null;
@ -114,10 +125,11 @@ public class Clone extends IDialog {
private PlatformIdentification fid = null; private PlatformIdentification fid = null;
/** /**
* This method initializes jTextFieldType This method initializes jTextFieldType
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldType() { private JTextField getJTextFieldType() {
if (jTextFieldType == null) { if (jTextFieldType == null) {
jTextFieldType = new JTextField(); jTextFieldType = new JTextField();
@ -128,10 +140,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jTextFieldSource This method initializes jTextFieldSource
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldSource() { private JTextField getJTextFieldSource() {
if (jTextFieldSource == null) { if (jTextFieldSource == null) {
jTextFieldSource = new JTextField(); jTextFieldSource = new JTextField();
@ -142,10 +155,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jButtonBrowse This method initializes jButtonBrowse
*
* @return javax.swing.JButton @return javax.swing.JButton
*/
**/
private JButton getJButtonBrowse() { private JButton getJButtonBrowse() {
if (jButtonBrowse == null) { if (jButtonBrowse == null) {
jButtonBrowse = new JButton(); jButtonBrowse = new JButton();
@ -157,10 +171,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jTextFieldDestinationFile This method initializes jTextFieldDestinationFile
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldFilePath() { private JTextField getJTextFieldFilePath() {
if (jTextFieldFilePath == null) { if (jTextFieldFilePath == null) {
jTextFieldFilePath = new JTextField(); jTextFieldFilePath = new JTextField();
@ -170,10 +185,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jTextFieldBaseName This method initializes jTextFieldBaseName
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldBaseName() { private JTextField getJTextFieldBaseName() {
if (jTextFieldBaseName == null) { if (jTextFieldBaseName == null) {
jTextFieldBaseName = new JTextField(); jTextFieldBaseName = new JTextField();
@ -183,10 +199,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jTextFieldGuid This method initializes jTextFieldGuid
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldGuid() { private JTextField getJTextFieldGuid() {
if (jTextFieldGuid == null) { if (jTextFieldGuid == null) {
jTextFieldGuid = new JTextField(); jTextFieldGuid = new JTextField();
@ -196,10 +213,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jTextFieldVersion This method initializes jTextFieldVersion
*
* @return javax.swing.JTextField @return javax.swing.JTextField
*/
**/
private JTextField getJTextFieldVersion() { private JTextField getJTextFieldVersion() {
if (jTextFieldVersion == null) { if (jTextFieldVersion == null) {
jTextFieldVersion = new JTextField(); jTextFieldVersion = new JTextField();
@ -209,10 +227,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jButtonOk This method initializes jButtonOk
*
* @return javax.swing.JButton @return javax.swing.JButton
*/
**/
private JButton getJButtonOk() { private JButton getJButtonOk() {
if (jButtonOk == null) { if (jButtonOk == null) {
jButtonOk = new JButton(); jButtonOk = new JButton();
@ -224,10 +243,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jButtonCancel This method initializes jButtonCancel
*
* @return javax.swing.JButton @return javax.swing.JButton
*/
**/
private JButton getJButtonCancel() { private JButton getJButtonCancel() {
if (jButtonCancel == null) { if (jButtonCancel == null) {
jButtonCancel = new JButton(); jButtonCancel = new JButton();
@ -239,10 +259,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jButtonGenerateGuid This method initializes jButtonGenerateGuid
*
* @return javax.swing.JButton @return javax.swing.JButton
*/
**/
private JButton getJButtonGenerateGuid() { private JButton getJButtonGenerateGuid() {
if (jButtonGenerateGuid == null) { if (jButtonGenerateGuid == null) {
jButtonGenerateGuid = new JButton(); jButtonGenerateGuid = new JButton();
@ -254,10 +275,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jComboBoxExistingPackage This method initializes jComboBoxExistingPackage
*
* @return javax.swing.JComboBox @return javax.swing.JComboBox
*/
**/
private JComboBox getJComboBoxExistingPackage() { private JComboBox getJComboBoxExistingPackage() {
if (jComboBoxExistingPackage == null) { if (jComboBoxExistingPackage == null) {
jComboBoxExistingPackage = new JComboBox(); jComboBoxExistingPackage = new JComboBox();
@ -267,24 +289,21 @@ public class Clone extends IDialog {
} }
/** /**
This is the default constructor
@param args
**/ **/
public static void main(String[] args) {
}
/**
* This is the default constructor
*/
public Clone() { public Clone() {
super(); super();
init(); init();
} }
/** /**
This is the default constructor This is the override constructor
@param parentFrame The parent frame which starts this frame
@param modal To identify the frame's modal
@param fileType To identify the clone target type
@param identification The clone target's identification
**/ **/
public Clone(IFrame parentFrame, boolean modal, int fileType, Identification identification) { public Clone(IFrame parentFrame, boolean modal, int fileType, Identification identification) {
@ -311,10 +330,9 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes this This method initializes this
*
* @return void **/
*/
private void init() { private void init() {
this.setSize(550, 260); this.setSize(550, 260);
this.setContentPane(getJContentPane()); this.setContentPane(getJContentPane());
@ -323,12 +341,17 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes this This method initializes this with given clone target type.
* Customize the frame interface via different clone target type.
* @return void
*/ @param mode To identify the clone target type
**/
private void init(int mode) { private void init(int mode) {
init(); init();
//
// For MODULE_SURFACE_AREA
//
if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.MODULE_SURFACE_AREA); this.jTextFieldType.setText(DataType.MODULE_SURFACE_AREA);
String s = oldId.getPath(); String s = oldId.getPath();
@ -341,6 +364,9 @@ public class Clone extends IDialog {
this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height); this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
this.jLabelDestinationFile.setText("New Module Path and Filename"); this.jLabelDestinationFile.setText("New Module Path and Filename");
} }
//
// For PACKAGE_SURFACE_AREA
//
if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) { if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.PACKAGE_SURFACE_AREA); this.jTextFieldType.setText(DataType.PACKAGE_SURFACE_AREA);
String s = oldId.getPath(); String s = oldId.getPath();
@ -353,6 +379,9 @@ public class Clone extends IDialog {
this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height); this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
this.jLabelDestinationFile.setText("New Package Path and Filename"); this.jLabelDestinationFile.setText("New Package Path and Filename");
} }
//
// For PLATFORM_SURFACE_AREA
//
if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) { if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA); this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA);
this.jTextFieldSource.setText(oldId.getPath()); this.jTextFieldSource.setText(oldId.getPath());
@ -362,6 +391,9 @@ public class Clone extends IDialog {
.setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd"); .setToolTipText("Select platform path here. For example, C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd");
this.jLabelDestinationFile.setText("New Platform Path and Filename"); this.jLabelDestinationFile.setText("New Platform Path and Filename");
} }
//
// For WORKSPACE
//
if (mode == DataType.RETURN_TYPE_WORKSPACE) { if (mode == DataType.RETURN_TYPE_WORKSPACE) {
this.jTextFieldType.setText(DataType.WORKSPACE); this.jTextFieldType.setText(DataType.WORKSPACE);
this.jTextFieldSource.setText(Workspace.getCurrentWorkspace()); this.jTextFieldSource.setText(Workspace.getCurrentWorkspace());
@ -380,10 +412,11 @@ public class Clone extends IDialog {
} }
/** /**
* This method initializes jContentPane This method initializes jContentPane
*
* @return javax.swing.JPanel @return javax.swing.JPanel
*/
**/
private JPanel getJContentPane() { private JPanel getJContentPane() {
if (jContentPane == null) { if (jContentPane == null) {
jLabelBelong = new JLabel(); jLabelBelong = new JLabel();
@ -446,6 +479,9 @@ public class Clone extends IDialog {
if (arg0.getSource() == jButtonOk) { if (arg0.getSource() == jButtonOk) {
if (this.check()) { if (this.check()) {
try { try {
//
// Save to file
//
this.save(); this.save();
} catch (IOException e) { } catch (IOException e) {
Log.wrn("Clone", e.getMessage()); Log.wrn("Clone", e.getMessage());
@ -471,7 +507,7 @@ public class Clone extends IDialog {
} }
// //
// Use different file ext // Use different file ext for different clone target type
// //
if (arg0.getSource() == this.jButtonBrowse) { if (arg0.getSource() == this.jButtonBrowse) {
JFileChooser fc = new JFileChooser(); JFileChooser fc = new JFileChooser();
@ -501,9 +537,14 @@ public class Clone extends IDialog {
} }
} }
// /**
// Check name, guid and version Check name, guid and version.
// If all of them are valid, save information to new id
@retval true All name, guid and version are valid
@retval false Any one of name, guid and version is invalid
**/
private boolean checkId() { private boolean checkId() {
// //
// Check Basename // Check Basename
@ -555,7 +596,8 @@ public class Clone extends IDialog {
/** /**
Check before save Check before save
@return @retval true All check points are passed
@retval false Any one of check points is failed
**/ **/
private boolean check() { private boolean check() {
@ -598,10 +640,6 @@ public class Clone extends IDialog {
// Check for Module // Check for Module
// //
if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) { if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
// if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {
// Log.err("The module name must include a path");
// return false;
// }
trg = this.getModulePath(); trg = this.getModulePath();
if (src.equals(trg)) { if (src.equals(trg)) {
Log.wrn("Clone", "The source and destination couldn't be same"); Log.wrn("Clone", "The source and destination couldn't be same");
@ -655,6 +693,14 @@ public class Clone extends IDialog {
return true; return true;
} }
/**
Save clone target to new location
@throws IOException
@throws XmlException
@throws Exception
**/
private void save() throws IOException, XmlException, Exception { private void save() throws IOException, XmlException, Exception {
String src = this.oldId.getPath(); String src = this.oldId.getPath();
String trg = this.jTextFieldFilePath.getText(); String trg = this.jTextFieldFilePath.getText();
@ -703,7 +749,7 @@ public class Clone extends IDialog {
msa.getMsaHeader().setVersion(newId.getVersion()); msa.getMsaHeader().setVersion(newId.getVersion());
// //
// Update Cloned From element // Update <Cloned> Section
// //
updateModuleClonedId(msa, oldId); updateModuleClonedId(msa, oldId);
@ -743,6 +789,9 @@ public class Clone extends IDialog {
newId.setPath(trg); newId.setPath(trg);
vFiles = wt.getAllPakcageFilesPath(src); vFiles = wt.getAllPakcageFilesPath(src);
//
// First copy all files to new directory
//
FileOperation.copyFile(src, trg); FileOperation.copyFile(src, trg);
for (int index = 1; index < vFiles.size(); index++) { for (int index = 1; index < vFiles.size(); index++) {
String oldFile = vFiles.get(index); String oldFile = vFiles.get(index);
@ -750,16 +799,6 @@ public class Clone extends IDialog {
FileOperation.copyFile(oldFile, newFile); FileOperation.copyFile(oldFile, newFile);
} }
//
// First copy all files to new directory
//
//FileOperation.copyFolder(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));
//
// Delete old spd file
//
//FileOperation.delFile(Tools.getFilePathOnly(trg) + DataType.FILE_SEPARATOR + Tools.getFileNameOnly(src));
// //
// Create new spd file // Create new spd file
// //
@ -774,7 +813,7 @@ public class Clone extends IDialog {
spd.getSpdHeader().setVersion(newId.getVersion()); spd.getSpdHeader().setVersion(newId.getVersion());
// //
// Update Cloned From element // Update <Cloned> Section
// //
updatePackageClonedId(spd, oldId); updatePackageClonedId(spd, oldId);
@ -835,10 +874,23 @@ public class Clone extends IDialog {
vFiles = null; vFiles = null;
} }
/**
Get the path of selected package
@return String The path of selected package
**/
private String getSelectPackagePath() { private String getSelectPackagePath() {
return Tools.getFilePathOnly(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath()); return Tools.getFilePathOnly(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath());
} }
/**
Get the path of source module
Since the path of source module is relative, make it up to full path.
@return String The full path of source module
**/
private String getModulePath() { private String getModulePath() {
String trg = this.jTextFieldFilePath.getText(); String trg = this.jTextFieldFilePath.getText();
trg = Tools.addPathExt(trg, mode); trg = Tools.addPathExt(trg, mode);
@ -847,6 +899,13 @@ public class Clone extends IDialog {
return trg; return trg;
} }
/**
Get the path of source package
Since the path of source package is relative, make it up to full path.
@return String The full path of source package
**/
private String getPackagePath() { private String getPackagePath() {
String trg = this.jTextFieldFilePath.getText(); String trg = this.jTextFieldFilePath.getText();
trg = Tools.addPathExt(trg, mode); trg = Tools.addPathExt(trg, mode);
@ -856,10 +915,10 @@ public class Clone extends IDialog {
} }
/** /**
Set target item's Cloned From element Set msa file's <Cloned> section via given identification
@param id @param msa ModuleSurfaceArea for clone target
@return @param id Identification of clone source
**/ **/
private void updateModuleClonedId(ModuleSurfaceArea msa, Identification id) { private void updateModuleClonedId(ModuleSurfaceArea msa, Identification id) {
@ -914,10 +973,10 @@ public class Clone extends IDialog {
} }
/** /**
Set target item's Cloned From element Set spd file's <Cloned> section via given identification
@param id @param spd PackageSurfaceArea for clone target
@return @param id Identification of clone source
**/ **/
private void updatePackageClonedId(PackageSurfaceArea spd, Identification id) { private void updatePackageClonedId(PackageSurfaceArea spd, Identification id) {
@ -970,10 +1029,10 @@ public class Clone extends IDialog {
} }
/** /**
Set target item's Cloned From element Set fpd file's <Cloned> section via given identification
@param id @param fpd PlatformSurfaceArea for clone target
@return @param id Identification of clone source
**/ **/
private void updatePlatformClonedId(PlatformSurfaceArea fpd, Identification id) { private void updatePlatformClonedId(PlatformSurfaceArea fpd, Identification id) {
@ -1025,26 +1084,62 @@ public class Clone extends IDialog {
fpd.setPlatformDefinitions(pd); fpd.setPlatformDefinitions(pd);
} }
/**
Get PlatformIdentification
@return PlatformIdentification
**/
public PlatformIdentification getFid() { public PlatformIdentification getFid() {
return fid; return fid;
} }
/**
Set PlatformIdentification
@param fid PlatformIdentification
**/
public void setFid(PlatformIdentification fid) { public void setFid(PlatformIdentification fid) {
this.fid = fid; this.fid = fid;
} }
/**
Get ModuleIdentification
@return ModuleIdentification
**/
public ModuleIdentification getMid() { public ModuleIdentification getMid() {
return mid; return mid;
} }
/**
Set ModuleIdentification
@param mid ModuleIdentification
**/
public void setMid(ModuleIdentification mid) { public void setMid(ModuleIdentification mid) {
this.mid = mid; this.mid = mid;
} }
/**
Get PackageIdentification
@return PackageIdentification
**/
public PackageIdentification getPid() { public PackageIdentification getPid() {
return pid; return pid;
} }
/**
Set PackageIdentification
@param pid PackageIdentification
**/
public void setPid(PackageIdentification pid) { public void setPid(PackageIdentification pid) {
this.pid = pid; this.pid = pid;
} }

View File

@ -108,8 +108,8 @@ import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace; import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace;
/** /**
The class is used to show main GUI of ModuleEditor The class is used to show main GUI of FrameworkWizard
It extends IFrame implements MouseListener, TreeSelectionListener It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener
**/ **/
public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener, public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener,
@ -119,9 +119,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
/// ///
private static final long serialVersionUID = -7103240960573031772L; private static final long serialVersionUID = -7103240960573031772L;
// ///
// To save information of all files /// Used to save information of all files
// ///
private Vector<ModuleIdentification> vModuleList = new Vector<ModuleIdentification>(); private Vector<ModuleIdentification> vModuleList = new Vector<ModuleIdentification>();
private Vector<PackageIdentification> vPackageList = new Vector<PackageIdentification>(); private Vector<PackageIdentification> vPackageList = new Vector<PackageIdentification>();
@ -140,6 +140,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
private int currentOpeningPlatformIndex = -1; private int currentOpeningPlatformIndex = -1;
///
/// Used to generate tree structure
///
private IDefaultMutableTreeNode dmtnRoot = null; private IDefaultMutableTreeNode dmtnRoot = null;
private IDefaultMutableTreeNode dmtnModuleDescription = null; private IDefaultMutableTreeNode dmtnModuleDescription = null;
@ -148,6 +151,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
private IDefaultMutableTreeNode dmtnPlatformDescription = null; private IDefaultMutableTreeNode dmtnPlatformDescription = null;
///
/// Used for UI
///
private JPanel jContentPane = null; private JPanel jContentPane = null;
private JMenuBar jMenuBar = null; private JMenuBar jMenuBar = null;
@ -292,16 +298,19 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
private JMenuItem jMenuItemProjectRemoveFar = null; private JMenuItem jMenuItemProjectRemoveFar = null;
//private JToolBar jToolBarFile = null;
//private JToolBar jToolBarEdit = null;
//private JToolBar jToolBarWindow = null;
private static FrameworkWizardUI fwui = null;
private JMenuItem jMenuItemProjectCreateFar = null; private JMenuItem jMenuItemProjectCreateFar = null;
///
/// A static definition for this class itself
///
private static FrameworkWizardUI fwui = null;
/**
If the class hasn't an instnace, new one.
@return FrameworkWizardUI The instance of this class
**/
public static FrameworkWizardUI getInstance() { public static FrameworkWizardUI getInstance() {
if (fwui == null) { if (fwui == null) {
fwui = new FrameworkWizardUI(); fwui = new FrameworkWizardUI();
@ -351,7 +360,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JTabbedPane @return javax.swing.JTabbedPane
*/ **/
private JTabbedPane getJTabbedPaneEditor() { private JTabbedPane getJTabbedPaneEditor() {
if (jTabbedPaneEditor == null) { if (jTabbedPaneEditor == null) {
jTabbedPaneEditor = new JTabbedPane(); jTabbedPaneEditor = new JTabbedPane();
@ -363,7 +372,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
.setMinimumSize(new java.awt.Dimension( .setMinimumSize(new java.awt.Dimension(
DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT)); DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
//jTabbedPaneEditor.addChangeListener(this);
jTabbedPaneEditor.addTab("Module", null, getJDesktopPaneModule(), null); jTabbedPaneEditor.addTab("Module", null, getJDesktopPaneModule(), null);
jTabbedPaneEditor.addTab("Package", null, getJDesktopPanePackage(), null); jTabbedPaneEditor.addTab("Package", null, getJDesktopPanePackage(), null);
jTabbedPaneEditor.addTab("Platform", null, getJDesktopPanePlatform(), null); jTabbedPaneEditor.addTab("Platform", null, getJDesktopPanePlatform(), null);
@ -376,7 +384,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JTabbedPane @return javax.swing.JTabbedPane
*/ **/
private JTabbedPane getJTabbedPaneTree() { private JTabbedPane getJTabbedPaneTree() {
if (jTabbedPaneTree == null) { if (jTabbedPaneTree == null) {
jTabbedPaneTree = new JTabbedPane(); jTabbedPaneTree = new JTabbedPane();
@ -400,29 +408,35 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private JMenu getJMenuFile() { private JMenu getJMenuFile() {
if (jMenuFile == null) { if (jMenuFile == null) {
//
// Set jMenuFile's attributes
//
jMenuFile = new JMenu(); jMenuFile = new JMenu();
jMenuFile.setText("File"); jMenuFile.setText("File");
jMenuFile.setMnemonic('F'); jMenuFile.setMnemonic('F');
jMenuFile.addMenuListener(this);
//
// Add sub menu items
//
jMenuFile.add(getJMenuItemFileNew()); jMenuFile.add(getJMenuItemFileNew());
jMenuFile.add(getJMenuItemFileOpen()); jMenuFile.add(getJMenuItemFileOpen());
jMenuFile.add(getJMenuItemFileClose()); jMenuFile.add(getJMenuItemFileClose());
jMenuFile.add(getJMenuItemFileCloseAll()); jMenuFile.add(getJMenuItemFileCloseAll());
jMenuFile.addSeparator(); jMenuFile.addSeparator();
jMenuFile.add(getJMenuFileRecentFiles()); jMenuFile.add(getJMenuFileRecentFiles());
//jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFileSave()); jMenuFile.add(getJMenuItemFileSave());
jMenuFile.add(getJMenuItemFileSaveAs()); jMenuFile.add(getJMenuItemFileSaveAs());
jMenuFile.add(getJMenuItemFileSaveAll()); jMenuFile.add(getJMenuItemFileSaveAll());
jMenuFile.addSeparator(); jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFilePageSetup()); jMenuFile.add(getJMenuItemFilePageSetup());
jMenuFile.add(getJMenuItemFilePrint()); jMenuFile.add(getJMenuItemFilePrint());
//jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFileImport()); jMenuFile.add(getJMenuItemFileImport());
//jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFileProperties()); jMenuFile.add(getJMenuItemFileProperties());
//jMenuFile.addSeparator();
jMenuFile.add(getJMenuItemFileExit()); jMenuFile.add(getJMenuItemFileExit());
jMenuFile.addMenuListener(this);
} }
return jMenuFile; return jMenuFile;
} }
@ -469,22 +483,31 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private JMenu getJMenuEdit() { private JMenu getJMenuEdit() {
if (jMenuEdit == null) { if (jMenuEdit == null) {
//
// Set jMenuEdit's attributes
//
jMenuEdit = new JMenu(); jMenuEdit = new JMenu();
jMenuEdit.setText("Edit"); jMenuEdit.setText("Edit");
jMenuEdit.setMnemonic('E'); jMenuEdit.setMnemonic('E');
jMenuEdit.setVisible(false);
//
// Add sub menu items
//
jMenuEdit.add(getJMenuItemEditUndo()); jMenuEdit.add(getJMenuItemEditUndo());
jMenuEdit.add(getJMenuItemEditRedo()); jMenuEdit.add(getJMenuItemEditRedo());
jMenuEdit.addSeparator(); jMenuEdit.addSeparator();
jMenuEdit.add(getJMenuItemEditCut()); jMenuEdit.add(getJMenuItemEditCut());
jMenuEdit.add(getJMenuItemEditCopy()); jMenuEdit.add(getJMenuItemEditCopy());
jMenuEdit.add(getJMenuItemEditPaste()); jMenuEdit.add(getJMenuItemEditPaste());
jMenuEdit.add(getJMenuItemEditDelete()); jMenuEdit.add(getJMenuItemEditDelete());
jMenuEdit.addSeparator(); jMenuEdit.addSeparator();
jMenuEdit.add(getJMenuItemEditSelectAll()); jMenuEdit.add(getJMenuItemEditSelectAll());
jMenuEdit.add(getJMenuItemEditFind()); jMenuEdit.add(getJMenuItemEditFind());
jMenuEdit.add(getJMenuItemEditFindNext()); jMenuEdit.add(getJMenuItemEditFindNext());
jMenuEdit.addSeparator(); jMenuEdit.addSeparator();
jMenuEdit.setVisible(false);
} }
return jMenuEdit; return jMenuEdit;
} }
@ -571,7 +594,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
private JScrollPane getJScrollPaneTree() { private JScrollPane getJScrollPaneTree() {
if (jScrollPaneTree == null) { if (jScrollPaneTree == null) {
jScrollPaneTree = new JScrollPane(); jScrollPaneTree = new JScrollPane();
//jScrollPaneTree.setBounds(new java.awt.Rectangle(0, 1, 290, 545));
jScrollPaneTree jScrollPaneTree
.setPreferredSize(new java.awt.Dimension( .setPreferredSize(new java.awt.Dimension(
DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,
@ -607,12 +629,19 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private JMenu getJMenuHelp() { private JMenu getJMenuHelp() {
if (jMenuHelp == null) { if (jMenuHelp == null) {
//
// Set jMenuHelp's attributes
//
jMenuHelp = new JMenu(); jMenuHelp = new JMenu();
jMenuHelp.setText("Help"); jMenuHelp.setText("Help");
//
// Add sub menu items
//
jMenuHelp.add(getJMenuItemHelpContents()); jMenuHelp.add(getJMenuItemHelpContents());
jMenuHelp.add(getJMenuItemHelpIndex()); jMenuHelp.add(getJMenuItemHelpIndex());
jMenuHelp.add(getJMenuItemHelpSearch()); jMenuHelp.add(getJMenuItemHelpSearch());
//jMenuHelp.addSeparator();
jMenuHelp.add(getJMenuItemHelpAbout()); jMenuHelp.add(getJMenuItemHelpAbout());
} }
return jMenuHelp; return jMenuHelp;
@ -646,82 +675,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
jMenuItemEditDelete.setMnemonic('D'); jMenuItemEditDelete.setMnemonic('D');
jMenuItemEditDelete.addActionListener(this); jMenuItemEditDelete.addActionListener(this);
// //
//Disabled when no module is open //Disabled first when no module is open
// //
jMenuItemEditDelete.setEnabled(false); jMenuItemEditDelete.setEnabled(false);
} }
return jMenuItemEditDelete; return jMenuItemEditDelete;
} }
// /**
// This method initializes jPopupMenu
//
// @return javax.swing.JPopupMenu jPopupMenu
//
// **/
// private JPopupMenu getJPopupMenu() {
// if (jPopupMenu == null) {
// jPopupMenu = new JPopupMenu();
// //
// //Add menu items of popup menu
// //
// jPopupMenu.add(getJMenuItemPopupAdd());
// jPopupMenu.add(getJMenuItemPopupUpdate());
// jPopupMenu.add(getJMenuItemPopupDelete());
// jPopupMenu.setBorder(new BevelBorder(BevelBorder.RAISED));
// jPopupMenu.addMouseListener(this);
// }
// return jPopupMenu;
// }
//
// /**
// This method initializes jMenuItemPopupAdd
//
// @return javax.swing.JMenuItem jMenuItemPopupAdd
//
// **/
// private JMenuItem getJMenuItemPopupAdd() {
// if (jMenuItemPopupAdd == null) {
// jMenuItemPopupAdd = new JMenuItem();
// jMenuItemPopupAdd.setText("Add");
// jMenuItemPopupAdd.addActionListener(this);
// jMenuItemPopupAdd.setEnabled(false);
// }
// return jMenuItemPopupAdd;
// }
//
// /**
// This method initializes jMenuItemPopupUpdate
//
// @return javax.swing.JMenuItem jMenuItemPopupUpdate
//
// **/
// private JMenuItem getJMenuItemPopupUpdate() {
// if (jMenuItemPopupUpdate == null) {
// jMenuItemPopupUpdate = new JMenuItem();
// jMenuItemPopupUpdate.setText("Update");
// jMenuItemPopupUpdate.addActionListener(this);
// jMenuItemPopupUpdate.setEnabled(false);
// }
// return jMenuItemPopupUpdate;
// }
//
// /**
// This method initializes jMenuItemPopupDelete
//
// @return javax.swing.JMenuItem jMenuItemPopupDelete
//
// **/
// private JMenuItem getJMenuItemPopupDelete() {
// if (jMenuItemPopupDelete == null) {
// jMenuItemPopupDelete = new JMenuItem();
// jMenuItemPopupDelete.setText("Delete");
// jMenuItemPopupDelete.addActionListener(this);
// jMenuItemPopupDelete.setEnabled(false);
// }
// return jMenuItemPopupDelete;
// }
/** /**
This method initializes jMenuFileNew This method initializes jMenuFileNew
@ -781,15 +741,22 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private JMenu getJMenuTools() { private JMenu getJMenuTools() {
if (jMenuTools == null) { if (jMenuTools == null) {
//
// Set jMenuTools's attributes
//
jMenuTools = new JMenu(); jMenuTools = new JMenu();
jMenuTools.setText("Tools"); jMenuTools.setText("Tools");
jMenuTools.setMnemonic('T'); jMenuTools.setMnemonic('T');
jMenuTools.addMenuListener(this);
//
// Add sub menu items
//
jMenuTools.add(getJMenuItemToolsToolChainConfiguration()); jMenuTools.add(getJMenuItemToolsToolChainConfiguration());
jMenuTools.addSeparator(); jMenuTools.addSeparator();
jMenuTools.add(getJMenuItemToolsClone()); jMenuTools.add(getJMenuItemToolsClone());
//jMenuTools.addSeparator();
jMenuTools.add(getJMenuItemToolsCodeScan()); jMenuTools.add(getJMenuItemToolsCodeScan());
jMenuTools.addMenuListener(this);
} }
return jMenuTools; return jMenuTools;
} }
@ -803,25 +770,36 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private JMenu getJMenuWindow() { private JMenu getJMenuWindow() {
if (jMenuWindow == null) { if (jMenuWindow == null) {
//
// Set jMenuWindow's attribute
//
jMenuWindow = new JMenu(); jMenuWindow = new JMenu();
jMenuWindow.setText("Window"); jMenuWindow.setText("Window");
jMenuWindow.setMnemonic('W'); jMenuWindow.setMnemonic('W');
jMenuWindow.setVisible(false);
//
// Add sub menu items
//
jMenuWindow.add(getJMenuItemWindowDisplaySide()); jMenuWindow.add(getJMenuItemWindowDisplaySide());
jMenuWindow.add(getJMenuItemWindowDisplayTopBottom()); jMenuWindow.add(getJMenuItemWindowDisplayTopBottom());
jMenuWindow.addSeparator(); jMenuWindow.addSeparator();
jMenuWindow.add(getJMenuItemWindowTabView()); jMenuWindow.add(getJMenuItemWindowTabView());
jMenuWindow.addSeparator(); jMenuWindow.addSeparator();
jMenuWindow.add(getJMenuItemWindowSource()); jMenuWindow.add(getJMenuItemWindowSource());
jMenuWindow.add(getJMenuItemWindowXML()); jMenuWindow.add(getJMenuItemWindowXML());
jMenuWindow.addSeparator(); jMenuWindow.addSeparator();
jMenuWindow.add(getJMenuItemWindowPreferences()); jMenuWindow.add(getJMenuItemWindowPreferences());
jMenuWindow.setVisible(false);
} }
return jMenuWindow; return jMenuWindow;
} }
/** /**
This method initializes jPanelOperation This method initializes jPanelOperation
Reserved
@return javax.swing.JPanel jPanelOperation @return javax.swing.JPanel jPanelOperation
@ -840,6 +818,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
/** /**
This method initializes jButtonOk This method initializes jButtonOk
Reserved
@return javax.swing.JButton jButtonOk @return javax.swing.JButton jButtonOk
@ -857,6 +836,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
/** /**
This method initializes jButtonCancel This method initializes jButtonCancel
Reserved
@return javax.swing.JButton jButtonCancel @return javax.swing.JButton jButtonCancel
@ -877,7 +857,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFileOpen This method initializes jMenuItemFileOpen
@return javax.swing.JMenuItem jMenuItemFileOpen @return javax.swing.JMenuItem jMenuItemFileOpen
*/
**/
private JMenuItem getJMenuItemFileOpen() { private JMenuItem getJMenuItemFileOpen() {
if (jMenuItemFileOpen == null) { if (jMenuItemFileOpen == null) {
jMenuItemFileOpen = new JMenuItem(); jMenuItemFileOpen = new JMenuItem();
@ -892,7 +873,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFileCloseAll This method initializes jMenuItemFileCloseAll
@return javax.swing.JMenuItem jMenuItemFileOpen @return javax.swing.JMenuItem jMenuItemFileOpen
*/
**/
private JMenuItem getJMenuItemFileCloseAll() { private JMenuItem getJMenuItemFileCloseAll() {
if (jMenuItemFileCloseAll == null) { if (jMenuItemFileCloseAll == null) {
jMenuItemFileCloseAll = new JMenuItem(); jMenuItemFileCloseAll = new JMenuItem();
@ -907,7 +889,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFileSaveAll This method initializes jMenuItemFileSaveAll
@return javax.swing.JMenuItem jMenuItemFileSaveAll @return javax.swing.JMenuItem jMenuItemFileSaveAll
*/
**/
private JMenuItem getJMenuItemFileSaveAll() { private JMenuItem getJMenuItemFileSaveAll() {
if (jMenuItemFileSaveAll == null) { if (jMenuItemFileSaveAll == null) {
jMenuItemFileSaveAll = new JMenuItem(); jMenuItemFileSaveAll = new JMenuItem();
@ -923,7 +906,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFilePageSetup This method initializes jMenuItemFilePageSetup
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemFilePageSetup() { private JMenuItem getJMenuItemFilePageSetup() {
if (jMenuItemFilePageSetup == null) { if (jMenuItemFilePageSetup == null) {
jMenuItemFilePageSetup = new JMenuItem(); jMenuItemFilePageSetup = new JMenuItem();
@ -940,7 +924,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFilePrint This method initializes jMenuItemFilePrint
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemFilePrint() { private JMenuItem getJMenuItemFilePrint() {
if (jMenuItemFilePrint == null) { if (jMenuItemFilePrint == null) {
jMenuItemFilePrint = new JMenuItem(); jMenuItemFilePrint = new JMenuItem();
@ -957,7 +942,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemFileImport This method initializes jMenuItemFileImport
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemFileImport() { private JMenuItem getJMenuItemFileImport() {
if (jMenuItemFileImport == null) { if (jMenuItemFileImport == null) {
jMenuItemFileImport = new JMenuItem(); jMenuItemFileImport = new JMenuItem();
@ -971,10 +957,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
/** /**
* This method initializes jMenuItemFileProperties This method initializes jMenuItemFileProperties
*
* @return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemFileProperties() { private JMenuItem getJMenuItemFileProperties() {
if (jMenuItemFileProperties == null) { if (jMenuItemFileProperties == null) {
jMenuItemFileProperties = new JMenuItem(); jMenuItemFileProperties = new JMenuItem();
@ -988,10 +975,11 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
/** /**
* This method initializes jMenuFileRecentFiles This method initializes jMenuFileRecentFiles
*
* @return javax.swing.JMenu @return javax.swing.JMenu
*/
**/
private JMenu getJMenuFileRecentFiles() { private JMenu getJMenuFileRecentFiles() {
if (jMenuFileRecentFiles == null) { if (jMenuFileRecentFiles == null) {
jMenuFileRecentFiles = new JMenu(); jMenuFileRecentFiles = new JMenu();
@ -1008,7 +996,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditUndo This method initializes jMenuItemEditUndo
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditUndo() { private JMenuItem getJMenuItemEditUndo() {
if (jMenuItemEditUndo == null) { if (jMenuItemEditUndo == null) {
jMenuItemEditUndo = new JMenuItem(); jMenuItemEditUndo = new JMenuItem();
@ -1024,7 +1013,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditRedo This method initializes jMenuItemEditRedo
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditRedo() { private JMenuItem getJMenuItemEditRedo() {
if (jMenuItemEditRedo == null) { if (jMenuItemEditRedo == null) {
jMenuItemEditRedo = new JMenuItem(); jMenuItemEditRedo = new JMenuItem();
@ -1040,7 +1030,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditCut This method initializes jMenuItemEditCut
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditCut() { private JMenuItem getJMenuItemEditCut() {
if (jMenuItemEditCut == null) { if (jMenuItemEditCut == null) {
jMenuItemEditCut = new JMenuItem(); jMenuItemEditCut = new JMenuItem();
@ -1056,7 +1047,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditCopy This method initializes jMenuItemEditCopy
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditCopy() { private JMenuItem getJMenuItemEditCopy() {
if (jMenuItemEditCopy == null) { if (jMenuItemEditCopy == null) {
jMenuItemEditCopy = new JMenuItem(); jMenuItemEditCopy = new JMenuItem();
@ -1072,7 +1064,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditPaste This method initializes jMenuItemEditPaste
return javax.swing.JMenuItem return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditPaste() { private JMenuItem getJMenuItemEditPaste() {
if (jMenuItemEditPaste == null) { if (jMenuItemEditPaste == null) {
jMenuItemEditPaste = new JMenuItem(); jMenuItemEditPaste = new JMenuItem();
@ -1088,7 +1081,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItem This method initializes jMenuItem
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditSelectAll() { private JMenuItem getJMenuItemEditSelectAll() {
if (jMenuItemEditSelectAll == null) { if (jMenuItemEditSelectAll == null) {
jMenuItemEditSelectAll = new JMenuItem(); jMenuItemEditSelectAll = new JMenuItem();
@ -1104,7 +1098,8 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
This method initializes jMenuItemEditFind This method initializes jMenuItemEditFind
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/
**/
private JMenuItem getJMenuItemEditFind() { private JMenuItem getJMenuItemEditFind() {
if (jMenuItemEditFind == null) { if (jMenuItemEditFind == null) {
jMenuItemEditFind = new JMenuItem(); jMenuItemEditFind = new JMenuItem();
@ -1121,7 +1116,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemEditFindNext() { private JMenuItem getJMenuItemEditFindNext() {
if (jMenuItemEditFindNext == null) { if (jMenuItemEditFindNext == null) {
jMenuItemEditFindNext = new JMenuItem(); jMenuItemEditFindNext = new JMenuItem();
@ -1138,17 +1133,24 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenu @return javax.swing.JMenu
*/ **/
private JMenu getJMenuView() { private JMenu getJMenuView() {
if (jMenuView == null) { if (jMenuView == null) {
//
// Set jMenuView's attributes
//
jMenuView = new JMenu(); jMenuView = new JMenu();
jMenuView.setText("View"); jMenuView.setText("View");
jMenuView.setMnemonic('V'); jMenuView.setMnemonic('V');
jMenuView.setVisible(false);
//
// Add sub menu items
//
jMenuView.add(getJMenuViewToolbars()); jMenuView.add(getJMenuViewToolbars());
jMenuView.add(getJMenuItemViewAdvanced()); jMenuView.add(getJMenuItemViewAdvanced());
jMenuView.add(getJMenuItemViewStandard()); jMenuView.add(getJMenuItemViewStandard());
jMenuView.add(getJMenuItemViewXML()); jMenuView.add(getJMenuItemViewXML());
jMenuView.setVisible(false);
} }
return jMenuView; return jMenuView;
} }
@ -1158,12 +1160,13 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenu @return javax.swing.JMenu
*/ **/
private JMenu getJMenuViewToolbars() { private JMenu getJMenuViewToolbars() {
if (jMenuViewToolbars == null) { if (jMenuViewToolbars == null) {
jMenuViewToolbars = new JMenu(); jMenuViewToolbars = new JMenu();
jMenuViewToolbars.setText("Toolbars"); jMenuViewToolbars.setText("Toolbars");
jMenuViewToolbars.setMnemonic('T'); jMenuViewToolbars.setMnemonic('T');
jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsFile()); jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsFile());
jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsEdit()); jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsEdit());
jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsWindow()); jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsWindow());
@ -1176,7 +1179,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JCheckBoxMenuItem @return javax.swing.JCheckBoxMenuItem
*/ **/
private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsFile() { private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsFile() {
if (jCheckBoxMenuItemViewToolbarsFile == null) { if (jCheckBoxMenuItemViewToolbarsFile == null) {
jCheckBoxMenuItemViewToolbarsFile = new JCheckBoxMenuItem(); jCheckBoxMenuItemViewToolbarsFile = new JCheckBoxMenuItem();
@ -1192,7 +1195,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JCheckBoxMenuItem @return javax.swing.JCheckBoxMenuItem
*/ **/
private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsEdit() { private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsEdit() {
if (jCheckBoxMenuItemViewToolbarsEdit == null) { if (jCheckBoxMenuItemViewToolbarsEdit == null) {
jCheckBoxMenuItemViewToolbarsEdit = new JCheckBoxMenuItem(); jCheckBoxMenuItemViewToolbarsEdit = new JCheckBoxMenuItem();
@ -1208,7 +1211,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JCheckBoxMenuItem @return javax.swing.JCheckBoxMenuItem
*/ **/
private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsWindow() { private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsWindow() {
if (jCheckBoxMenuItemViewToolbarsWindow == null) { if (jCheckBoxMenuItemViewToolbarsWindow == null) {
jCheckBoxMenuItemViewToolbarsWindow = new JCheckBoxMenuItem(); jCheckBoxMenuItemViewToolbarsWindow = new JCheckBoxMenuItem();
@ -1224,7 +1227,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemViewStandard() { private JMenuItem getJMenuItemViewStandard() {
if (jMenuItemViewStandard == null) { if (jMenuItemViewStandard == null) {
jMenuItemViewStandard = new JMenuItem(); jMenuItemViewStandard = new JMenuItem();
@ -1241,7 +1244,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemViewAdvanced() { private JMenuItem getJMenuItemViewAdvanced() {
if (jMenuItemViewAdvanced == null) { if (jMenuItemViewAdvanced == null) {
jMenuItemViewAdvanced = new JMenuItem(); jMenuItemViewAdvanced = new JMenuItem();
@ -1258,21 +1261,29 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenu @return javax.swing.JMenu
*/ **/
private JMenu getJMenuProject() { private JMenu getJMenuProject() {
if (jMenuProject == null) { if (jMenuProject == null) {
//
// Set jMenuProject's attributes
//
jMenuProject = new JMenu(); jMenuProject = new JMenu();
jMenuProject.setText("Project"); jMenuProject.setText("Project");
jMenuProject.setMnemonic('P'); jMenuProject.setMnemonic('P');
//
// Add sub menu items
//
jMenuProject.add(getJMenuItemProjectAdmin()); jMenuProject.add(getJMenuItemProjectAdmin());
//jMenuProject.addSeparator();
jMenuProject.add(getJMenuItemProjectChangeWorkspace()); jMenuProject.add(getJMenuItemProjectChangeWorkspace());
jMenuProject.addSeparator(); jMenuProject.addSeparator();
jMenuProject.add(getJMenuItemProjectCreateFar()); jMenuProject.add(getJMenuItemProjectCreateFar());
jMenuProject.add(getJMenuItemProjectInstallFar()); jMenuProject.add(getJMenuItemProjectInstallFar());
jMenuProject.add(getJMenuItemProjectUpdateFar()); jMenuProject.add(getJMenuItemProjectUpdateFar());
jMenuProject.add(getJMenuItemProjectRemoveFar()); jMenuProject.add(getJMenuItemProjectRemoveFar());
//jMenuProject.addSeparator();
jMenuProject.add(getJMenuProjectBuildTargets()); jMenuProject.add(getJMenuProjectBuildTargets());
} }
return jMenuProject; return jMenuProject;
@ -1283,7 +1294,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemProjectAdmin() { private JMenuItem getJMenuItemProjectAdmin() {
if (jMenuItemProjectAdmin == null) { if (jMenuItemProjectAdmin == null) {
jMenuItemProjectAdmin = new JMenuItem(); jMenuItemProjectAdmin = new JMenuItem();
@ -1301,7 +1312,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemProjectChangeWorkspace() { private JMenuItem getJMenuItemProjectChangeWorkspace() {
if (jMenuItemProjectChangeWorkspace == null) { if (jMenuItemProjectChangeWorkspace == null) {
jMenuItemProjectChangeWorkspace = new JMenuItem(); jMenuItemProjectChangeWorkspace = new JMenuItem();
@ -1318,15 +1329,16 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenu @return javax.swing.JMenu
*/ **/
private JMenu getJMenuProjectBuildTargets() { private JMenu getJMenuProjectBuildTargets() {
if (jMenuProjectBuildTargets == null) { if (jMenuProjectBuildTargets == null) {
jMenuProjectBuildTargets = new JMenu(); jMenuProjectBuildTargets = new JMenu();
jMenuProjectBuildTargets.setText("Build Targets"); jMenuProjectBuildTargets.setText("Build Targets");
jMenuProjectBuildTargets.setMnemonic('T'); jMenuProjectBuildTargets.setMnemonic('T');
jMenuProjectBuildTargets.setVisible(false);
jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsDebug()); jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsDebug());
jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsRelease()); jMenuProjectBuildTargets.add(getJCheckBoxMenuItemProjectBuildTargetsRelease());
jMenuProjectBuildTargets.setVisible(false);
} }
return jMenuProjectBuildTargets; return jMenuProjectBuildTargets;
} }
@ -1336,7 +1348,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JCheckBoxMenuItem @return javax.swing.JCheckBoxMenuItem
*/ **/
private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsDebug() { private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsDebug() {
if (jCheckBoxMenuItemProjectBuildTargetsDebug == null) { if (jCheckBoxMenuItemProjectBuildTargetsDebug == null) {
jCheckBoxMenuItemProjectBuildTargetsDebug = new JCheckBoxMenuItem(); jCheckBoxMenuItemProjectBuildTargetsDebug = new JCheckBoxMenuItem();
@ -1351,7 +1363,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JCheckBoxMenuItem @return javax.swing.JCheckBoxMenuItem
*/ **/
private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsRelease() { private JCheckBoxMenuItem getJCheckBoxMenuItemProjectBuildTargetsRelease() {
if (jCheckBoxMenuItemProjectBuildTargetsRelease == null) { if (jCheckBoxMenuItemProjectBuildTargetsRelease == null) {
jCheckBoxMenuItemProjectBuildTargetsRelease = new JCheckBoxMenuItem(); jCheckBoxMenuItemProjectBuildTargetsRelease = new JCheckBoxMenuItem();
@ -1366,7 +1378,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemToolsToolChainConfiguration() { private JMenuItem getJMenuItemToolsToolChainConfiguration() {
if (jMenuItemToolsToolChainConfiguration == null) { if (jMenuItemToolsToolChainConfiguration == null) {
jMenuItemToolsToolChainConfiguration = new JMenuItem(); jMenuItemToolsToolChainConfiguration = new JMenuItem();
@ -1382,7 +1394,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemToolsClone() { private JMenuItem getJMenuItemToolsClone() {
if (jMenuItemToolsClone == null) { if (jMenuItemToolsClone == null) {
jMenuItemToolsClone = new JMenuItem(); jMenuItemToolsClone = new JMenuItem();
@ -1399,7 +1411,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemToolsCodeScan() { private JMenuItem getJMenuItemToolsCodeScan() {
if (jMenuItemToolsCodeScan == null) { if (jMenuItemToolsCodeScan == null) {
jMenuItemToolsCodeScan = new JMenuItem(); jMenuItemToolsCodeScan = new JMenuItem();
@ -1417,7 +1429,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowDisplaySide() { private JMenuItem getJMenuItemWindowDisplaySide() {
if (jMenuItemWindowDisplaySide == null) { if (jMenuItemWindowDisplaySide == null) {
jMenuItemWindowDisplaySide = new JMenuItem(); jMenuItemWindowDisplaySide = new JMenuItem();
@ -1434,7 +1446,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowDisplayTopBottom() { private JMenuItem getJMenuItemWindowDisplayTopBottom() {
if (jMenuItemWindowDisplayTopBottom == null) { if (jMenuItemWindowDisplayTopBottom == null) {
jMenuItemWindowDisplayTopBottom = new JMenuItem(); jMenuItemWindowDisplayTopBottom = new JMenuItem();
@ -1451,7 +1463,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemViewXML() { private JMenuItem getJMenuItemViewXML() {
if (jMenuItemViewXML == null) { if (jMenuItemViewXML == null) {
jMenuItemViewXML = new JMenuItem(); jMenuItemViewXML = new JMenuItem();
@ -1468,7 +1480,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowTabView() { private JMenuItem getJMenuItemWindowTabView() {
if (jMenuItemWindowTabView == null) { if (jMenuItemWindowTabView == null) {
jMenuItemWindowTabView = new JMenuItem(); jMenuItemWindowTabView = new JMenuItem();
@ -1485,7 +1497,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowSource() { private JMenuItem getJMenuItemWindowSource() {
if (jMenuItemWindowSource == null) { if (jMenuItemWindowSource == null) {
jMenuItemWindowSource = new JMenuItem(); jMenuItemWindowSource = new JMenuItem();
@ -1502,7 +1514,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowXML() { private JMenuItem getJMenuItemWindowXML() {
if (jMenuItemWindowXML == null) { if (jMenuItemWindowXML == null) {
jMenuItemWindowXML = new JMenuItem(); jMenuItemWindowXML = new JMenuItem();
@ -1519,7 +1531,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemWindowPreferences() { private JMenuItem getJMenuItemWindowPreferences() {
if (jMenuItemWindowPreferences == null) { if (jMenuItemWindowPreferences == null) {
jMenuItemWindowPreferences = new JMenuItem(); jMenuItemWindowPreferences = new JMenuItem();
@ -1536,7 +1548,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemHelpContents() { private JMenuItem getJMenuItemHelpContents() {
if (jMenuItemHelpContents == null) { if (jMenuItemHelpContents == null) {
jMenuItemHelpContents = new JMenuItem(); jMenuItemHelpContents = new JMenuItem();
@ -1554,7 +1566,7 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
@return javax.swing.JMenuItem @return javax.swing.JMenuItem
*/ **/
private JMenuItem getJMenuItemHelpIndex() { private JMenuItem getJMenuItemHelpIndex() {
if (jMenuItemHelpIndex == null) { if (jMenuItemHelpIndex == null) {
jMenuItemHelpIndex = new JMenuItem(); jMenuItemHelpIndex = new JMenuItem();
@ -1585,30 +1597,6 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
return jMenuItemHelpSearch; return jMenuItemHelpSearch;
} }
/**
* This method initializes jToolBar
*
* @return javax.swing.JToolBar
*/
// private JToolBar getJToolBarFile() {
// if (jToolBarFile == null) {
// jToolBarFile = new JToolBar();
// jToolBarFile.setFloatable(false);
// }
// return jToolBarFile;
// }
/**
* This method initializes jToolBarEdit
*
* @return javax.swing.JToolBar
*/
// private JToolBar getJToolBarEdit() {
// if (jToolBarEdit == null) {
// jToolBarEdit = new JToolBar();
// jToolBarEdit.setFloatable(false);
// }
// return jToolBarEdit;
// }
/** /**
* This method initializes jMenuItemToolsInstallPackage * This method initializes jMenuItemToolsInstallPackage
* *
@ -1791,50 +1779,19 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
if (arg0.getSource() == jMenuItemProjectCreateFar) { if (arg0.getSource() == jMenuItemProjectCreateFar) {
CreateStepOne cso = new CreateStepOne(this, true); createFar();
int result = cso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "Create Far Done!";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
}
cso.dispose();
} }
if (arg0.getSource() == jMenuItemProjectInstallFar) { if (arg0.getSource() == jMenuItemProjectInstallFar) {
InstallStepOne iso = new InstallStepOne(this, true); installFar();
int result = iso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Install Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
iso.dispose();
} }
if (arg0.getSource() == jMenuItemProjectRemoveFar) { if (arg0.getSource() == jMenuItemProjectRemoveFar) {
DeleteStepOne dso = new DeleteStepOne(this, true); removeFar();
int result = dso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Delete Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
dso.dispose();
} }
if (arg0.getSource() == jMenuItemProjectUpdateFar) { if (arg0.getSource() == jMenuItemProjectUpdateFar) {
UpdateStepOne uso = new UpdateStepOne(this, true); updateFar();
int result = uso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Update Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
uso.dispose();
} }
if (arg0.getSource() == jMenuItemToolsClone) { if (arg0.getSource() == jMenuItemToolsClone) {
@ -1859,10 +1816,14 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
**/ **/
private void makeEmptyTree() { private void makeEmptyTree() {
//
// Make root // Make root
//
dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, -1); dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, -1);
//
// Make Module Description // Make Module Description
//
dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1); dmtnModuleDescription = new IDefaultMutableTreeNode("ModuleDescription", IDefaultMutableTreeNode.MODULE, -1);
// //
@ -1883,7 +1844,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",
IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE, IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
false, this.vPackageList.elementAt(index)); false, this.vPackageList.elementAt(index));
//
// And then add each module in its package
//
Vector<ModuleIdentification> vModule = wt.getAllModules(this.vPackageList.elementAt(index)); Vector<ModuleIdentification> vModule = wt.getAllModules(this.vPackageList.elementAt(index));
for (int indexJ = 0; indexJ < vModule.size(); indexJ++) { for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
if (vModule.get(indexJ).isLibrary()) { if (vModule.get(indexJ).isLibrary()) {
@ -1907,15 +1870,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
} }
// if (this.vModuleList.size() > 0) { //
// for (int index = 0; index < this.vModuleList.size(); index++) {
// dmtnModuleDescription.add(new IDefaultMutableTreeNode(this.vModuleList.elementAt(index).getName(),
// IDefaultMutableTreeNode.MSA_HEADER, false,
// this.vModuleList.elementAt(index)));
// }
// }
// Make Package Description // Make Package Description
//
dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1); dmtnPackageDescription = new IDefaultMutableTreeNode("PackageDescription", IDefaultMutableTreeNode.PACKAGE, -1);
if (this.vPackageList.size() > 0) { if (this.vPackageList.size() > 0) {
for (int index = 0; index < this.vPackageList.size(); index++) { for (int index = 0; index < this.vPackageList.size(); index++) {
@ -1925,7 +1882,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
} }
//
// Make Platform Description // Make Platform Description
//
dmtnPlatformDescription = new IDefaultMutableTreeNode("PlatformDescription", IDefaultMutableTreeNode.PLATFORM, dmtnPlatformDescription = new IDefaultMutableTreeNode("PlatformDescription", IDefaultMutableTreeNode.PLATFORM,
-1); -1);
if (this.vPlatformList.size() > 0) { if (this.vPlatformList.size() > 0) {
@ -1936,6 +1895,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
} }
} }
//
// Add sub nodes to root node
//
dmtnRoot.add(dmtnModuleDescription); dmtnRoot.add(dmtnModuleDescription);
dmtnRoot.add(dmtnPackageDescription); dmtnRoot.add(dmtnPackageDescription);
dmtnRoot.add(dmtnPlatformDescription); dmtnRoot.add(dmtnPlatformDescription);
@ -3069,7 +3031,9 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
this.saveAll(); this.saveAll();
} }
if (result == JOptionPane.NO_OPTION) { if (result == JOptionPane.NO_OPTION) {
//
// Do nothing // Do nothing
//
} }
if (result == JOptionPane.CANCEL_OPTION) { if (result == JOptionPane.CANCEL_OPTION) {
return; return;
@ -3181,6 +3145,69 @@ public class FrameworkWizardUI extends IFrame implements MouseListener, TreeSele
sw.dispose(); sw.dispose();
} }
/**
To create a Far file from current workspace
**/
private void createFar() {
CreateStepOne cso = new CreateStepOne(this, true);
int result = cso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "Create Far Done!";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
}
cso.dispose();
}
/**
To install a Far file to current workspace
**/
private void installFar() {
InstallStepOne iso = new InstallStepOne(this, true);
int result = iso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Install Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
iso.dispose();
}
/**
To remove a Far's items from current workspace
**/
private void removeFar() {
DeleteStepOne dso = new DeleteStepOne(this, true);
int result = dso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Delete Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
dso.dispose();
}
/**
To update an existing Far file
**/
private void updateFar() {
UpdateStepOne uso = new UpdateStepOne(this, true);
int result = uso.showDialog();
if (result == DataType.RETURN_TYPE_OK) {
String strReturn = "<html>Update Far Done! <br>The WORKSPACE will be refreshed!</html>";
JOptionPane.showConfirmDialog(null, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
JOptionPane.INFORMATION_MESSAGE);
this.closeAll();
}
uso.dispose();
}
/** /**
Show Tool Chain Configuration Dialog to setup Tool Chain Show Tool Chain Configuration Dialog to setup Tool Chain

View File

@ -232,4 +232,9 @@ public class DataType {
public static final String MODULE_TYPE_LIBRARY = "Library"; public static final String MODULE_TYPE_LIBRARY = "Library";
public static final String MODULE_TYPE_MODULE = "Module"; public static final String MODULE_TYPE_MODULE = "Module";
//
// Hex String Header
//
public static final String HEX_STRING_HEADER = "0x";
} }

View File

@ -309,7 +309,7 @@ public class DataValidation {
**/ **/
public static boolean isHexWordArrayType(String arg0) { public static boolean isHexWordArrayType(String arg0) {
return arg0.length() <=6 && isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0); return arg0.length() >=6 && isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0);
} }
/** /**

View File

@ -228,6 +228,7 @@ public class SaveFile {
//Save the file //Save the file
// //
msaDoc.save(f, options); msaDoc.save(f, options);
cursor.dispose();
} }
/** /**
@ -262,6 +263,7 @@ public class SaveFile {
//Save the file //Save the file
// //
spdDoc.save(f, options); spdDoc.save(f, options);
cursor.dispose();
} }
/** /**
@ -296,6 +298,7 @@ public class SaveFile {
//Save the file //Save the file
// //
fpdDoc.save(f, options); fpdDoc.save(f, options);
cursor.dispose();
} }
/** /**
@ -326,5 +329,6 @@ public class SaveFile {
//Save the file //Save the file
// //
dbDoc.save(f, options); dbDoc.save(f, options);
cursor.dispose();
} }
} }

View File

@ -38,35 +38,6 @@ public class Tools {
// //
public static String dirForNewSpd = null; public static String dirForNewSpd = null;
/**
Used for test
@param args
**/
public static void main(String[] args) {
System.out.println(getCurrentDateTime());
// Vector<String> v = new Vector<String>();
// Vector<String> v1 = new Vector<String>();
//
// v.addElement("CAC");
// v1.addElement("1111");
// v.addElement("1AC");
// v1.addElement("2222");
// v.addElement("ABC");
// v1.addElement("3333");
// v.addElement("0C");
// v1.addElement("4444");
// v.addElement("AAC");
// v1.addElement("5555");
// Vector<Integer> vs = new Vector<Integer>();
// vs = Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending);
// Tools.sortVectorString(v1, Tools.getVectorSortSequence(v, DataType.Sort_Type_Ascending));
//
// Tools.sortVectorString(v, DataType.Sort_Type_Ascending);
// Tools.sortVectorString(v, DataType.Sort_Type_Descending);
}
/** /**
Get current date and time and format it as "yyyy-MM-dd HH:mm" Get current date and time and format it as "yyyy-MM-dd HH:mm"
@ -407,4 +378,83 @@ public class Tools {
return strReturn; return strReturn;
} }
public static String convertUnicodeHexStringToString(String str) {
//
// Handle if str is null or empty
//
if (str == null) {
return "";
}
if (str.equals("")) {
return "";
}
String returnString = "";
String[] strArray = str.split(" ");
for (int index = 0; index < strArray.length; index++) {
String s = strArray[index];
if (s.length() == 6 && s.indexOf(DataType.HEX_STRING_HEADER) == 0) {
s = s.substring(DataType.HEX_STRING_HEADER.length());
} else {
Log.err("convertUnicodeHexStringToString", "Wrong input string: " + str);
continue;
}
//
// Change hex to dec
//
int dec = Integer.parseInt(s, 16);
returnString = returnString + (char)(dec);
}
return returnString;
}
/**
Convert input string to unicode hex string
@param str input string
@return unicode hex string
**/
public static String convertStringToUnicodeHexString(String str) {
//
// Handle if str is null or empty
//
if (str == null) {
return "";
}
if (str.equals("")) {
return "";
}
//
// convert string to hex string
//
String hexString = "";
for (int index = 0; index < str.length(); index++) {
int codePoint = str.codePointAt(index);
String s = Integer.toHexString(codePoint);
//
// Make the string to four length
//
if (s.length() == 3) {
s = "0" + s;
} else if (s.length() == 2) {
s = "00" + s;
} else if (s.length() == 1) {
s = "000" + s;
}
//
// Add the string to return hex string
//
hexString = hexString + DataType.HEX_STRING_HEADER + s + " ";
}
//
// return hex string
//
return hexString.trim();
}
} }

View File

@ -221,7 +221,7 @@ public class ModuleVariables extends IInternalFrame {
if (this.variables != null) { if (this.variables != null) {
if (this.variables.getVariableList().size() > 0) { if (this.variables.getVariableList().size() > 0) {
for (int index = 0; index < this.variables.getVariableList().size(); index++) { for (int index = 0; index < this.variables.getVariableList().size(); index++) {
String arg0 = variables.getVariableList().get(index).getVariableName(); String arg0 = Tools.convertUnicodeHexStringToString(variables.getVariableList().get(index).getVariableName());
String arg1 = variables.getVariableList().get(index).getGuidCName(); String arg1 = variables.getVariableList().get(index).getGuidCName();
String arg2 = null; String arg2 = null;
if (variables.getVariableList().get(index).getUsage() != null) { if (variables.getVariableList().get(index).getUsage() != null) {
@ -376,7 +376,7 @@ public class ModuleVariables extends IInternalFrame {
for (int index = 0; index < count; index++) { for (int index = 0; index < count; index++) {
Variable p = Variable.Factory.newInstance(); Variable p = Variable.Factory.newInstance();
if (!isEmpty(vid.getVariables(index).getName())) { if (!isEmpty(vid.getVariables(index).getName())) {
p.setVariableName(vid.getVariables(index).getName()); p.setVariableName(Tools.convertStringToUnicodeHexString(vid.getVariables(index).getName()));
} }
if (!isEmpty(vid.getVariables(index).getGuid())) { if (!isEmpty(vid.getVariables(index).getGuid())) {
p.setGuidCName(vid.getVariables(index).getGuid()); p.setGuidCName(vid.getVariables(index).getGuid());

View File

@ -430,13 +430,6 @@ public class VariablesDlg extends IDialog {
return false; return false;
} }
if (!isEmpty(this.jTextFieldVariableName.getText())) {
if (!DataValidation.isHexWordArrayType(this.jTextFieldVariableName.getText())) {
Log.wrn("Update Variables", "Incorrect data type for Variable Name");
return false;
}
}
// //
// Check FeatureFlag // Check FeatureFlag
// //