[hg] main-silver: #72879: Deleting suite with its modules in one...

  • From: Martin Kozeny < >
  • To:
  • Subject: [hg] main-silver: #72879: Deleting suite with its modules in one...
  • Date: Tue, 02 Apr 2013 10:25:06 -0700

changeset 44345b68dbc3 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/44345b68dbc3
description:
        #72879: Deleting suite with its modules in one dialog is now allowed.

diffstat:

 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java
                 |    3 +-
 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties
          |   30 +
 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.form
              |   30 +-
 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.java
              |   78 +-
 
projectuiapi/src/org/netbeans/spi/project/ui/support/DefaultProjectOperations.java
              |   85 +-
 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectOperationsImplementation.java
 |  572 ++-------
 6 files changed, 281 insertions(+), 517 deletions(-)

diffs (1152 lines):

diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java
@@ -72,6 +72,7 @@
 import org.netbeans.modules.apisupport.project.ui.customizer.SuiteCustomizer;
 import org.netbeans.modules.apisupport.project.ui.customizer.SuiteProperties;
 import org.netbeans.modules.apisupport.project.ui.customizer.SuiteUtils;
+import 
org.netbeans.modules.apisupport.project.ui.wizard.DefaultSuiteProjectOperations;
 import org.netbeans.modules.apisupport.project.universe.HarnessVersion;
 import org.netbeans.modules.apisupport.project.universe.NbPlatform;
 import org.netbeans.spi.project.ActionProgress;
@@ -366,7 +367,7 @@
             return;
         }
         if (ActionProvider.COMMAND_DELETE.equals(command)) {
-            DefaultProjectOperations.performDefaultDeleteOperation(project);
+            
DefaultSuiteProjectOperations.performDefaultDeleteOperation(project);
         } else if (ActionProvider.COMMAND_RENAME.equals(command)) {
             DefaultProjectOperations.performDefaultRenameOperation(project, 
null);
         } else if (ActionProvider.COMMAND_MOVE.equals(command)) {
diff --git 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties
--- 
a/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/Bundle.properties
@@ -124,3 +124,33 @@
 ACS_CTL_License=License file
 BasicConfVisualPanel.osgi=Generate &OSGi Bundle
 BasicConfVisualPanel.osgi.AccessibleContext.accessibleDescription=Generate 
OSGi Bundle
+
+
+#DefaultAntProjectOperations:
+LBL_Progress_Cleaning_Project=Cleaning Project
+LBL_Progress_Deleting_File=Deleting {0}
+LBL_Project_cannot_be_deleted=Project {0} cannot be deleted.
+LBL_Delete_Project_Caption=Delete Project
+LBL_Deleting_Project=Deleting Project\:
+LBL_Yes_Button=&Yes
+LBL_No_Button=No
+LBL_Cancel_Buttn=Cancel
+ACSD_Yes_Button=Yes Button
+ACSD_No_Button=No Button
+ACSD_Cancel_Button=Cancel Button
+
+#DefaultProjectDeletePanel:
+#{0}: project name
+LBL_Pre_Delete_Warning=This will delete project "{0}" so that it cannot be 
opened in the NetBeans IDE anymore.
+#{0}: project folder
+LBL_Delete_Also_Sources=&Also delete sources from modules of project "{0}".
+LBL_Also_Delete_Modules=Also delete modules of project "{0}".
+LBL_Pre_Delete_Question=Are you sure you want to delete it?
+ASCN_Pre_Delete_Warning=Pre Delete Warning
+#{0}: project name
+ACSD_Pre_Delete_Warning=Are you sure you want to delete project "{0}"?
+#{0}: project folder
+ACSN_Delete_Also_Sources=Also delete sources under "{0}" folder.
+ACSD_Delete_Also_Sources=N/A
+#accessible description for the whole dialog
+ACSD_Delete_Panel=N/A
diff --git 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.form
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.form
copy from 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.form
copy to 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.form
--- 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.form
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.form
@@ -1,4 +1,4 @@
-<?xml version="1.1" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8" ?>
 
 <Form version="1.2" maxVersion="1.2" 
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
   <AccessibilityProperties>
@@ -54,15 +54,29 @@
         </Constraint>
       </Constraints>
     </Component>
+    <Component class="javax.swing.JCheckBox" name="deleteModulesCheckBox">
+      <Properties>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+          <Connection 
code="org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 &quot;LBL_Also_Delete_Modules&quot;, new Object[] {projectDisplaName})" 
type="code"/>
+        </Property>
+      </Properties>
+      <AuxValues>
+        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" 
type="java.lang.String" value="new javax.swing.JCheckBox()"/>
+        <AuxValue name="JavaCodeGenerator_InitCodePost" 
type="java.lang.String" value="deleteModulesCheckBox.setEnabled 
(enableDeleteModulesCheckBox);"/>
+      </AuxValues>
+      <Constraints>
+        <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" 
gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" 
insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
+        </Constraint>
+      </Constraints>
+    </Component>
     <Component class="javax.swing.JCheckBox" name="deleteSourcesCheckBox">
       <Properties>
-        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
-          <ResourceString 
bundle="org/netbeans/modules/project/uiapi/Bundle.properties" 
key="LBL_Delete_Also_Sources" 
replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, 
&quot;{key}&quot;, {arguments})">
-            <Argument index="0" javacode="projectFolder"/>
-          </ResourceString>
+        <Property name="text" type="java.lang.String" 
editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+          <Connection 
code="org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 &quot;LBL_Delete_Also_Sources&quot;, new Object[] {projectDisplaName})" 
type="code"/>
         </Property>
         <Property name="enabled" type="boolean" 
editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
-          <Connection code="enableCheckbox" type="code"/>
+          <Connection code="false" type="code"/>
         </Property>
       </Properties>
       <AccessibilityProperties>
@@ -77,14 +91,14 @@
       </AccessibilityProperties>
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" 
insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
+          <GridBagConstraints gridX="0" gridY="3" gridWidth="1" 
gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="12" 
insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
         </Constraint>
       </Constraints>
     </Component>
     <Container class="javax.swing.JPanel" name="progress">
       <Constraints>
         <Constraint 
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" 
value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
-          <GridBagConstraints gridX="0" gridY="3" gridWidth="2" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="1.0"/>
+          <GridBagConstraints gridX="0" gridY="4" gridWidth="1" 
gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" 
insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="1.0"/>
         </Constraint>
       </Constraints>
 
