]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
Retiring the ANT/JAVA build and removing the older EDK II packages that required...
[mirror_edk2.git] / Tools / Java / Source / FrameworkWizard / src / org / tianocore / frameworkwizard / Clone.java
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
deleted file mode 100644 (file)
index f4aebe0..0000000
+++ /dev/null
@@ -1,1291 +0,0 @@
-/** @file\r
\r
- The file is used to clone workspace, module, package and platform\r
\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution.  The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- **/\r
-package org.tianocore.frameworkwizard;\r
-\r
-import java.awt.event.ActionEvent;\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.math.BigInteger;\r
-import java.util.Vector;\r
-\r
-import javax.swing.JFileChooser;\r
-import javax.swing.JPanel;\r
-import javax.swing.JLabel;\r
-import javax.swing.JTextField;\r
-import javax.swing.JButton;\r
-\r
-import org.apache.xmlbeans.XmlException;\r
-import org.tianocore.ModuleDefinitionsDocument.ModuleDefinitions;\r
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
-import org.tianocore.PackageDefinitionsDocument.PackageDefinitions;\r
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;\r
-import org.tianocore.PlatformDefinitionsDocument.PlatformDefinitions;\r
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;\r
-import org.tianocore.frameworkwizard.common.DataType;\r
-import org.tianocore.frameworkwizard.common.DataValidation;\r
-import org.tianocore.frameworkwizard.common.FileOperation;\r
-import org.tianocore.frameworkwizard.common.GlobalData;\r
-import org.tianocore.frameworkwizard.common.IFileFilter;\r
-import org.tianocore.frameworkwizard.common.Log;\r
-import org.tianocore.frameworkwizard.common.OpenFile;\r
-import org.tianocore.frameworkwizard.common.SaveFile;\r
-import org.tianocore.frameworkwizard.common.Tools;\r
-import org.tianocore.frameworkwizard.common.Identifications.Identification;\r
-import org.tianocore.frameworkwizard.common.ui.IDialog;\r
-import org.tianocore.frameworkwizard.common.ui.IFrame;\r
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;\r
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;\r
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;\r
-import org.tianocore.frameworkwizard.workspace.Workspace;\r
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;\r
-import javax.swing.JComboBox;\r
-\r
-/**\r
- The class is used to provide functions to clone workspace, module, package and platform\r
- It extends IDialog\r
-\r
- **/\r
-public class Clone extends IDialog {\r
-\r
-    ///\r
-    /// Define Class Serial Version UID\r
-    ///\r
-    private static final long serialVersionUID = -5469299324965727137L;\r
-\r
-    ///\r
-    /// Define Class Members\r
-    ///\r
-    private JPanel jContentPane = null;\r
-\r
-    private JLabel jLabelType = null;\r
-\r
-    private JTextField jTextFieldType = null;\r
-\r
-    private JLabel jLabelSource = null;\r
-\r
-    private JTextField jTextFieldSource = null;\r
-\r
-    private JButton jButtonBrowse = null;\r
-\r
-    private JLabel jLabelDestinationFile = null;\r
-\r
-    private JTextField jTextFieldFilePath = null;\r
-\r
-    private JLabel jLabelBaseName = null;\r
-\r
-    private JTextField jTextFieldBaseName = null;\r
-\r
-    private JLabel jLabelGuid = null;\r
-\r
-    private JTextField jTextFieldGuid = null;\r
-\r
-    private JLabel jLabelVersion = null;\r
-\r
-    private JTextField jTextFieldVersion = null;\r
-\r
-    private JButton jButtonOk = null;\r
-\r
-    private JButton jButtonCancel = null;\r
-\r
-    private JButton jButtonGenerateGuid = null;\r
-\r
-    private JLabel jLabelBelong = null;\r
-\r
-    private JComboBox jComboBoxExistingPackage = null;\r
-\r
-    ///\r
-    /// Define members not for UI\r
-    ///\r
-\r
-    private int mode = -1;\r
-\r
-    private Vector<PackageIdentification> packages = null;\r
-\r
-    private WorkspaceTools wt = new WorkspaceTools();\r
-\r
-    private Identification oldId = null;\r
-\r
-    private Identification newId = null;\r
-\r
-    private ModuleIdentification mid = null;\r
-\r
-    private PackageIdentification pid = null;\r
-\r
-    private PlatformIdentification fid = null;\r
-\r
-    /**\r
-     This method initializes jTextFieldType    \r
-     \r
-     @return javax.swing.JTextField\r
-     \r
-     **/\r
-    private JTextField getJTextFieldType() {\r
-        if (jTextFieldType == null) {\r
-            jTextFieldType = new JTextField();\r
-            jTextFieldType.setBounds(new java.awt.Rectangle(210, 10, 320, 20));\r
-            jTextFieldType.setEditable(false);\r
-        }\r
-        return jTextFieldType;\r
-    }\r
-\r
-    /**\r
-     This method initializes jTextFieldSource  \r
-     \r
-     @return javax.swing.JTextField    \r
-     \r
-     **/\r
-    private JTextField getJTextFieldSource() {\r
-        if (jTextFieldSource == null) {\r
-            jTextFieldSource = new JTextField();\r
-            jTextFieldSource.setBounds(new java.awt.Rectangle(210, 35, 320, 20));\r
-            jTextFieldSource.setEditable(false);\r
-        }\r
-        return jTextFieldSource;\r
-    }\r
-\r
-    /**\r
-     This method initializes jButtonBrowse     \r
-     \r
-     @return javax.swing.JButton       \r
-     \r
-     **/\r
-    private JButton getJButtonBrowse() {\r
-        if (jButtonBrowse == null) {\r
-            jButtonBrowse = new JButton();\r
-            jButtonBrowse.setBounds(new java.awt.Rectangle(445, 85, 85, 20));\r
-            jButtonBrowse.setText("Browse");\r
-            jButtonBrowse.addActionListener(this);\r
-        }\r
-        return jButtonBrowse;\r
-    }\r
-\r
-    /**\r
-     This method initializes jTextFieldDestinationFile \r
-     \r
-     @return javax.swing.JTextField    \r
-     \r
-     **/\r
-    private JTextField getJTextFieldFilePath() {\r
-        if (jTextFieldFilePath == null) {\r
-            jTextFieldFilePath = new JTextField();\r
-            jTextFieldFilePath.setBounds(new java.awt.Rectangle(210, 85, 230, 20));\r
-        }\r
-        return jTextFieldFilePath;\r
-    }\r
-\r
-    /**\r
-     This method initializes jTextFieldBaseName        \r
-     \r
-     @return javax.swing.JTextField    \r
-     \r
-     **/\r
-    private JTextField getJTextFieldBaseName() {\r
-        if (jTextFieldBaseName == null) {\r
-            jTextFieldBaseName = new JTextField();\r
-            jTextFieldBaseName.setBounds(new java.awt.Rectangle(210, 110, 320, 20));\r
-        }\r
-        return jTextFieldBaseName;\r
-    }\r
-\r
-    /**\r
-     This method initializes jTextFieldGuid    \r
-     \r
-     @return javax.swing.JTextField    \r
-     \r
-     **/\r
-    private JTextField getJTextFieldGuid() {\r
-        if (jTextFieldGuid == null) {\r
-            jTextFieldGuid = new JTextField();\r
-            jTextFieldGuid.setBounds(new java.awt.Rectangle(210, 135, 230, 20));\r
-        }\r
-        return jTextFieldGuid;\r
-    }\r
-\r
-    /**\r
-     This method initializes jTextFieldVersion \r
-     \r
-     @return javax.swing.JTextField    \r
-     \r
-     **/\r
-    private JTextField getJTextFieldVersion() {\r
-        if (jTextFieldVersion == null) {\r
-            jTextFieldVersion = new JTextField();\r
-            jTextFieldVersion.setBounds(new java.awt.Rectangle(210, 160, 320, 20));\r
-        }\r
-        return jTextFieldVersion;\r
-    }\r
-\r
-    /**\r
-     This method initializes jButtonOk \r
-     \r
-     @return javax.swing.JButton       \r
-     \r
-     **/\r
-    private JButton getJButtonOk() {\r
-        if (jButtonOk == null) {\r
-            jButtonOk = new JButton();\r
-            jButtonOk.setBounds(new java.awt.Rectangle(285, 200, 90, 20));\r
-            jButtonOk.setText("Ok");\r
-            jButtonOk.addActionListener(this);\r
-        }\r
-        return jButtonOk;\r
-    }\r
-\r
-    /**\r
-     This method initializes jButtonCancel     \r
-     \r
-     @return javax.swing.JButton       \r
-     \r
-     **/\r
-    private JButton getJButtonCancel() {\r
-        if (jButtonCancel == null) {\r
-            jButtonCancel = new JButton();\r
-            jButtonCancel.setBounds(new java.awt.Rectangle(405, 200, 90, 20));\r
-            jButtonCancel.setText("Cancel");\r
-            jButtonCancel.addActionListener(this);\r
-        }\r
-        return jButtonCancel;\r
-    }\r
-\r
-    /**\r
-     This method initializes jButtonGenerateGuid       \r
-     \r
-     @return javax.swing.JButton       \r
-     \r
-     **/\r
-    private JButton getJButtonGenerateGuid() {\r
-        if (jButtonGenerateGuid == null) {\r
-            jButtonGenerateGuid = new JButton();\r
-            jButtonGenerateGuid.setBounds(new java.awt.Rectangle(445, 135, 85, 20));\r
-            jButtonGenerateGuid.setText("Gen");\r
-            jButtonGenerateGuid.addActionListener(this);\r
-        }\r
-        return jButtonGenerateGuid;\r
-    }\r
-\r
-    /**\r
-     This method initializes jComboBoxExistingPackage  \r
-     \r
-     @return javax.swing.JComboBox     \r
-     \r
-     **/\r
-    private JComboBox getJComboBoxExistingPackage() {\r
-        if (jComboBoxExistingPackage == null) {\r
-            jComboBoxExistingPackage = new JComboBox();\r
-            jComboBoxExistingPackage.setBounds(new java.awt.Rectangle(210, 60, 320, 20));\r
-        }\r
-        return jComboBoxExistingPackage;\r
-    }\r
-\r
-    /**\r
-     This is the default constructor\r
-     \r
-     **/\r
-    public Clone() {\r
-        super();\r
-        init();\r
-    }\r
-\r
-    /**\r
-     This is the override constructor\r
-     \r
-     @param parentFrame       The parent frame which starts this frame\r
-     @param modal             To identify the frame's modal\r
-     @param fileType          To identify the clone target type\r
-     @param identification    The clone target's identification\r
-     \r
-     **/\r
-    public Clone(IFrame parentFrame, boolean modal, int fileType, Identification identification) {\r
-        super(parentFrame, modal);\r
-        this.mode = fileType;\r
-        if (identification != null) {\r
-            this.oldId = new Identification(identification.getName(), identification.getGuid(),\r
-                                            identification.getVersion(), identification.getPath());\r
-            this.newId = new Identification(identification.getName(), identification.getGuid(),\r
-                                            identification.getVersion(), identification.getPath());\r
-        }\r
-        init(mode);\r
-    }\r
-\r
-    /**\r
-     Query all existing packages and fill them into combox\r
-     \r
-     **/\r
-    private void initExistingPackage() {\r
-        packages = wt.getAllPackages();\r
-        for (int index = 0; index < packages.size(); index++) {\r
-            this.jComboBoxExistingPackage.addItem(packages.elementAt(index).getName());\r
-        }\r
-    }\r
-\r
-    /**\r
-     This method initializes this\r
-     \r
-     **/\r
-    private void init() {\r
-        this.setSize(550, 260);\r
-        this.setContentPane(getJContentPane());\r
-        this.setTitle("Clone");\r
-        this.centerWindow();\r
-    }\r
-\r
-    /**\r
-     This method initializes this with given clone target type.\r
-     Customize the frame interface via different clone target type.\r
-     \r
-     @param mode To identify the clone target type\r
-     \r
-     **/\r
-    private void init(int mode) {\r
-        init();\r
-        //\r
-        // For MODULE_SURFACE_AREA\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
-            this.jTextFieldType.setText(DataType.MODULE_SURFACE_AREA);\r
-            String s = oldId.getPath();\r
-            s = Tools.getRelativePath(s, Tools.getFilePathOnly(wt.getPackageIdByModuleId(oldId).getPath()));\r
-            this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));\r
-            initExistingPackage();\r
-            this.jButtonBrowse.setVisible(false);\r
-            this.jTextFieldFilePath\r
-                                   .setToolTipText("<html>Input the module's relative path and filename, for example:<br>Application\\HelloWorld\\HelloWorld.msa</html>");\r
-            this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);\r
-            this.jLabelDestinationFile.setText("New Module Path and Filename");\r
-        }\r
-        //\r
-        // For PACKAGE_SURFACE_AREA\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-            this.jTextFieldType.setText(DataType.PACKAGE_SURFACE_AREA);\r
-            String s = oldId.getPath();\r
-            s = Tools.getRelativePath(oldId.getPath(), Workspace.getCurrentWorkspace());\r
-            this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));\r
-            this.jLabelBelong.setEnabled(false);\r
-            this.jComboBoxExistingPackage.setEnabled(false);\r
-            this.jButtonBrowse.setVisible(false);\r
-            this.jTextFieldFilePath\r
-                                   .setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");\r
-            this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);\r
-            this.jLabelDestinationFile.setText("New Package Path and Filename");\r
-\r
-            //\r
-            // Check if the package can be cloned\r
-            //\r
-            PackageSurfaceArea spd = GlobalData.openingPackageList\r
-                                                                  .getPackageSurfaceAreaFromId(GlobalData.openingPackageList\r
-                                                                                                                            .getIdByPath(this.oldId\r
-                                                                                                                                                   .getPath()));\r
-            if (spd != null) {\r
-                if (spd.getPackageDefinitions() != null) {\r
-                    if (!spd.getPackageDefinitions().getRePackage()) {\r
-                        Log.wrn("Clone Package", "This package can't repackaged and cloned");\r
-                        this.jTextFieldBaseName.setEnabled(false);\r
-                        this.jTextFieldFilePath.setEnabled(false);\r
-                        this.jTextFieldGuid.setEnabled(false);\r
-                        this.jTextFieldVersion.setEnabled(false);\r
-                        this.jButtonGenerateGuid.setEnabled(false);\r
-                        this.jButtonOk.setEnabled(false);\r
-                    }\r
-                }\r
-            }\r
-        }\r
-        //\r
-        // For PLATFORM_SURFACE_AREA\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-            this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA);\r
-            this.jTextFieldSource.setText(oldId.getPath());\r
-            this.jLabelBelong.setEnabled(false);\r
-            this.jComboBoxExistingPackage.setEnabled(false);\r
-            this.jTextFieldFilePath\r
-                                   .setToolTipText("<html>Select the platform's relative path and filename. For example:<br>C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd</html>");\r
-            this.jLabelDestinationFile.setText("New Platform Path and Filename");\r
-        }\r
-        //\r
-        // For WORKSPACE\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_WORKSPACE) {\r
-            this.jTextFieldType.setText(DataType.WORKSPACE);\r
-            this.jTextFieldSource.setText(Workspace.getCurrentWorkspace());\r
-            this.jLabelBelong.setEnabled(false);\r
-            this.jComboBoxExistingPackage.setEnabled(false);\r
-            this.jLabelBaseName.setEnabled(false);\r
-            this.jTextFieldBaseName.setEditable(false);\r
-            this.jLabelGuid.setEnabled(false);\r
-            this.jTextFieldGuid.setEnabled(false);\r
-            this.jButtonGenerateGuid.setEnabled(false);\r
-            this.jLabelVersion.setEnabled(false);\r
-            this.jTextFieldVersion.setEnabled(false);\r
-            this.jTextFieldFilePath\r
-                                   .setToolTipText("<html>Input the workspace path, for example:<br>C:\\MyWorkspace</html>");\r
-            this.jLabelDestinationFile.setText("New Workspace Path");\r
-        }\r
-    }\r
-\r
-    /**\r
-     This method initializes jContentPane\r
-     \r
-     @return javax.swing.JPanel\r
-     \r
-     **/\r
-    private JPanel getJContentPane() {\r
-        if (jContentPane == null) {\r
-            jLabelBelong = new JLabel();\r
-            jLabelBelong.setBounds(new java.awt.Rectangle(15, 60, 190, 20));\r
-            jLabelBelong.setText("Clone Package");\r
-            jLabelVersion = new JLabel();\r
-            jLabelVersion.setBounds(new java.awt.Rectangle(15, 160, 190, 20));\r
-            jLabelVersion.setText("Version");\r
-            jLabelGuid = new JLabel();\r
-            jLabelGuid.setBounds(new java.awt.Rectangle(15, 135, 190, 20));\r
-            jLabelGuid.setText("Guid");\r
-            jLabelBaseName = new JLabel();\r
-            jLabelBaseName.setBounds(new java.awt.Rectangle(15, 110, 190, 20));\r
-            jLabelBaseName.setText("Base Name");\r
-            jLabelDestinationFile = new JLabel();\r
-            jLabelDestinationFile.setBounds(new java.awt.Rectangle(15, 85, 190, 20));\r
-            jLabelDestinationFile.setText("Destination File Name");\r
-            jLabelSource = new JLabel();\r
-            jLabelSource.setBounds(new java.awt.Rectangle(15, 35, 190, 20));\r
-            jLabelSource.setText("Source");\r
-            jLabelType = new JLabel();\r
-            jLabelType.setBounds(new java.awt.Rectangle(15, 10, 190, 20));\r
-            jLabelType.setText("Type");\r
-            jContentPane = new JPanel();\r
-            jContentPane.setLayout(null);\r
-            jContentPane.setSize(new java.awt.Dimension(540, 227));\r
-            jContentPane.add(jLabelType, null);\r
-            jContentPane.add(getJTextFieldType(), null);\r
-            jContentPane.add(jLabelSource, null);\r
-            jContentPane.add(getJTextFieldSource(), null);\r
-            jContentPane.add(jLabelDestinationFile, null);\r
-            jContentPane.add(getJTextFieldFilePath(), null);\r
-            jContentPane.add(jLabelBaseName, null);\r
-            jContentPane.add(getJTextFieldBaseName(), null);\r
-            jContentPane.add(jLabelGuid, null);\r
-            jContentPane.add(getJTextFieldGuid(), null);\r
-            jContentPane.add(jLabelVersion, null);\r
-            jContentPane.add(getJTextFieldVersion(), null);\r
-            jContentPane.add(getJButtonOk(), null);\r
-            jContentPane.add(getJButtonCancel(), null);\r
-            jContentPane.add(getJButtonBrowse(), null);\r
-            jContentPane.add(getJButtonGenerateGuid(), null);\r
-            jContentPane.add(jLabelBelong, null);\r
-            jContentPane.add(getJComboBoxExistingPackage(), null);\r
-        }\r
-        return jContentPane;\r
-    }\r
-\r
-    /* (non-Javadoc)\r
-     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)\r
-     * \r
-     * Override actionPerformed to listen all actions\r
-     */\r
-    public void actionPerformed(ActionEvent arg0) {\r
-        if (arg0.getSource() == jButtonCancel) {\r
-            this.setVisible(false);\r
-            this.returnType = DataType.RETURN_TYPE_CANCEL;\r
-        }\r
-\r
-        if (arg0.getSource() == jButtonOk) {\r
-            if (this.check()) {\r
-                try {\r
-                    //\r
-                    // Save to file\r
-                    //\r
-                    this.save();\r
-                } catch (IOException e) {\r
-                    Log.wrn("Clone", e.getMessage());\r
-                    Log.err("Clone", e.getMessage());\r
-                    return;\r
-                } catch (XmlException e) {\r
-                    Log.wrn("Clone", e.getMessage());\r
-                    Log.err("Clone", e.getMessage());\r
-                    return;\r
-                } catch (Exception e) {\r
-                    Log.wrn("Clone", e.getMessage());\r
-                    Log.err("Clone", e.getMessage());\r
-                    return;\r
-                }\r
-            } else {\r
-                return;\r
-            }\r
-            this.setVisible(false);\r
-        }\r
-\r
-        if (arg0.getSource() == this.jButtonGenerateGuid) {\r
-            this.jTextFieldGuid.setText(Tools.generateUuidString());\r
-        }\r
-\r
-        //\r
-        // Use different file ext for different clone target type\r
-        //\r
-        if (arg0.getSource() == this.jButtonBrowse) {\r
-            JFileChooser fc = new JFileChooser();\r
-            fc.setAcceptAllFileFilterUsed(false);\r
-\r
-            if (mode == DataType.RETURN_TYPE_WORKSPACE) {\r
-                fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));\r
-                fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\r
-            }\r
-            if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
-                fc.setCurrentDirectory(new File(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())\r
-                                                        .getPath()));\r
-                fc.addChoosableFileFilter(new IFileFilter(DataType.MODULE_SURFACE_AREA_EXT));\r
-            }\r
-            if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-                fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));\r
-                fc.addChoosableFileFilter(new IFileFilter(DataType.PACKAGE_SURFACE_AREA_EXT));\r
-            }\r
-            if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-                fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));\r
-                fc.addChoosableFileFilter(new IFileFilter(DataType.PLATFORM_SURFACE_AREA_EXT));\r
-            }\r
-            int result = fc.showSaveDialog(new JPanel());\r
-            if (result == JFileChooser.APPROVE_OPTION) {\r
-                this.jTextFieldFilePath.setText(Tools.addPathExt(fc.getSelectedFile().getPath(), mode));\r
-            }\r
-        }\r
-    }\r
-\r
-    /**\r
-     Check name, guid and version.\r
-     If all of them are valid, save information to new id\r
-     \r
-     @retval true   All name, guid and version are valid\r
-     @retval false  Any one of name, guid and version is invalid\r
-     \r
-     **/\r
-    private boolean checkId(int mode) {\r
-        String name = this.jTextFieldBaseName.getText();\r
-        String guid = this.jTextFieldGuid.getText();\r
-        String version = this.jTextFieldVersion.getText();\r
-        \r
-        //\r
-        // Check Basename\r
-        //\r
-        if (isEmpty(name)) {\r
-            Log.wrn("Clone", "The Name is required!");\r
-            return false;\r
-        }\r
-        if (!DataValidation.isBaseName(name)) {\r
-            Log\r
-               .wrn("Clone",\r
-                    "<html>Incorrect data type for the Name, it must<br>be a single word, starting with an alpha character.</html>");\r
-            return false;\r
-        }\r
-\r
-        //\r
-        // Check Guid\r
-        //\r
-        if (isEmpty(guid)) {\r
-            Log.wrn("Clone", "A Guid is required!!");\r
-            return false;\r
-        }\r
-        if (!DataValidation.isGuid(guid)) {\r
-            Log\r
-               .wrn(\r
-                    "Clone",\r
-                    "<html>Incorrect data type for Guid, which must<br>be in registry format (8-4-4-4-12) for example:<br>d3adb123-eef1-466d-39ac-02febcaf5997</html>");\r
-            return false;\r
-        }\r
-\r
-        //\r
-        // Check Version\r
-        //\r
-        if (isEmpty(version)) {\r
-            Log.wrn("Clone", "A Version must be entered!");\r
-            return false;\r
-        }\r
-        if (!DataValidation.isVersion(version)) {\r
-            Log\r
-               .wrn(\r
-                    "Clone",\r
-                    "<html>Incorrect data type for Version, which must<br>be one or more digits, optionally followed by sequence<br>of one or more dot,  one or more digits; examples:<br>1.0 1.0.1 12.25.256</html>");\r
-            return false;\r
-        }\r
-        \r
-        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
-            String packageGuid = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getGuid();\r
-            String packageVersion = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getVersion();\r
-            if (GlobalData.findModuleId(guid, version, packageGuid, packageVersion) != null) {\r
-                Log.wrn("Clone", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-            if (GlobalData.findPackageId(guid, version) != null) {\r
-                Log.wrn("Clone", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-            if (GlobalData.findPlatformId(guid, version) != null) {\r
-                Log.wrn("Clone", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        //\r
-        // Save information to id\r
-        //\r
-        newId.setName(this.jTextFieldBaseName.getText());\r
-        newId.setGuid(this.jTextFieldGuid.getText());\r
-        newId.setVersion(this.jTextFieldVersion.getText());\r
-        newId.setPath(this.jTextFieldFilePath.getText());\r
-\r
-        return true;\r
-    }\r
-\r
-    /**\r
-     Check before save\r
-     \r
-     @retval true   All check points are passed\r
-     @retval false  Any one of check points is failed\r
-     \r
-     **/\r
-    private boolean check() {\r
-        String src = this.oldId.getPath();\r
-        String trg = this.jTextFieldFilePath.getText();\r
-        File srcFile = new File(src);\r
-        File trgFile = new File(trg);\r
-\r
-        //\r
-        // Common Check\r
-        //\r
-        if (!srcFile.exists()) {\r
-            Log.wrn("Clone", "The source file does not exist!");\r
-            return false;\r
-        }\r
-        if (isEmpty(trg)) {\r
-            Log.wrn("Clone", "The destination file path must be entered!");\r
-            return false;\r
-        }\r
-        if (src.equals(trg)) {\r
-            Log.wrn("Clone", "The source and destination can not be same!");\r
-            return false;\r
-        }\r
-        if (trgFile.exists()) {\r
-            Log.wrn("Clone", "The destination already exists!");\r
-            return false;\r
-        }\r
-\r
-        //\r
-        // Check for workspace\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_WORKSPACE) {\r
-            if (trg.indexOf(src + DataType.FILE_SEPARATOR) == 0) {\r
-                Log.wrn("Clone", "The new workspace can not be located within the current workspace!");\r
-                return false;\r
-            }\r
-        }\r
-\r
-        //\r
-        // Check for Module\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
-            trg = this.getModulePath();\r
-            if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {\r
-                Log.wrn("Clone", "The source and destination paths for cloning a module must be different!");\r
-                return false;\r
-            }\r
-            trgFile = new File(trg);\r
-            if (trgFile.exists()) {\r
-                Log.wrn("Clone", "The target module already exists!");\r
-                return false;\r
-            }\r
-            \r
-            //\r
-            // Check if path already exists\r
-            // Currently we allow user to add multiple msa files in one same directory\r
-            // Remove this checkpoint\r
-            //\r
-//            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
-//                Log.wrn("Clone", "There already exists a same directory with a module");\r
-//                return false;\r
-//            }\r
-            \r
-            return checkId(mode);\r
-        }\r
-\r
-        //\r
-        // Check for Package\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-            if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {\r
-                Log.wrn("Clone", "The package name must include a path!");\r
-                return false;\r
-            }\r
-            trg = this.getPackagePath();\r
-            if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {\r
-                Log.wrn("Clone", "The source and destination paths for cloning a package must be different!");\r
-                return false;\r
-            }\r
-            trgFile = new File(trg);\r
-            if (trgFile.exists()) {\r
-                Log.wrn("Clone", "The target package already exists!");\r
-                return false;\r
-            }\r
-            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
-                Log.wrn("Clone", "There already exists a same directory with a package");\r
-                return false;\r
-            }\r
-            \r
-            return checkId(mode);\r
-        }\r
-\r
-        //\r
-        // Check for Platform\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-            if (trg.indexOf(Workspace.getCurrentWorkspace()) != 0) {\r
-                Log.wrn("Clone", "The platform clone must be located in the current workspace!");\r
-                return false;\r
-            }\r
-            if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {\r
-                Log.wrn("Clone", "The source and destination paths for cloning a platform must be different!");\r
-                return false;\r
-            }\r
-            trgFile = new File(trg);\r
-            if (trgFile.exists()) {\r
-                Log.wrn("Clone", "The target platform already exists.");\r
-                return false;\r
-            }\r
-            if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {\r
-                Log.wrn("Clone", "There already exists a same directory with a platform");\r
-                return false;\r
-            }\r
-            \r
-            return checkId(mode);\r
-        }\r
-\r
-        return true;\r
-    }\r
-\r
-    /**\r
-     Save clone target to new location\r
-     \r
-     @throws IOException\r
-     @throws XmlException\r
-     @throws Exception\r
-     \r
-     **/\r
-    private void save() throws IOException, XmlException, Exception {\r
-        String src = this.oldId.getPath();\r
-        String trg = this.jTextFieldFilePath.getText();\r
-        Vector<String> vFiles = new Vector<String>();\r
-\r
-        //\r
-        // Clone Workspace\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_WORKSPACE) {\r
-            FileOperation.copyFolder(src, trg);\r
-            this.returnType = DataType.RETURN_TYPE_WORKSPACE;\r
-        }\r
-\r
-        //\r
-        // Clone Module Surface Area\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {\r
-            //\r
-            // Get target path from source path\r
-            //\r
-            trg = getModulePath();\r
-            newId.setPath(trg);\r
-            vFiles = wt.getAllFilesPathOfModule(src);\r
-\r
-            String oldPackagePath = GlobalData.openingModuleList.getIdByPath(src).getPackageId().getPath();\r
-            String newPackagePath = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath();\r
-\r
-            //\r
-            // First copy all files to new directory\r
-            //\r
-            FileOperation.copyFile(src, trg);\r
-            for (int index = 1; index < vFiles.size(); index++) {\r
-                String oldFile = vFiles.get(index);\r
-                String newFile = "";\r
-                if (oldFile.indexOf(Tools.getFilePathOnly(src)) > -1) {\r
-                    //\r
-                    // The file is not include header\r
-                    //\r
-                    newFile = oldFile.replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));\r
-                } else if (oldFile.indexOf(Tools.getFilePathOnly(oldPackagePath)) > -1) {\r
-                    //\r
-                    // The file is include header\r
-                    //\r
-                    newFile = oldFile.replace(Tools.getFilePathOnly(oldPackagePath),\r
-                                              Tools.getFilePathOnly(newPackagePath));\r
-                }\r
-\r
-                FileOperation.copyFile(oldFile, newFile);\r
-            }\r
-\r
-            //\r
-            // Create new msa file\r
-            //\r
-            ModuleSurfaceArea msa = null;\r
-            msa = OpenFile.openMsaFile(src);\r
-\r
-            //\r
-            // Update to memory\r
-            //\r
-            msa.getMsaHeader().setModuleName(newId.getName());\r
-            msa.getMsaHeader().setGuidValue(newId.getGuid());\r
-            msa.getMsaHeader().setVersion(newId.getVersion());\r
-\r
-            //\r
-            // Update <Cloned> Section\r
-            //\r
-            updateModuleClonedId(msa, oldId);\r
-\r
-            //\r
-            // Save to file\r
-            //\r
-            SaveFile.saveMsaFile(trg, msa);\r
-\r
-            //\r
-            // Update to platformId\r
-            //\r
-            this.setMid(new ModuleIdentification(newId,\r
-                                                 packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())));\r
-\r
-            //\r
-            // Open belonging package\r
-            //\r
-            PackageSurfaceArea psa = PackageSurfaceArea.Factory.newInstance();\r
-            psa = OpenFile.openSpdFile(mid.getPackageId().getPath());\r
-\r
-            //\r
-            // Update the db file\r
-            //\r
-            wt.addModuleToPackage(mid, psa);\r
-\r
-            //\r
-            // Update GlobalData\r
-            //\r
-            GlobalData.vModuleList.addElement(mid);\r
-            GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);\r
-\r
-            this.returnType = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;\r
-        }\r
-\r
-        //\r
-        // Clone Package Surface Area\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {\r
-            //\r
-            // Get target path from source path\r
-            //\r
-            trg = this.getPackagePath();\r
-            newId.setPath(trg);\r
-            vFiles = wt.getAllFilesPathOfPakcage(src);\r
-\r
-            //\r
-            // First copy all files to new directory\r
-            //\r
-            FileOperation.copyFile(src, trg);\r
-            for (int index = 1; index < vFiles.size(); index++) {\r
-                String oldFile = vFiles.get(index);\r
-                String newFile = vFiles.get(index).replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));\r
-                FileOperation.copyFile(oldFile, newFile);\r
-            }\r
-\r
-            //\r
-            // Create new spd file\r
-            //\r
-            PackageSurfaceArea spd = null;\r
-            spd = OpenFile.openSpdFile(src);\r
-\r
-            //\r
-            // Update to memory\r
-            //\r
-            spd.getSpdHeader().setPackageName(newId.getName());\r
-            spd.getSpdHeader().setGuidValue(newId.getGuid());\r
-            spd.getSpdHeader().setVersion(newId.getVersion());\r
-\r
-            //\r
-            // Update <Cloned> Section\r
-            //\r
-            updatePackageClonedId(spd, oldId);\r
-\r
-            //\r
-            // Save to file\r
-            //\r
-            SaveFile.saveSpdFile(trg, spd);\r
-\r
-            //\r
-            // Update to platformId\r
-            //\r
-            this.setPid(new PackageIdentification(newId));\r
-\r
-            //\r
-            // Update the db file\r
-            //\r
-            wt.addPackageToDatabase(pid);\r
-\r
-            //\r
-            // Update GlobalData\r
-            //\r
-            GlobalData.vPackageList.addElement(pid);\r
-            GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);\r
-\r
-            //\r
-            // Add all cloned modules\r
-            //\r
-            Vector<String> modulePaths = GlobalData.getAllModulesOfPackage(pid.getPath());\r
-            String modulePath = null;\r
-            ModuleSurfaceArea msa = null;\r
-\r
-            for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {\r
-                try {\r
-                    modulePath = modulePaths.get(indexJ);\r
-                    msa = OpenFile.openMsaFile(modulePath);\r
-                } catch (IOException e) {\r
-                    Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
-                    continue;\r
-                } catch (XmlException e) {\r
-                    Log.err("Open Module Surface Area " + modulePath, e.getMessage());\r
-                    continue;\r
-                } catch (Exception e) {\r
-                    Log.err("Open Module Surface Area " + modulePath, "Invalid file type");\r
-                    continue;\r
-                }\r
-                Identification id = Tools.getId(modulePath, msa);\r
-                mid = new ModuleIdentification(id, pid);\r
-                GlobalData.vModuleList.addElement(mid);\r
-                GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);\r
-            }\r
-\r
-            this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;\r
-        }\r
-\r
-        //\r
-        // Clone Platform Surface Area\r
-        //\r
-        if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {\r
-            PlatformSurfaceArea fpd = null;\r
-            fpd = OpenFile.openFpdFile(src);\r
-\r
-            //\r
-            // Update to memory\r
-            //\r
-            fpd.getPlatformHeader().setPlatformName(newId.getName());\r
-            fpd.getPlatformHeader().setGuidValue(newId.getGuid());\r
-            fpd.getPlatformHeader().setVersion(newId.getVersion());\r
-\r
-            //\r
-            // Update Cloned From element\r
-            //\r
-            updatePlatformClonedId(fpd, oldId);\r
-\r
-            //\r
-            // Save to file\r
-            //\r
-            SaveFile.saveFpdFile(trg, fpd);\r
-\r
-            //\r
-            // Update to platformId\r
-            //\r
-            this.setFid(new PlatformIdentification(newId));\r
-\r
-            //\r
-            // Update the db file\r
-            //\r
-            wt.addPlatformToDatabase(fid);\r
-\r
-            //\r
-            // Update GlobalData\r
-            //\r
-            GlobalData.vPlatformList.addElement(fid);\r
-            GlobalData.openingPlatformList.insertToOpeningPlatformList(fid, fpd);\r
-\r
-            this.returnType = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;\r
-        }\r
-        vFiles = null;\r
-    }\r
-\r
-    /**\r
-     Get the path of selected package\r
-     \r
-     @return String The path of selected package\r
-     \r
-     **/\r
-    private String getSelectPackagePath() {\r
-        return Tools.getFilePathOnly(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath());\r
-    }\r
-\r
-    /**\r
-     Get the path of source module\r
-     Since the path of source module is relative, make it up to full path.\r
-     \r
-     @return String The full path of source module\r
-     \r
-     **/\r
-    private String getModulePath() {\r
-        String trg = this.jTextFieldFilePath.getText();\r
-        trg = Tools.addPathExt(trg, mode);\r
-        trg = Tools.addFileSeparator(getSelectPackagePath()) + trg;\r
-        Tools.convertPathToCurrentOsType(trg);\r
-        return trg;\r
-    }\r
-\r
-    /**\r
-     Get the path of source package\r
-     Since the path of source package is relative, make it up to full path.\r
-     \r
-     @return String The full path of source package\r
-     \r
-     **/\r
-    private String getPackagePath() {\r
-        String trg = this.jTextFieldFilePath.getText();\r
-        trg = Tools.addPathExt(trg, mode);\r
-        trg = Tools.addFileSeparator(Workspace.getCurrentWorkspace()) + trg;\r
-        trg = Tools.convertPathToCurrentOsType(trg);\r
-        return trg;\r
-    }\r
-\r
-    /**\r
-     Set msa file's <Cloned> section via given identification\r
-     \r
-     @param msa ModuleSurfaceArea for clone target\r
-     @param id Identification of clone source\r
-     \r
-     **/\r
-    private void updateModuleClonedId(ModuleSurfaceArea msa, Identification id) {\r
-        //\r
-        // Get PlatformDefinitions First\r
-        //\r
-        ModuleDefinitions pd = null;\r
-        if (msa.getModuleDefinitions() == null) {\r
-            pd = ModuleDefinitions.Factory.newInstance();\r
-            msa.addNewModuleDefinitions();\r
-        } else {\r
-            pd = msa.getModuleDefinitions();\r
-        }\r
-\r
-        //\r
-        // Get ClonedFrom then\r
-        //\r
-        ModuleDefinitions.ClonedFrom cf = null;\r
-        BigInteger count = new BigInteger("-1");\r
-        if (pd.getClonedFrom() == null) {\r
-            cf = ModuleDefinitions.ClonedFrom.Factory.newInstance();\r
-        } else {\r
-            cf = pd.getClonedFrom();\r
-            if (cf != null) {\r
-                for (int index = 0; index < cf.getClonedList().size(); index++) {\r
-                    if (cf.getClonedList().get(index).getId() != null) {\r
-                        count = count.max(cf.getClonedList().get(index).getId());\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        //\r
-        // Set new Cloned item\r
-        //\r
-        ModuleDefinitions.ClonedFrom.Cloned c = ModuleDefinitions.ClonedFrom.Cloned.Factory.newInstance();\r
-        c.setModuleGuid(id.getGuid());\r
-        c.setModuleVersion(id.getVersion());\r
-        c.setPackageGuid(wt.getPackageIdByModuleId(oldId).getGuid());\r
-        c.setPackageVersion(wt.getPackageIdByModuleId(oldId).getVersion());\r
-        c.setId(count.add(new BigInteger("1")));\r
-        String guid = wt.getModuleFarGuid(oldId);\r
-        if (guid != null && !guid.equals("")) {\r
-            c.setFarGuid(guid);\r
-        }\r
-\r
-        cf.addNewCloned();\r
-        cf.setClonedArray(cf.getClonedList().size() - 1, c);\r
-        pd.addNewClonedFrom();\r
-        pd.setClonedFrom(cf);\r
-        msa.setModuleDefinitions(pd);\r
-    }\r
-\r
-    /**\r
-     Set spd file's <Cloned> section via given identification\r
-     \r
-     @param spd PackageSurfaceArea for clone target\r
-     @param id Identification of clone source\r
-     \r
-     **/\r
-    private void updatePackageClonedId(PackageSurfaceArea spd, Identification id) {\r
-        //\r
-        // Get PlatformDefinitions First\r
-        //\r
-        PackageDefinitions pd = null;\r
-        if (spd.getPackageDefinitions() == null) {\r
-            pd = PackageDefinitions.Factory.newInstance();\r
-            spd.addNewPackageDefinitions();\r
-        } else {\r
-            pd = spd.getPackageDefinitions();\r
-        }\r
-\r
-        //\r
-        // Get ClonedFrom then\r
-        //\r
-        PackageDefinitions.ClonedFrom cf = null;\r
-        BigInteger count = new BigInteger("-1");\r
-        if (pd.getClonedFrom() == null) {\r
-            cf = PackageDefinitions.ClonedFrom.Factory.newInstance();\r
-        } else {\r
-            cf = pd.getClonedFrom();\r
-            if (cf != null) {\r
-                for (int index = 0; index < cf.getClonedList().size(); index++) {\r
-                    if (cf.getClonedList().get(index).getId() != null) {\r
-                        count = count.max(cf.getClonedList().get(index).getId());\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        //\r
-        // Set new Cloned item\r
-        //\r
-        PackageDefinitions.ClonedFrom.Cloned c = PackageDefinitions.ClonedFrom.Cloned.Factory.newInstance();\r
-        c.setPackageGuid(id.getGuid());\r
-        c.setPackageVersion(id.getVersion());\r
-        c.setId(count.add(new BigInteger("1")));\r
-        String guid = wt.getPackageFarGuid(oldId);\r
-        if (guid != null && !guid.equals("")) {\r
-            c.setFarGuid(guid);\r
-        }\r
-\r
-        cf.addNewCloned();\r
-        cf.setClonedArray(cf.getClonedList().size() - 1, c);\r
-        pd.addNewClonedFrom();\r
-        pd.setClonedFrom(cf);\r
-        spd.setPackageDefinitions(pd);\r
-    }\r
-\r
-    /**\r
-     Set fpd file's <Cloned> section via given identification\r
-     \r
-     @param fpd PlatformSurfaceArea for clone target\r
-     @param id Identification of clone source\r
-     \r
-     **/\r
-    private void updatePlatformClonedId(PlatformSurfaceArea fpd, Identification id) {\r
-        //\r
-        // Get PlatformDefinitions First\r
-        //\r
-        PlatformDefinitions pd = null;\r
-        if (fpd.getPlatformDefinitions() == null) {\r
-            pd = PlatformDefinitions.Factory.newInstance();\r
-            fpd.addNewPlatformDefinitions();\r
-        } else {\r
-            pd = fpd.getPlatformDefinitions();\r
-        }\r
-\r
-        //\r
-        // Get ClonedFrom then\r
-        //\r
-        PlatformDefinitions.ClonedFrom cf = null;\r
-        BigInteger count = new BigInteger("-1");\r
-        if (pd.getClonedFrom() == null) {\r
-            cf = PlatformDefinitions.ClonedFrom.Factory.newInstance();\r
-        } else {\r
-            cf = pd.getClonedFrom();\r
-            if (cf != null) {\r
-                for (int index = 0; index < cf.getClonedList().size(); index++) {\r
-                    if (cf.getClonedList().get(index).getId() != null) {\r
-                        count = count.max(cf.getClonedList().get(index).getId());\r
-                    }\r
-                }\r
-            }\r
-        }\r
-\r
-        //\r
-        // Set new Cloned item\r
-        //\r
-        PlatformDefinitions.ClonedFrom.Cloned c = PlatformDefinitions.ClonedFrom.Cloned.Factory.newInstance();\r
-        c.setPlatformGuid(id.getGuid());\r
-        c.setPlatformVersion(id.getVersion());\r
-        c.setId(count.add(new BigInteger("1")));\r
-        String guid = wt.getPlatformFarGuid(oldId);\r
-        if (guid != null && !guid.equals("")) {\r
-            c.setFarGuid(guid);\r
-        }\r
-\r
-        cf.addNewCloned();\r
-        cf.setClonedArray(cf.getClonedList().size() - 1, c);\r
-        pd.addNewClonedFrom();\r
-        pd.setClonedFrom(cf);\r
-        fpd.setPlatformDefinitions(pd);\r
-    }\r
-\r
-    /**\r
-     Get PlatformIdentification\r
-     \r
-     @return PlatformIdentification\r
-     \r
-     **/\r
-    public PlatformIdentification getFid() {\r
-        return fid;\r
-    }\r
-\r
-    /**\r
-     Set PlatformIdentification\r
-     \r
-     @param fid PlatformIdentification\r
-     \r
-     **/\r
-    public void setFid(PlatformIdentification fid) {\r
-        this.fid = fid;\r
-    }\r
-\r
-    /**\r
-     Get ModuleIdentification\r
-     \r
-     @return ModuleIdentification\r
-     \r
-     **/\r
-    public ModuleIdentification getMid() {\r
-        return mid;\r
-    }\r
-\r
-    /**\r
-     Set ModuleIdentification\r
-     \r
-     @param mid ModuleIdentification\r
-     \r
-     **/\r
-    public void setMid(ModuleIdentification mid) {\r
-        this.mid = mid;\r
-    }\r
-\r
-    /**\r
-     Get PackageIdentification\r
-     \r
-     @return PackageIdentification\r
-     \r
-     **/\r
-    public PackageIdentification getPid() {\r
-        return pid;\r
-    }\r
-\r
-    /**\r
-     Set PackageIdentification\r
-     \r
-     @param pid PackageIdentification\r
-     \r
-     **/\r
-    public void setPid(PackageIdentification pid) {\r
-        this.pid = pid;\r
-    }\r
-}\r