Index: java/j2seproject/nbproject/project.xml
===================================================================
RCS file: /cvs/java/j2seproject/nbproject/project.xml,v
retrieving revision 1.16
diff -u -r1.16 project.xml
--- java/j2seproject/nbproject/project.xml 28 Apr 2005 04:48:16 -0000 1.16
+++ java/j2seproject/nbproject/project.xml 20 May 2005 14:18:41 -0000
@@ -173,6 +173,14 @@
1.2
+
+ org.netbeans.api.progress
+
+
+
+ 1
+
+
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/Bundle.properties
===================================================================
RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/Bundle.properties,v
retrieving revision 1.20
diff -u -r1.20 Bundle.properties
--- java/j2seproject/src/org/netbeans/modules/java/j2seproject/Bundle.properties 3 Mar 2005 10:20:54 -0000 1.20
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/Bundle.properties 20 May 2005 14:18:41 -0000
@@ -49,3 +49,23 @@
TXT_ProjectUpdateTitle=Change Project Properties
CTL_UpdateOption=Upgrade Project
AD_UpdateOption=N/A
+
+LBL_Progress_Cleaning_Project=Cleaning Project
+
+LBL_Project_cannot_be_deleted.=Project {0} cannot be deleted.
+
+LBL_Delete_Project_Caption=Delete Project
+
+LBL_Project_Deletion_in_Progress_Caption=Project Deletion in Progress
+
+LBL_Project_Deleted_Caption=Project {0} has been successfully deleted.
+
+LBL_Deleting_Project=Deleting Project\:
+
+LBL_Progress_Deleting_File=Deleting {0}
+
+LBL_Pre_Delete_Warning=Are you sure you want to delete project {0}.
+
+LBL_Delete_Also_Sources=Delete Also Project Sources
+
+LBL_File_To_Delete=Files to Delete\:
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java
===================================================================
RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java,v
retrieving revision 1.42
diff -u -r1.42 J2SEActionProvider.java
--- java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java 7 Apr 2005 11:16:36 -0000 1.42
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java 20 May 2005 14:18:43 -0000
@@ -80,6 +80,7 @@
COMMAND_DEBUG_TEST_SINGLE,
JavaProjectConstants.COMMAND_DEBUG_FIX,
COMMAND_DEBUG_STEP_INTO,
+ COMMAND_DELETE,
};
// Project
@@ -124,6 +125,11 @@
}
public void invokeAction( String command, Lookup context ) throws IllegalArgumentException {
+ if (COMMAND_DELETE.equals(command)) {
+ J2SEProjectOperation.deleteProject(project);
+ return ;
+ }
+
Properties p = new Properties();
String[] targetNames;
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProject.java
===================================================================
RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProject.java,v
retrieving revision 1.52
diff -u -r1.52 J2SEProject.java
--- java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProject.java 23 Mar 2005 16:17:34 -0000 1.52
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProject.java 20 May 2005 14:18:43 -0000
@@ -17,6 +17,7 @@
import java.beans.PropertyChangeSupport;
import java.io.File;
import java.io.IOException;
+import java.net.URI;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.netbeans.api.java.classpath.ClassPath;
@@ -121,6 +122,14 @@
public Lookup getLookup() {
return lookup;
+ }
+
+ UpdateHelper getProjectHelper() {
+ return updateHelper;//helper;
+ }
+
+ public AntProjectHelper getAntProjectHelper() {
+ return helper;
}
private Lookup createLookup(AuxiliaryConfiguration aux) {
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.form
===================================================================
RCS file: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.form
diff -N java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.form
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.form 20 May 2005 14:18:43 -0000
@@ -0,0 +1,79 @@
+
+
+
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.java
===================================================================
RCS file: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.java
diff -N java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectDeletePanel.java 20 May 2005 14:18:43 -0000
@@ -0,0 +1,165 @@
+/*
+ * Sun Public License Notice
+ *
+ * The contents of this file are subject to the Sun Public License
+ * Version 1.0 (the "License"). You may not use this file except in
+ * compliance with the License. A copy of the License is available at
+ * http://www.sun.com/
+ *
+ * The Original Code is NetBeans. The Initial Developer of the Original
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ */
+
+package org.netbeans.modules.java.j2seproject;
+
+import java.awt.Component;
+import java.awt.Window;
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.List;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.NbBundle;
+
+/**
+ *
+ * @author Jan Lahoda
+ */
+final class J2SEProjectDeletePanel extends javax.swing.JPanel {
+
+ private String projectDisplaName;
+ private List/**/ metadataFileNames;
+ private List/**/ allFileNames;
+
+ /** Creates new form J2SEProjectDeletePanel */
+ public J2SEProjectDeletePanel(String projectDisplaName, List/**/ metadataFileNames, List/**/ allFileNames) {
+ this.projectDisplaName = projectDisplaName;
+ this.metadataFileNames = metadataFileNames;
+ this.allFileNames = allFileNames;
+ initComponents();
+ updateSourcesList();
+ }
+
+ /** This method is called from within the constructor to
+ * initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is
+ * always regenerated by the Form Editor.
+ */
+ // //GEN-BEGIN:initComponents
+ private void initComponents() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ warningText = new javax.swing.JTextArea();
+ deleteSourcesCheckBox = new javax.swing.JCheckBox();
+ jLabel1 = new javax.swing.JLabel();
+ deleteList = new javax.swing.JTextArea();
+
+ setLayout(new java.awt.GridBagLayout());
+
+ warningText.setEditable(false);
+ warningText.setFont(javax.swing.UIManager.getFont("Label.font"));
+ warningText.setText(getWarningText());
+ warningText.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));
+ warningText.setOpaque(false);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
+ add(warningText, gridBagConstraints);
+
+ deleteSourcesCheckBox.setText(org.openide.util.NbBundle.getBundle(J2SEProjectDeletePanel.class).getString("LBL_Delete_Also_Sources"));
+ deleteSourcesCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ deleteSourcesCheckBoxActionPerformed(evt);
+ }
+ });
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
+ add(deleteSourcesCheckBox, gridBagConstraints);
+
+ jLabel1.setText(org.openide.util.NbBundle.getBundle(J2SEProjectDeletePanel.class).getString("LBL_File_To_Delete"));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.insets = new java.awt.Insets(12, 12, 0, 12);
+ add(jLabel1, gridBagConstraints);
+
+ deleteList.setEditable(false);
+ deleteList.setFont(javax.swing.UIManager.getFont("Label.font"));
+ deleteList.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));
+ deleteList.setOpaque(false);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ gridBagConstraints.insets = new java.awt.Insets(12, 12, 12, 12);
+ add(deleteList, gridBagConstraints);
+
+ }
+ // //GEN-END:initComponents
+
+ private void deleteSourcesCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSourcesCheckBoxActionPerformed
+ updateSourcesList();
+ }//GEN-LAST:event_deleteSourcesCheckBoxActionPerformed
+
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JTextArea deleteList;
+ private javax.swing.JCheckBox deleteSourcesCheckBox;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JTextArea warningText;
+ // End of variables declaration//GEN-END:variables
+
+ public boolean isDeleteSources() {
+ return deleteSourcesCheckBox.isSelected();
+ }
+
+ private void updateSourcesList() {
+ boolean enabled = deleteSourcesCheckBox.isSelected();
+
+ if (enabled) {
+ deleteList.setText(getTextForFiles(allFileNames));
+ } else {
+ deleteList.setText(getTextForFiles(metadataFileNames));
+ }
+
+ Component c = this;
+
+ while (c != null && !(c instanceof Window)) {
+ c = c.getParent();
+ }
+
+ if (c != null) {
+ ((Window) c).pack();
+ }
+ }
+
+ private static String getTextForFiles(List/**/ files) {
+ StringBuffer result = new StringBuffer();
+
+ for (Iterator/**/ i = files.iterator(); i.hasNext(); ) {
+ String file = (String) i.next();
+
+ result.append(file);
+
+ if (i.hasNext()) {
+ result.append("\n"); // NOI18N
+ }
+ }
+
+ return result.toString();
+ }
+
+ private String getWarningText() {
+ return MessageFormat.format(NbBundle.getBundle(J2SEProjectDeletePanel.class).getString("LBL_Pre_Delete_Warning"), new Object[] {projectDisplaName});
+ }
+}
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectOperation.java
===================================================================
RCS file: java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectOperation.java
diff -N java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectOperation.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectOperation.java 20 May 2005 14:18:44 -0000
@@ -0,0 +1,334 @@
+/*
+ * Sun Public License Notice
+ *
+ * The contents of this file are subject to the Sun Public License
+ * Version 1.0 (the "License"). You may not use this file except in
+ * compliance with the License. A copy of the License is available at
+ * http://www.sun.com/
+ *
+ * The Original Code is NetBeans. The Initial Developer of the Original
+ * Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
+ * Microsystems, Inc. All Rights Reserved.
+ */
+
+package org.netbeans.modules.java.j2seproject;
+
+import java.awt.Dialog;
+import java.awt.GridBagConstraints;
+import java.awt.Insets;
+import java.io.IOException;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import org.apache.tools.ant.module.api.support.ActionUtils;
+import org.netbeans.api.progress.ProgressHandle;
+import org.netbeans.api.progress.ProgressHandleFactory;
+import org.netbeans.api.project.Project;
+import org.netbeans.api.project.ProjectInformation;
+import org.netbeans.api.project.ProjectUtils;
+import org.netbeans.api.project.ui.OpenProjects;
+import org.netbeans.spi.project.ActionProvider;
+import org.netbeans.spi.project.support.ant.GeneratedFilesHelper;
+import org.openide.DialogDescriptor;
+import org.openide.DialogDisplayer;
+import org.openide.ErrorManager;
+import org.openide.NotifyDescriptor;
+import org.openide.filesystems.FileObject;
+import org.openide.filesystems.FileUtil;
+import org.openide.util.HelpCtx;
+import org.openide.util.Lookup;
+import org.openide.util.RequestProcessor;
+import org.openide.util.lookup.Lookups;
+
+/**
+ *
+ * @author Jan Lahoda
+ */
+public class J2SEProjectOperation {
+
+ private static final ErrorManager ERR = ErrorManager.getDefault().getInstance("org.netbeans.modules.java.j2seproject.J2SEProjectOperation"); // NOI18N
+
+ /** Creates a new instance of J2SEProjectDelete */
+ public J2SEProjectOperation() {
+ }
+
+ private static String getDisplayName(J2SEProject project) {
+ return ProjectUtils.getInformation(project).getDisplayName();
+ }
+
+ //
+ private static void addFile(FileObject projectDirectory, String fileName, List/**/ result) {
+ FileObject file = projectDirectory.getFileObject(fileName);
+
+ if (file != null) {
+ result.add(file);
+ }
+ }
+
+ static List/**/ getMetadataFiles(J2SEProject project) {
+ FileObject projectDirectory = project.getProjectDirectory();
+ List/**/ files = new ArrayList();
+
+ addFile(projectDirectory, "nbproject", files); // NOI18N
+ addFile(projectDirectory, "build.xml", files); // NOI18N
+
+ return files;
+ }
+
+ static List/**/ getSourceDirectories(J2SEProject project) {
+ FileObject projectDirectory = project.getProjectDirectory();
+ List/**/ files = new ArrayList();
+
+ SourceRoots src = project.getSourceRoots();
+ FileObject[] srcRoots = src.getRoots();
+
+ for (int cntr = 0; cntr < srcRoots.length; cntr++) {
+ if (FileUtil.isParentOf(projectDirectory, srcRoots[cntr]))
+ files.add(srcRoots[cntr]);
+ }
+
+ SourceRoots test = project.getTestSourceRoots();
+ FileObject[] testRoots = test.getRoots();
+
+ for (int cntr = 0; cntr < testRoots.length; cntr++) {
+ if (FileUtil.isParentOf(projectDirectory, testRoots[cntr]))
+ files.add(testRoots[cntr]);
+ }
+
+ addFile(projectDirectory, "manifest.mf", files); // NOI18N
+
+ return files;
+ }
+
+ /**
+ * @return true if success
+ */
+ static boolean performDelete(J2SEProject project, List/*FileObject>*/ toDelete, ProgressHandle handle) {
+ try {
+ String progressFormat = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Progress_Deleting_File");
+
+ handle.start(toDelete.size() + 1 /*clean*/);
+
+ int done = 0;
+
+ handle.progress(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Progress_Cleaning_Project"));
+
+ performClean(project);
+
+ handle.progress(++done);
+
+ for (Iterator i = toDelete.iterator(); i.hasNext(); ) {
+ FileObject f = (FileObject) i.next();
+
+ handle.progress(MessageFormat.format(progressFormat, new Object[] {FileUtil.getFileDisplayName(f)}));
+
+ if (f != null)
+ f.delete();
+
+ handle.progress(++done);
+ }
+
+ FileObject projectFolder = project.getProjectDirectory();
+
+ if (projectFolder.getChildren().length == 0) {
+ //empty, delete:
+ projectFolder.delete();
+ }
+
+ handle.finish();
+
+ project.getAntProjectHelper().notifyDeleted();
+ return true;
+ } catch (IOException e) {
+ String displayName = getDisplayName(project);
+ String format = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Project_cannot_be_deleted.");
+
+ ErrorManager.getDefault().annotate(e, MessageFormat.format(format, new Object[] {displayName}));
+ ErrorManager.getDefault().notify(ErrorManager.USER, e);
+
+ return false;
+ }
+ }
+
+ static void performClean(J2SEProject project) throws IOException {
+ ActionProvider ap = (ActionProvider) project.getLookup().lookup(ActionProvider.class);
+
+ if (ap instanceof J2SEActionProvider) {
+ J2SEActionProvider jap = (J2SEActionProvider) ap;
+ Lookup context = Lookups.fixed(new Object[0]);
+ Properties p = new Properties();
+ String[] targetNames = jap.getTargetNames(ActionProvider.COMMAND_CLEAN, context, p);
+ FileObject buildXML = project.getProjectDirectory().getFileObject(GeneratedFilesHelper.BUILD_XML_PATH);
+
+ assert targetNames != null;
+ assert targetNames.length > 0;
+
+ ActionUtils.runTarget(buildXML, targetNames, p).waitFinished();
+ } else {
+ ErrorManager.getDefault().log(ErrorManager.INFORMATIONAL, "J2SE project's action provider is not a J2SEActionProvider. Cannot perform clean."); // NOI18N
+ }
+ }
+
+ static void deleteProject(final J2SEProject project) {
+ ProjectInformation pi = (ProjectInformation) project.getLookup().lookup(ProjectInformation.class);
+ String displayName = getDisplayName(project);
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "delete started: " + displayName); // NOI18N
+ }
+
+ List/**/ metadataFiles = getMetadataFiles(project);
+ List/**/ allFiles = new ArrayList/**/();
+
+ allFiles.addAll(metadataFiles);
+ allFiles.addAll(getSourceDirectories(project));
+
+ List/**/ metadataFilesNames = getFilesNames(metadataFiles);
+ List/**/ allFilesNames = getFilesNames(allFiles);
+
+ J2SEProjectDeletePanel deletePanel = new J2SEProjectDeletePanel(displayName, metadataFilesNames, allFilesNames);
+
+ String caption = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Delete_Project_Caption");
+
+ DialogDescriptor dd = new DialogDescriptor(deletePanel, caption);
+
+ DialogDisplayer.getDefault().createDialog(dd).setVisible(true);
+
+ if (dd.getValue() == DialogDescriptor.OK_OPTION) {
+ List/**/ toDeleteImpl = null;
+
+ if (deletePanel.isDeleteSources()) {
+ toDeleteImpl = allFiles;
+ } else {
+ toDeleteImpl = metadataFiles;
+ }
+
+ final ProgressHandle handle = ProgressHandleFactory.createHandle(caption);
+ final List/**/ toDelete = toDeleteImpl;
+
+ OpenProjects.getDefault().close(new Project[] {project});
+
+ String inProgressCaption = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Project_Deletion_in_Progress_Caption");
+ DialogDescriptor dd2 = new DialogDescriptor(createProgressDialog(handle), inProgressCaption, true, new Object[0], null, DialogDescriptor.BOTTOM_ALIGN, HelpCtx.DEFAULT_HELP, null);
+
+ final Dialog dialog = DialogDisplayer.getDefault().createDialog(dd2);
+ final boolean[] result = new boolean[1];
+
+ RequestProcessor.getDefault().post(new Runnable() {
+ public void run() {
+ result[0] = performDelete(project, toDelete, handle);
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "delete finished"); // NOI18N
+ }
+
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "calling hide on progress dialog"); // NOI18N
+ }
+
+ dialog.hide();
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "done"); // NOI18N
+ }
+ }
+ });
+ }
+ });
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "showing progress dialog"); // NOI18N
+ }
+
+ dialog.show();
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "progress dialog hidden"); // NOI18N
+ }
+
+ if (result[0]) {
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "delete successfull"); // NOI18N
+ }
+
+ String format = java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Project_Deleted_Caption");
+ NotifyDescriptor nd = new NotifyDescriptor.Message(MessageFormat.format(format, new Object[] {displayName}));
+
+ DialogDisplayer.getDefault().notify(nd);
+ }
+
+ if (ERR.isLoggable(ErrorManager.INFORMATIONAL)) {
+ ERR.log(ErrorManager.INFORMATIONAL, "delete done: " + displayName); // NOI18N
+ }
+ }
+ }
+
+ private static JComponent createProgressDialog(ProgressHandle handle) {
+ JPanel dialog = new JPanel();
+
+ GridBagConstraints gridBagConstraints;
+
+ JLabel jLabel1 = new JLabel();
+ JComponent progress = ProgressHandleFactory.createProgressComponent(handle);
+ JPanel padding = new JPanel();
+
+ dialog.setLayout(new java.awt.GridBagLayout());
+
+ jLabel1.setText(java.util.ResourceBundle.getBundle("org/netbeans/modules/java/j2seproject/Bundle").getString("LBL_Deleting_Project"));
+ gridBagConstraints = new GridBagConstraints();
+ gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
+ gridBagConstraints.insets = new Insets(12, 12, 0, 12);
+ dialog.add(jLabel1, gridBagConstraints);
+
+ gridBagConstraints = new GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.insets = new Insets(12, 12, 0, 12);
+ dialog.add(progress, gridBagConstraints);
+
+ gridBagConstraints = new GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = GridBagConstraints.HORIZONTAL | GridBagConstraints.VERTICAL;
+ gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 1.0;
+ gridBagConstraints.weighty = 1.0;
+ gridBagConstraints.insets = new Insets(12, 12, 12, 12);
+ dialog.add(padding, gridBagConstraints);
+
+ return dialog;
+ }
+
+ private static List/**/ getFilesNames(List/**/ files) {
+ List/**/ result = new ArrayList/**/();
+
+ for (Iterator it = files.iterator(); it.hasNext(); ) {
+ FileObject fo = (FileObject) it.next();
+ String displaName = FileUtil.getFileDisplayName(fo);
+
+ if (fo.isFolder()) {
+ displaName += "/**"; // NOI18N
+ }
+
+ result.add(displaName);
+ }
+
+ Collections.sort(result);
+
+ return result;
+ }
+ //
+
+}
Index: java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SEPhysicalViewProvider.java
===================================================================
RCS file: /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SEPhysicalViewProvider.java,v
retrieving revision 1.51
diff -u -r1.51 J2SEPhysicalViewProvider.java
--- java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SEPhysicalViewProvider.java 5 May 2005 13:42:21 -0000 1.51
+++ java/j2seproject/src/org/netbeans/modules/java/j2seproject/ui/J2SEPhysicalViewProvider.java 20 May 2005 14:18:46 -0000
@@ -289,6 +289,8 @@
actions.add(CommonProjectActions.openSubprojectsAction());
actions.add(CommonProjectActions.closeProjectAction());
actions.add(null);
+ actions.add(CommonProjectActions.deleteProjectAction());
+ actions.add(null);
actions.add(SystemAction.get( org.openide.actions.FindAction.class ));
/*
null,