diff --git 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.java
copy from 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.java
copy to 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.java
--- 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectDeletePanel.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectDeletePanel.java
@@ -42,31 +42,36 @@
  * made subject to such option by the copyright holder.
  */
 
-package org.netbeans.modules.project.uiapi;
+package org.netbeans.modules.apisupport.project.ui.wizard;
 
 import java.awt.CardLayout;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.api.progress.ProgressHandleFactory;
-import 
org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation.InvalidablePanel;
+import 
org.netbeans.modules.apisupport.project.ui.wizard.DefaultSuiteProjectOperationsImplementation.InvalidablePanel;
 
 /**
  * @author Jan Lahoda
  */
-final class DefaultProjectDeletePanel extends javax.swing.JPanel implements 
InvalidablePanel {
+final class DefaultSuiteProjectDeletePanel extends javax.swing.JPanel 
implements InvalidablePanel {
 
     private String projectDisplaName;
     private String projectFolder;
-    private boolean enableCheckbox;
+    private boolean hasSourcesToDelete;
+    private boolean enableDeleteModulesCheckBox;
     private ProgressHandle handle;
     
-    public DefaultProjectDeletePanel(ProgressHandle handle, String 
projectDisplaName, String projectFolder, boolean enableCheckbox) {
+    public DefaultSuiteProjectDeletePanel(ProgressHandle handle, String 
projectDisplaName, String projectFolder, boolean hasSourcesToDelete, boolean 
enableDeleteModulesCheckBox) {
         this.projectDisplaName = projectDisplaName;
         this.projectFolder = projectFolder;
-        this.enableCheckbox = enableCheckbox;
+        this.hasSourcesToDelete = hasSourcesToDelete;
+        this.enableDeleteModulesCheckBox = enableDeleteModulesCheckBox;
         this.handle = handle;
         initComponents();
-        
+        attachListeners();
         if 
(Boolean.getBoolean("org.netbeans.modules.project.uiapi.DefaultProjectOperations.showProgress"))
 {
             ((CardLayout) progress.getLayout()).show(progress, "progress");
         }
@@ -77,6 +82,7 @@
         java.awt.GridBagConstraints gridBagConstraints;
 
         warningText = new javax.swing.JTextArea();
+        deleteModulesCheckBox = new javax.swing.JCheckBox();
         deleteSourcesCheckBox = new javax.swing.JCheckBox();
         progress = new javax.swing.JPanel();
         jPanel4 = new javax.swing.JPanel();
@@ -90,7 +96,7 @@
         warningText.setEditable(false);
         warningText.setFont(javax.swing.UIManager.getFont("Label.font"));
         warningText.setLineWrap(true);
-        
warningText.setText(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "LBL_Pre_Delete_Warning", new Object[] {projectDisplaName})); // NOI18N
+        
warningText.setText(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "LBL_Pre_Delete_Warning", new Object[] {projectDisplaName})); // NOI18N
         warningText.setWrapStyleWord(true);
         
warningText.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));
         warningText.setOpaque(false);
@@ -100,26 +106,36 @@
         gridBagConstraints.weightx = 1.0;
         gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
         add(warningText, gridBagConstraints);
-        
warningText.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "ASCN_Pre_Delete_Warning", new Object[] {})); // NOI18N
-        
warningText.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "ACSD_Pre_Delete_Warning", new Object[] {projectDisplaName})); // NOI18N
+        
warningText.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "ASCN_Pre_Delete_Warning", new Object[] {})); // NOI18N
+        
warningText.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "ACSD_Pre_Delete_Warning", new Object[] {projectDisplaName})); // NOI18N
 
-        org.openide.awt.Mnemonics.setLocalizedText(deleteSourcesCheckBox, 
org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class, 
"LBL_Delete_Also_Sources", new Object[] {projectFolder})); // NOI18N
-        deleteSourcesCheckBox.setEnabled(enableCheckbox);
+        org.openide.awt.Mnemonics.setLocalizedText(deleteModulesCheckBox, 
org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class, 
"LBL_Also_Delete_Modules", new Object[] {projectDisplaName}));
+        deleteModulesCheckBox.setEnabled (enableDeleteModulesCheckBox);
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
         gridBagConstraints.gridy = 2;
+        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+        gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
+        add(deleteModulesCheckBox, gridBagConstraints);
+
+        org.openide.awt.Mnemonics.setLocalizedText(deleteSourcesCheckBox, 
org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class, 
"LBL_Delete_Also_Sources", new Object[] {projectDisplaName}));
+        deleteSourcesCheckBox.setEnabled(false);
+        gridBagConstraints = new java.awt.GridBagConstraints();
+        gridBagConstraints.gridx = 0;
+        gridBagConstraints.gridy = 3;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
         add(deleteSourcesCheckBox, gridBagConstraints);
-        
deleteSourcesCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "ACSN_Delete_Also_Sources", new Object[] {projectFolder})); // NOI18N
-        
deleteSourcesCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "ACSD_Delete_Also_Sources", new Object[] {})); // NOI18N
+        
deleteSourcesCheckBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "ACSN_Delete_Also_Sources", new Object[] {projectFolder})); // NOI18N
+        
deleteSourcesCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "ACSD_Delete_Also_Sources", new Object[] {})); // NOI18N
 
         progress.setLayout(new java.awt.CardLayout());
         progress.add(jPanel4, "not-progress");
 
         progressImpl.setLayout(new java.awt.GridBagLayout());
 
-        org.openide.awt.Mnemonics.setLocalizedText(jLabel5, 
org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class, 
"LBL_Deleting_Project", new Object[] {})); // NOI18N
+        org.openide.awt.Mnemonics.setLocalizedText(jLabel5, 
org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class, 
"LBL_Deleting_Project", new Object[] {})); // NOI18N
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
@@ -139,8 +155,7 @@
 
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
-        gridBagConstraints.gridy = 3;
-        gridBagConstraints.gridwidth = 2;
+        gridBagConstraints.gridy = 4;
         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
         gridBagConstraints.weightx = 1.0;
@@ -148,7 +163,7 @@
         gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
         add(progress, gridBagConstraints);
 
-        org.openide.awt.Mnemonics.setLocalizedText(questionLabel, 
org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class, 
"LBL_Pre_Delete_Question")); // NOI18N
+        org.openide.awt.Mnemonics.setLocalizedText(questionLabel, 
org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class, 
"LBL_Pre_Delete_Question")); // NOI18N
         gridBagConstraints = new java.awt.GridBagConstraints();
         gridBagConstraints.gridx = 0;
         gridBagConstraints.gridy = 1;
@@ -157,10 +172,11 @@
         gridBagConstraints.insets = new java.awt.Insets(10, 12, 0, 0);
         add(questionLabel, gridBagConstraints);
 
-        
getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class,
 "ACSD_Delete_Panel", new Object[] {})); // NOI18N
+        
getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(DefaultSuiteProjectDeletePanel.class,
 "ACSD_Delete_Panel", new Object[] {})); // NOI18N
     }// </editor-fold>//GEN-END:initComponents
     
     // Variables declaration - do not modify//GEN-BEGIN:variables
+    private javax.swing.JCheckBox deleteModulesCheckBox;
     private javax.swing.JCheckBox deleteSourcesCheckBox;
     private javax.swing.JLabel jLabel5;
     private javax.swing.JPanel jPanel3;
@@ -179,6 +195,14 @@
         deleteSourcesCheckBox.setSelected(value);
     }
 
+    public boolean isDeleteModules() {
+        return deleteModulesCheckBox.isSelected();
+    }
+
+    void setDeleteModules(boolean value) {
+        deleteModulesCheckBox.setSelected(value);
+    }
+
     public @Override void addChangeListener(ChangeListener l) {}
 
     public @Override void removeChangeListener(ChangeListener l) {}
@@ -192,4 +216,20 @@
         return true;
     }
     
+    private void attachListeners() {
+        this.deleteModulesCheckBox.addItemListener(new ItemListener() {
+
+            @Override
+            public void itemStateChanged(ItemEvent e) {
+                if(deleteModulesCheckBox.isSelected() && hasSourcesToDelete) 
{
+                    deleteSourcesCheckBox.setEnabled(true);
 }
+                else {
+                    deleteSourcesCheckBox.setEnabled(false);
+                }
+            }
+
+        });
+    }
+    
+}
diff --git 
a/projectuiapi/src/org/netbeans/spi/project/ui/support/DefaultProjectOperations.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperations.java
copy from 
projectuiapi/src/org/netbeans/spi/project/ui/support/DefaultProjectOperations.java
copy to 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperations.java
--- 
a/projectuiapi/src/org/netbeans/spi/project/ui/support/DefaultProjectOperations.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperations.java
@@ -41,11 +41,10 @@
  * Version 2 license, then the option applies only if the new code is
  * made subject to such option by the copyright holder.
  */
-package org.netbeans.spi.project.ui.support;
+package org.netbeans.modules.apisupport.project.ui.wizard;
 
-import org.netbeans.api.project.Project;
+import org.netbeans.modules.apisupport.project.suite.SuiteProject;
 import org.netbeans.spi.project.support.ProjectOperations;
-import 
org.netbeans.modules.project.uiapi.DefaultProjectOperationsImplementation;
 
 /**Support class to allow the project type implementors to perform {@link 
ProjectOperations}
  * by simply calling a method in this class. Each method in this class 
provides a default
@@ -57,12 +56,12 @@
  * @since 1.10
  * @author Jan Lahoda
  */
-public final class DefaultProjectOperations {
+public final class DefaultSuiteProjectOperations {
     
     /**
-     * Creates a new instance of DefaultProjectOperations
+     * Creates a new instance of DefaultSuiteProjectOperations
      */
-    private DefaultProjectOperations() {
+    private DefaultSuiteProjectOperations() {
     }
     
     /**Perform default delete operation. Gathers all necessary data, shows a 
confirmation
@@ -76,7 +75,7 @@
      * if {@link 
org.netbeans.spi.project.support.ProjectOperations#isDeleteOperationSupported}
      * returns false for this project.
      */
-    public static void performDefaultDeleteOperation(Project p) throws 
IllegalArgumentException {
+    public static void performDefaultDeleteOperation(SuiteProject p) throws 
IllegalArgumentException {
         if (p == null) {
             throw new IllegalArgumentException("Project is null");
         }
@@ -85,77 +84,7 @@
             throw new IllegalArgumentException("Attempt to delete project 
that does not support deletion.");
         }
         
-        DefaultProjectOperationsImplementation.deleteProject(p);
-    }
-    
-    /**Perform default copy operation. Gathers all necessary data, shows a 
confirmation
-     * dialog and copies the project (if confirmed by the user).
-     *
-     * @since 1.10
-     *
-     * @param p project to copy
-     * @throws IllegalArgumentException if
-     * <code>p == null</code> or
-     * {@link 
org.netbeans.spi.project.support.ProjectOperations#isCopyOperationSupported}
-     * returns false for this project.
-     */
-    public static void performDefaultCopyOperation(Project p) throws 
IllegalArgumentException {
-        if (p == null) {
-            throw new IllegalArgumentException("Project is null");
-        }
-        
-        if (!ProjectOperations.isCopyOperationSupported(p)) {
-            throw new IllegalArgumentException("Attempt to copy project that 
does not support copy.");
-        }
-        
-        DefaultProjectOperationsImplementation.copyProject(p);
-    }
-    
-    /**Perform default move operation. Gathers all necessary data, shows a 
confirmation
-     * dialog and moves the project (if confirmed by the user).
-     *
-     * @since 1.10
-     *
-     * @param p project to move
-     * @throws IllegalArgumentException if
-     * <code>p == null</code> or
-     * {@link ProjectOperations#isMoveOperationSupported}
-     * returns false for this project.
-     */
-    public static void performDefaultMoveOperation(Project p) throws 
IllegalArgumentException {
-        if (p == null) {
-            throw new IllegalArgumentException("Project is null");
-        }
-        
-        if (!ProjectOperations.isMoveOperationSupported(p)) {
-            throw new IllegalArgumentException("Attempt to move project that 
does not support move.");
-        }
-        
-        DefaultProjectOperationsImplementation.moveProject(p);
-    }
-    
-    /**Perform default rename operation. Gathers all necessary data, shows a 
confirmation
-     * dialog and renames the project (if confirmed by the user).
-     *
-     * @since 1.10
-     *
-     * @param p project to move
-     * @param newName new project's name or null
-     * @throws IllegalArgumentException if
-     * <code>p == null</code> or
-     * {@link ProjectOperations#isMoveOperationSupported}
-     * returns false for this project.
-     */
-    public static void performDefaultRenameOperation(Project p, String 
newName) throws IllegalArgumentException {
-        if (p == null) {
-            throw new IllegalArgumentException("Project is null");
-        }
-        
-        if (!ProjectOperations.isMoveOperationSupported(p)) {
-            throw new IllegalArgumentException("Attempt to rename project 
that does not support move.");
-        }
-        
-        DefaultProjectOperationsImplementation.renameProject(p, newName);
+        DefaultSuiteProjectOperationsImplementation.deleteProject(p);
     }
     
 }
diff --git 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectOperationsImplementation.java
 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperationsImplementation.java
copy from 
projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectOperationsImplementation.java
copy to 
apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperationsImplementation.java
--- 
a/projectuiapi/src/org/netbeans/modules/project/uiapi/DefaultProjectOperationsImplementation.java
+++ 
b/apisupport.ant/src/org/netbeans/modules/apisupport/project/ui/wizard/DefaultSuiteProjectOperationsImplementation.java
@@ -42,7 +42,7 @@
  * made subject to such option by the copyright holder.
  */
 
-package org.netbeans.modules.project.uiapi;
+package org.netbeans.modules.apisupport.project.ui.wizard;
 
 import java.awt.Component;
 import java.awt.Dialog;
@@ -55,8 +55,12 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -72,24 +76,20 @@
 import org.netbeans.api.annotations.common.NullAllowed;
 import org.netbeans.api.progress.ProgressHandle;
 import org.netbeans.api.progress.ProgressHandleFactory;
-import org.netbeans.api.project.FileOwnerQuery;
 import org.netbeans.api.project.Project;
-import org.netbeans.api.project.ProjectManager;
 import org.netbeans.api.project.ProjectUtils;
 import org.netbeans.api.project.ui.OpenProjects;
-import org.netbeans.api.queries.SharabilityQuery;
-import org.netbeans.spi.project.MoveOperationImplementation;
+import org.netbeans.modules.apisupport.project.NbModuleProject;
 import org.netbeans.spi.project.support.ProjectOperations;
-import org.netbeans.api.queries.VisibilityQuery;
-import org.netbeans.spi.project.MoveOrRenameOperationImplementation;
+import org.netbeans.modules.apisupport.project.suite.SuiteProject;
+import org.netbeans.spi.project.DataFilesProviderImplementation;
+import org.netbeans.spi.project.SubprojectProvider;
 import org.openide.DialogDescriptor;
 import org.openide.DialogDisplayer;
 import org.openide.LifecycleManager;
 import org.openide.NotifyDescriptor;
 import org.openide.awt.Mnemonics;
-import org.openide.filesystems.FileLock;
 import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileSystem;
 import org.openide.filesystems.FileUtil;
 import org.openide.util.Exceptions;
 import org.openide.util.NbBundle;
@@ -98,17 +98,15 @@
 /**
  * @author Jan Lahoda
  */
-public final class DefaultProjectOperationsImplementation {
+public final class DefaultSuiteProjectOperationsImplementation {
     
-    private static final Logger LOG = 
Logger.getLogger(DefaultProjectOperationsImplementation.class.getName());
+    private static final Logger LOG = 
Logger.getLogger(DefaultSuiteProjectOperationsImplementation.class.getName());
     
     //fractions how many time will be spent in some phases of the move and 
copy operation
     //the rename and delete operation use a different approach:
-    private static final double NOTIFY_WORK = 0.1;
-    private static final double FIND_PROJECT_WORK = 0.1;
     static final int    MAX_WORK = 100;
     
-    private DefaultProjectOperationsImplementation() {
+    private DefaultSuiteProjectOperationsImplementation() {
     }
     
     private static String getDisplayName(Project project) {
@@ -119,20 +117,47 @@
     /**
      * @return true if success
      */
-    private static void performDelete(Project project, List<FileObject> 
toDelete, ProgressHandle handle) throws Exception {
+    private static void performDelete(Project project, List<FileObject> 
toDelete, Map<NbModuleProject,List<FileObject>> subModulesFilesToDelete 
,ProgressHandle handle) throws Exception {
         try {
-            handle.start(toDelete.size() + 1 /*clean*/);
+            int toDeleteSubModulesSize = 0;
+            if(subModulesFilesToDelete != null) {
+                for(Map.Entry<NbModuleProject, List<FileObject>> 
entryIter:subModulesFilesToDelete.entrySet()) {
+                    toDeleteSubModulesSize += entryIter.getValue().size() + 
1;
+                }
+            }
+            handle.start(toDelete.size() + toDeleteSubModulesSize + 1 
/*clean*/);
             
             int done = 0;
             
-            
handle.progress(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Progress_Cleaning_Project"));
+            done = performDeleteOnProject(project, toDelete, handle, done);
+            
+            if(subModulesFilesToDelete != null) {
+                for(Map.Entry<NbModuleProject, List<FileObject>> 
entryIter:subModulesFilesToDelete.entrySet()) {
+                    done = performDeleteOnProject(entryIter.getKey(), 
entryIter.getValue(), handle, done);
+                }
+            }
+            
+            handle.finish();
+            
+        } catch (Exception e) {
+            String displayName = getDisplayName(project);
+            String message     = 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"LBL_Project_cannot_be_deleted", displayName);
+
+            Exceptions.attachLocalizedMessage(e, message);
+            throw e;
+        }
+    }
+    
+    private static int performDeleteOnProject(Project project, 
List<FileObject> toDelete ,ProgressHandle handle, int done) throws 
IOException {
+        
+            
handle.progress(NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class,
 "LBL_Progress_Cleaning_Project"));
             
             ProjectOperations.notifyDeleting(project);
             
             handle.progress(++done);
             
             for (FileObject f : toDelete) {
-                
handle.progress(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Progress_Deleting_File", FileUtil.getFileDisplayName(f)));
+                
handle.progress(NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class,
 "LBL_Progress_Deleting_File", FileUtil.getFileDisplayName(f)));
                 
                 if (f != null && f.isValid()) {
                     f.delete();
@@ -151,24 +176,15 @@
             } else {
                 LOG.log(Level.WARNING, "project folder {0} was not empty: 
{1}", new Object[] {projectFolder, 
Arrays.asList(projectFolder.getChildren())});
             }
-            
-            handle.finish();
-            
             ProjectOperations.notifyDeleted(project);
-        } catch (Exception e) {
-            String displayName = getDisplayName(project);
-            String message     = 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Project_cannot_be_deleted.", displayName);
-
-            Exceptions.attachLocalizedMessage(e, message);
-            throw e;
-        }
+            return done;
     }
     
-    public static void deleteProject(final Project project) {
+    public static void deleteProject(final SuiteProject project) {
         deleteProject(project, new GUIUserInputHandler());
     }
     
-    static void deleteProject(final Project project, UserInputHandler 
handler) {
+    static void deleteProject(final SuiteProject project, UserInputHandler 
handler) {
         String displayName = getDisplayName(project);
         FileObject projectFolder = project.getProjectDirectory();
         
@@ -192,26 +208,124 @@
             }
         }
         
-        final ProgressHandle handle = 
ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Delete_Project_Caption"));
-        final DefaultProjectDeletePanel deletePanel = new 
DefaultProjectDeletePanel(handle, displayName, 
FileUtil.getFileDisplayName(projectFolder), !dataFiles.isEmpty());
         
-        String caption = 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Delete_Project_Caption");
+        final SubprojectProvider suiteProvider = 
project.getLookup().lookup(SubprojectProvider.class);
+        final Set<Project> subProjects = (Set<Project>) 
suiteProvider.getSubprojects();
+        final Set<NbModuleProject> subModules = new 
HashSet<NbModuleProject>();
+        for(Project prjIter:subProjects) {
+            NbModuleProject nbModulePrj = 
prjIter.getLookup().lookup(NbModuleProject.class);
+            if(nbModulePrj != null) {
+                subModules.add(nbModulePrj);
+            }
+        }
+        final Map<NbModuleProject,List<FileObject>> subModulesDataFiles = 
getSubModulesDataFiles(subModules);
+        
+        
+        final ProgressHandle handle = 
ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class,
 "LBL_Delete_Project_Caption"));
+        final DefaultSuiteProjectDeletePanel deletePanel = new 
DefaultSuiteProjectDeletePanel(handle, displayName, 
FileUtil.getFileDisplayName(projectFolder), !subModulesDataFiles.isEmpty(), 
!subModules.isEmpty());
+        
+        String caption = 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"LBL_Delete_Project_Caption");
         
         handler.showConfirmationDialog(deletePanel, project, caption, 
"Yes_Button", "No_Button", true, new Executor() { // NOI18N
             public @Override void execute() throws Exception {
+                
                 close(project);
                 
+                Map<NbModuleProject,List<FileObject>> subModulesAllFiles = 
null;
+                Map<NbModuleProject,List<FileObject>> 
subModulesMetadataFiles = null;
+                
+                if(deletePanel.isDeleteModules()) {
+                    for(NbModuleProject modulePrjIter:subModules) {
+                        close(modulePrjIter);
+                    }
+                    subModulesAllFiles = new HashMap<NbModuleProject, 
List<FileObject>>();
+                    subModulesAllFiles.putAll(subModulesDataFiles);
+                    subModulesMetadataFiles = 
getSubModulesMetadataFiles(subModules, subModulesAllFiles);
+                } 
+                
                 if (deletePanel.isDeleteSources()) {
-                    performDelete(project, allFiles, handle);
+                    performDelete(project, allFiles, subModulesAllFiles, 
handle);
                 } else {
-                    performDelete(project, metadataFiles, handle);
+                    performDelete(project, metadataFiles, 
subModulesMetadataFiles, handle);
                 }
+                
             }
         });
         
         LOG.log(Level.FINE, "delete done: {0}", displayName);
     }
     
+    /**Return list of files that are considered metadata files and folders 
for the all submodules of given project.
+     * Returns meaningful values only if some of the 
<code>is*Supported</code> methods
+     * return <code>true</code>.
+     *
+     * @param subModules submodules of project to test
+     * @return list of metadata files/folders
+     * @see DataFilesProviderImplementation#getMetadataFiles
+     */
+    private static Map<NbModuleProject,List<FileObject>> 
getSubModulesMetadataFiles(Set<NbModuleProject> subModules, 
Map<NbModuleProject,List<FileObject>> subModulesAllFiles) {
+        Map<NbModuleProject,List<FileObject>> result = new 
HashMap<NbModuleProject, List<FileObject>>();
+        List<FileObject> files;
+        
+        for(NbModuleProject modulePrjIter:subModules){
+            files = new ArrayList<FileObject>();
+            for (DataFilesProviderImplementation i : 
modulePrjIter.getLookup().lookupAll(DataFilesProviderImplementation.class)) {
+                files.addAll(i.getMetadataFiles());
+                assert !files.contains(null) : "Nulls in " + result + " from 
" + i;
+            }
+            FileObject subModuleProjectFolder = 
modulePrjIter.getProjectDirectory();
+            for (Iterator<FileObject> i = files.iterator(); i.hasNext(); ) {
+                FileObject f = i.next();
+                if (!FileUtil.isParentOf(subModuleProjectFolder, f)) {
+                    if (subModuleProjectFolder.equals(f)) {
+                        // sources == project directory
+                        continue;
+                    }
+                    i.remove();
+                }
+            }
+            result.put(modulePrjIter, files);
+            subModulesAllFiles.get(modulePrjIter).addAll(files);
+        }
+        
+        return result;
+    } 
+    
+    /**Return list of files that are considered source files and folders for 
the all submodules of given project.
+     * Returns meaningful values only if some of the 
<code>is*Supported</code> methods
+     * return <code>true</code>.
+     *
+     * @param subModules submodules of project to test
+     * @return list of data files/folders
+     * @see DataFilesProviderImplementation#getDataFiles
+     */
+    private static Map<NbModuleProject,List<FileObject>> 
getSubModulesDataFiles(Set<NbModuleProject> subModules) {
+        Map<NbModuleProject,List<FileObject>> result = new 
HashMap<NbModuleProject, List<FileObject>>();
+        List<FileObject> files;
+        
+        for(NbModuleProject modulePrjIter:subModules){
+            files = new ArrayList<FileObject>();
+            for (DataFilesProviderImplementation i : 
modulePrjIter.getLookup().lookupAll(DataFilesProviderImplementation.class)) {
+                files.addAll(i.getDataFiles());
+                assert !files.contains(null) : "Nulls in " + result + " from 
" + i;
+            }
+            FileObject subModuleProjectFolder = 
modulePrjIter.getProjectDirectory();
+            for (Iterator<FileObject> i = files.iterator(); i.hasNext(); ) {
+                FileObject f = i.next();
+                if (!FileUtil.isParentOf(subModuleProjectFolder, f)) {
+                    if (subModuleProjectFolder.equals(f)) {
+                        // sources == project directory
+                        continue;
+                    }
+                    i.remove();
+                }
+            }
+            result.put(modulePrjIter, files);
+        }
+        
+        return result;
+    }
+    
     static interface UserInputHandler {
         void showConfirmationDialog(final JComponent panel, Project project, 
String caption, String confirmButton, String cancelButton, boolean 
doSetMessageType, final Executor executor);
     }
@@ -219,369 +333,12 @@
     private static final class GUIUserInputHandler implements 
UserInputHandler {
         
         public @Override void showConfirmationDialog(final JComponent panel, 
Project project, String caption, String confirmButton, String cancelButton, 
boolean doSetMessageType, final Executor executor) {
-            
DefaultProjectOperationsImplementation.showConfirmationDialog(panel, project, 
caption, confirmButton, cancelButton, doSetMessageType, executor);
+            
DefaultSuiteProjectOperationsImplementation.showConfirmationDialog(panel, 
project, caption, confirmButton, cancelButton, doSetMessageType, executor);
         }
         
     }
     //</editor-fold>
     
-    //<editor-fold defaultstate="collapsed" desc="Copy Operation">
-    public static void copyProject(final Project project) {
-        final ProgressHandle handle = 
ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Copy_Project_Handle"));
-        final ProjectCopyPanel panel = new ProjectCopyPanel(handle, project, 
false);
-        //#76559
-        handle.start(MAX_WORK);
-        
-        showConfirmationDialog(panel, project, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Copy_Project_Caption"), "Copy_Button", null, false, new Executor() { // 
NOI18N
-            public @Override void execute() throws Exception {
-                final String nueName = panel.getNewName();
-                File newTarget = 
FileUtil.normalizeFile(panel.getNewDirectory());
-                
-                FileObject newTargetFO = FileUtil.toFileObject(newTarget);
-                if (newTargetFO == null) {
-                    newTargetFO = createFolder(newTarget.getParentFile(), 
newTarget.getName());
-                }
-                final FileObject newTgtFO = newTargetFO;
-                
project.getProjectDirectory().getFileSystem().runAtomicAction(new 
FileSystem.AtomicAction() {
-                    public @Override void run() throws IOException {
-                        try {
-                            doCopyProject(handle, project, nueName, 
newTgtFO);
-                        } catch (IOException x) {
-                            throw x;
-                        } catch (Exception x) {
-                            throw new IOException(x);
-                        }
-                    }
-                });
-            }
-        });
-    }
-    
-    /*package private for tests*/ static void doCopyProject(ProgressHandle 
handle, Project project, String nueName, FileObject newTarget) throws 
Exception {
-        try {
-            int totalWork = MAX_WORK;
-            
-            
-            double currentWorkDone = 0;
-            
-            handle.progress((int) currentWorkDone);
-            
-            ProjectOperations.notifyCopying(project);
-            
-            handle.progress((int) (currentWorkDone = totalWork * 
NOTIFY_WORK));
-            
-            FileObject target = newTarget.createFolder(nueName);
-            FileObject projectDirectory = project.getProjectDirectory();
-            List<FileObject> toCopyList = new ArrayList<FileObject>();
-            for (FileObject child : projectDirectory.getChildren()) {
-                if (child.isValid()) {
-                    toCopyList.add(child);
-                }
-            }
-            
-            double workPerFileAndOperation = totalWork * (1.0 - 2 * 
NOTIFY_WORK - FIND_PROJECT_WORK) / toCopyList.size();
-
-            for (FileObject toCopy : toCopyList) {
-                doCopy(project, toCopy, target);
-                
-                int lastWorkDone = (int) currentWorkDone;
-                
-                currentWorkDone += workPerFileAndOperation;
-                
-                if (lastWorkDone < (int) currentWorkDone) {
-                    handle.progress((int) currentWorkDone);
-                }
-            }
-            
-            //#64264: the non-project cache can be filled with incorrect 
data (gathered during the project copy phase), clear it:
-            ProjectManager.getDefault().clearNonProjectCache();
-            Project nue = ProjectManager.getDefault().findProject(target);
-            
-            assert nue != null;
-            
-            handle.progress((int) (currentWorkDone += totalWork * 
FIND_PROJECT_WORK));
-            
-            ProjectOperations.notifyCopied(project, nue, 
FileUtil.toFile(project.getProjectDirectory()), nueName);
-            
-            handle.progress((int) (currentWorkDone += totalWork * 
NOTIFY_WORK));
-            
-            ProjectManager.getDefault().saveProject(nue);
-            
-            open(nue, false);
-            
-            handle.progress(totalWork);
-            handle.finish();
-        } catch (Exception e) {
-            Exceptions.attachLocalizedMessage(e, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Cannot_Move", e.getLocalizedMessage()));
-            throw e;
-        }
-    }
-    //</editor-fold>
-    
-    //<editor-fold defaultstate="collapsed" desc="Move Operation">
-    public static void moveProject(final Project project) {
-        final ProgressHandle handle = 
ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Move_Project_Handle"));
-        final ProjectCopyPanel panel = new ProjectCopyPanel(handle, project, 
true);
-        //#76559
-        handle.start(MAX_WORK);
-        
-        showConfirmationDialog(panel, project, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Move_Project_Caption"), "Move_Button", null, false, new Executor() { // 
NOI18N
-            public @Override void execute() throws Exception {
-                final String nueFolderName = panel.getProjectFolderName();
-                final String nueProjectName = panel.getNewName();
-                File newTarget = 
FileUtil.normalizeFile(panel.getNewDirectory());
-                
-                FileObject newTargetFO = FileUtil.toFileObject(newTarget);
-                if (newTargetFO == null) {
-                    newTargetFO = createFolder(newTarget.getParentFile(), 
newTarget.getName());
-                }
-                final FileObject newTgtFO = newTargetFO;
-                doMoveProject(handle, project, nueFolderName, 
nueProjectName, newTgtFO, "ERR_Cannot_Move");
-            }
-        });
-    }
-    
-    public static void renameProject(Project project) {
-        renameProject(project, null);
-    }
-    
-    public static void renameProject(final Project project, final String 
nueName) {
-        final ProgressHandle handle = 
ProgressHandleFactory.createHandle(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "LBL_Rename_Project_Handle"));
-        final DefaultProjectRenamePanel panel = new 
DefaultProjectRenamePanel(handle, project, nueName);
-
-        //#76559
-        handle.start(MAX_WORK);
-        
-        showConfirmationDialog(panel, project, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Rename_Project_Caption"), "Rename_Button", null, false, new Executor() { 
// NOI18N
-            public @Override void execute() throws Exception {
-                final String nueName = panel.getNewName();
-                
-                if (panel.getRenameProjectFolder()) {
-                    doMoveProject(handle, project, nueName, nueName, 
project.getProjectDirectory().getParent(), "ERR_Cannot_Rename");
-                } else {
-                    
project.getProjectDirectory().getFileSystem().runAtomicAction(new 
FileSystem.AtomicAction() {
-                        public @Override void run() throws IOException {
-                            try {
-                                doRenameProject(handle, project, nueName);
-                            } catch (IOException x) {
-                                throw x;
-                            } catch (Exception x) {
-                                throw new IOException(x);
-                            }
-                        }
-                    });
-               }
-            }
-        });
-    }
-
-    private static void doRenameProject(ProgressHandle handle, Project 
project, String nueName) throws Exception {
-        Collection<? extends MoveOperationImplementation> operations = 
project.getLookup().lookupAll(MoveOperationImplementation.class);
-        for (MoveOperationImplementation o : operations) {
-            if (!(o instanceof MoveOrRenameOperationImplementation)) {
-                
Logger.getLogger(DefaultProjectOperationsImplementation.class.getName()).log(Level.WARNING,
-                        "{0} should implement 
MoveOrRenameOperationImplementation", o.getClass().getName());
-                doRenameProjectOld(handle, project, nueName, operations);
-                return;
-            }
-        }
-        // Better new style.
-        try {
-            handle.switchToDeterminate(4);
-            int currentWorkDone = 0;
-            handle.progress(++currentWorkDone);
-            for (MoveOperationImplementation o : operations) {
-                ((MoveOrRenameOperationImplementation) o).notifyRenaming();
-            }
-            handle.progress(++currentWorkDone);
-            for (MoveOperationImplementation o : operations) {
-                ((MoveOrRenameOperationImplementation) 
o).notifyRenamed(nueName);
-            }
-            handle.progress(++currentWorkDone);
-            ProjectManager.getDefault().saveProject(project);
-            handle.progress(++currentWorkDone);
-            handle.finish();
-        } catch (Exception e) {
-            Exceptions.attachLocalizedMessage(e, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Cannot_Rename", e.getLocalizedMessage()));
-            throw e;
-        }
-    }
-
-    private static void doRenameProjectOld(ProgressHandle handle, Project 
project, String nueName,
-            Collection<? extends MoveOperationImplementation> operations) 
throws Exception {
-        boolean originalOK = true;
-        Project main = OpenProjects.getDefault().getMainProject();
-        boolean wasMain = main != null && 
project.getProjectDirectory().equals(main.getProjectDirectory());
-        Project nue = null;
-        try {
-            handle.switchToIndeterminate();
-            handle.switchToDeterminate(5);
-            int currentWorkDone = 0;
-            FileObject projectDirectory = project.getProjectDirectory();
-            File projectDirectoryFile = 
FileUtil.toFile(project.getProjectDirectory());
-            close(project);
-            handle.progress(++currentWorkDone);
-            for (MoveOperationImplementation o : operations) {
-                o.notifyMoving();
-            }
-            handle.progress(++currentWorkDone);
-            for (MoveOperationImplementation o : operations) {
-                o.notifyMoved(null, projectDirectoryFile, nueName);
-            }
-            handle.progress(++currentWorkDone);
-            //#64264: the non-project cache can be filled with incorrect 
data (gathered during the project copy phase), clear it:
-            ProjectManager.getDefault().clearNonProjectCache();
-            nue = ProjectManager.getDefault().findProject(projectDirectory);
-            assert nue != null;
-            originalOK = false;
-            handle.progress(++currentWorkDone);
-            operations = 
nue.getLookup().lookupAll(MoveOperationImplementation.class);
-            for (MoveOperationImplementation o : operations) {
-                o.notifyMoved(project, projectDirectoryFile, nueName);
-            }
-            ProjectManager.getDefault().saveProject(project);
-            ProjectManager.getDefault().saveProject(nue);
-            open(nue, wasMain);
-            handle.progress(++currentWorkDone);
-            handle.finish();
-        } catch (Exception e) {
-            if (originalOK) {
-                open(project, wasMain);
-            } else {
-                assert nue != null;
-                open(nue, wasMain);
-            }
-            Exceptions.attachLocalizedMessage(e, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Cannot_Rename", e.getLocalizedMessage()));
-            throw e;
-        }
-    }
-
-    /*package private for tests*/ static void doMoveProject(ProgressHandle 
handle, Project project, String nueFolderName, String nueProjectName, 
FileObject newTarget, String errorKey) throws Exception {
-        boolean originalOK = true;
-        Project main    = OpenProjects.getDefault().getMainProject();
-        boolean wasMain = main != null && 
project.getProjectDirectory().equals(main.getProjectDirectory());
-       FileObject target = null;
-        
-        try {
-            
-            int totalWork = MAX_WORK;
-            double currentWorkDone = 0;
-            
-            handle.progress((int) currentWorkDone);
-            
-            ProjectOperations.notifyMoving(project);
-            
-            close(project);
-            
-            handle.progress((int) (currentWorkDone = totalWork * 
NOTIFY_WORK));
-            
-            FileObject projectDirectory = project.getProjectDirectory();
-            LOG.log(Level.FINE, "doMoveProject 1/2: {0} @{1}", new Object[] 
{projectDirectory, project.hashCode()});
-            if (LOG.isLoggable(Level.FINER)) {
-                for (Project real : 
OpenProjects.getDefault().getOpenProjects()) {
-                    LOG.log(Level.FINER, "  open project: {0} @{1}", new 
Object[] {real, real.hashCode()});
-                }
-            }
-            
-            double workPerFileAndOperation = totalWork * (1.0 - 2 * 
NOTIFY_WORK - FIND_PROJECT_WORK);
-
-            FileLock lock = projectDirectory.lock();
-            try {
-                target = projectDirectory.move(lock, newTarget, 
nueFolderName, null);
-            } finally {
-                lock.releaseLock();
-            }
-            // TBD if #109580 matters here: do we need to delete 
nbproject/private? probably not
-            int lastWorkDone = (int) currentWorkDone;
-
-            currentWorkDone += workPerFileAndOperation;
-
-            if (lastWorkDone < (int) currentWorkDone) {
-                handle.progress((int) currentWorkDone);
-            }
-            
-            originalOK = false;
-            
-            //#64264: the non-project cache can be filled with incorrect 
data (gathered during the project copy phase), clear it:
-            ProjectManager.getDefault().clearNonProjectCache();
-            Project nue = ProjectManager.getDefault().findProject(target);
-            
-            handle.progress((int) (currentWorkDone += totalWork * 
FIND_PROJECT_WORK));
-            
-            assert nue != null;
-            assert nue != project : "got same Project for " + 
projectDirectory + " and " + target;
-            LOG.log(Level.FINE, "doMoveProject 2/2: {0} @{1}", new Object[] 
{target, nue.hashCode()});
-
-            ProjectOperations.notifyMoved(project, nue, 
FileUtil.toFile(project.getProjectDirectory()), nueProjectName);
-            
-            handle.progress((int) (currentWorkDone += totalWork * 
NOTIFY_WORK));
-            
-            ProjectManager.getDefault().saveProject(nue);
-            
-            open(nue, wasMain);
-            if (LOG.isLoggable(Level.FINER)) {
-                for (Project real : 
OpenProjects.getDefault().getOpenProjects()) {
-                    LOG.log(Level.FINER, "  open project: {0} @{1}", new 
Object[] {real, real.hashCode()});
-                }
-            }
-            
-            handle.progress(totalWork);
-            handle.finish();
-        } catch (Exception e) {
-            if (originalOK) {
-                open(project, wasMain);
-            } else {
-               assert target != null;
-               
-               //#64264: the non-project cache can be filled with incorrect 
data (gathered during the project copy phase), clear it:
-               ProjectManager.getDefault().clearNonProjectCache();
-               Project nue = ProjectManager.getDefault().findProject(target);
-               if (nue != null) {
-            open(nue, wasMain);
-        }
-            }
-            Exceptions.attachLocalizedMessage(e, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, errorKey, 
e.getLocalizedMessage()));
-            throw e;
-        }
-    }
-    //</editor-fold>
-    
-    //<editor-fold defaultstate="collapsed" desc="Copy Move Utilities">
-    private static void doCopy(Project original, FileObject from, FileObject 
toParent) throws IOException {
-        if (!VisibilityQuery.getDefault().isVisible(from)) {
-            //Do not copy invisible files/folders.
-            return ;
-        }
-        
-        if 
(!original.getProjectDirectory().equals(FileOwnerQuery.getOwner(from).getProjectDirectory()))
 {
-            return ;
-        }
-        
-        //#109580
-        if (SharabilityQuery.getSharability(from) == 
SharabilityQuery.Sharability.NOT_SHARABLE) {
-            return;
-        }
-        
-        if (from.isFolder()) {
-            FileObject copy = toParent.createFolder(from.getNameExt());
-            for (FileObject kid : from.getChildren()) {
-                doCopy(original, kid, copy);
-            }
-        } else {
-            assert from.isData();
-            FileObject target = FileUtil.copyFile(from, toParent, 
from.getName(), from.getExt());
-        }
-    }
-    
-    private static FileObject createFolder(File parent, String name) throws 
IOException {
-        FileObject path = FileUtil.toFileObject(parent);
-        if (path != null) {
-            return path.createFolder(name);
-        } else {
-            return createFolder(parent.getParentFile(), 
parent.getName()).createFolder(name);
-        }
-    }
-    
     private static JComponent wrapPanel(JComponent component) {
         component.setBorder(new EmptyBorder(12, 12, 12, 12));
         
@@ -590,15 +347,15 @@
     
     private static void showConfirmationDialog(final JComponent panel, 
Project project, String caption, String confirmButton, String cancelButton, 
boolean doSetMessageType, final Executor executor) {
         final JButton confirm = new JButton();
-        Mnemonics.setLocalizedText(confirm, 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, "LBL_" + 
confirmButton));
+        Mnemonics.setLocalizedText(confirm, 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, "LBL_" 
+ confirmButton));
         final JButton cancel  = new JButton(cancelButton == null ?
-              
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"LBL_Cancel_Button")
-            : 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, "LBL_" + 
cancelButton));
+              
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"LBL_Cancel_Button")
+            : 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, "LBL_" 
+ cancelButton));
         
-        
confirm.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DefaultProjectOperationsImplementation.class,
 "ACSD_" + confirmButton));
+        
confirm.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class,
 "ACSD_" + confirmButton));
         cancel.getAccessibleContext().setAccessibleDescription(cancelButton 
== null ?
-              
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ACSD_Cancel_Button")
-            : 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, "ACSD_" + 
cancelButton));
+              
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ACSD_Cancel_Button")
+            : 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ACSD_" + cancelButton));
         
         assert panel instanceof InvalidablePanel;
         
@@ -690,10 +447,10 @@
     
     static @CheckForNull String computeError(@NullAllowed File location, 
String projectNameText, String projectFolderText, boolean pureRename) {
         if (projectNameText.length() == 0) {
-            return 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Project_Name_Must_Entered");
+            return 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ERR_Project_Name_Must_Entered");
         }
         if (projectNameText.indexOf('/') != -1 || 
projectNameText.indexOf('\\') != -1) {
-            return 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Not_Valid_Filename", projectNameText);
+            return 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ERR_Not_Valid_Filename", projectNameText);
         }
 
         if (location == null) {
@@ -708,12 +465,12 @@
                 parent = parent.getParentFile();
             }
             if (parent == null) {
-                return 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Location_Does_Not_Exist");
+                return 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ERR_Location_Does_Not_Exist");
             }
         }
         
         if (!parent.canWrite()) {
-            return 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Location_Read_Only");
+            return 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ERR_Location_Read_Only");
         }
         
         File projectFolderFile = null;
@@ -724,7 +481,7 @@
         }
         
         if (projectFolderFile.exists() && !pureRename) {
-            return 
NbBundle.getMessage(DefaultProjectOperationsImplementation.class, 
"ERR_Project_Folder_Exists");
+            return 
NbBundle.getMessage(DefaultSuiteProjectOperationsImplementation.class, 
"ERR_Project_Folder_Exists");
         }
         
         return null;
@@ -735,13 +492,6 @@
         OpenProjects.getDefault().close(new Project[] {prj});
     }
     
-    private static void open(final Project prj, final boolean setAsMain) {
-        OpenProjects.getDefault().open(new Project[] {prj}, false);
-        if (setAsMain) {
-            OpenProjects.getDefault().setMainProject(prj);
-        }
-    }
-    
     static interface Executor {
         public void execute() throws Exception;
     }

[hg] main-silver: #72879: Deleting suite with its modules in one...

Martin Kozeny 04/02/2013

<Possible follow-up(s)>

[hg] main-silver: #72879: Deleting suite with its modules in one...

Martin Kozeny 04/02/2013

Project Features

About this Project

APIsupport was started in November 2009, is owned by Antonin Nebuzelsky, and has 43 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close