Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-06-07 20:43:01 +0000
committerMichael Valenta2002-06-07 20:43:01 +0000
commit934a0a963411bd83ececbe0082b543e3f9dfe114 (patch)
treeeb78408dd31320138c90302751ff3d8d2f5c3bad /bundles/org.eclipse.team.ui
parente0f45b506b4fcbd654b9d3f5f6e7c23c4d1df39b (diff)
downloadeclipse.platform.team-934a0a963411bd83ececbe0082b543e3f9dfe114.tar.gz
eclipse.platform.team-934a0a963411bd83ececbe0082b543e3f9dfe114.tar.xz
eclipse.platform.team-934a0a963411bd83ececbe0082b543e3f9dfe114.zip
Adding support for persistant properties
Diffstat (limited to 'bundles/org.eclipse.team.ui')
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/NatureToPropertyAction.java51
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties2
2 files changed, 53 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/NatureToPropertyAction.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/NatureToPropertyAction.java
new file mode 100644
index 000000000..8d8fbdb3c
--- /dev/null
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/NatureToPropertyAction.java
@@ -0,0 +1,51 @@
+package org.eclipse.team.internal.ui;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.team.core.RepositoryProvider;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.ui.actions.TeamAction;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+/**
+ * @author Administrator
+ *
+ * To change this generated comment edit the template variable "typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public class NatureToPropertyAction extends TeamAction {
+
+ /**
+ * @see org.eclipse.team.internal.ui.actions.TeamAction#isEnabled()
+ */
+ protected boolean isEnabled() throws TeamException {
+ return true;
+ }
+
+ /**
+ * @see org.eclipse.ui.IActionDelegate#run(IAction)
+ */
+ public void run(IAction action) {
+ run(new WorkspaceModifyOperation() {
+ public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ try {
+ IProject[] projects = getSelectedProjects();
+ for (int i = 0; i < projects.length; i++) {
+ RepositoryProvider.convertNatureToProperty(projects[i], true);
+ }
+ } catch (TeamException e) {
+ throw new InvocationTargetException(e);
+ } finally {
+ monitor.done();
+ }
+ }
+ }, Policy.bind("NatureToPropertyAction.label"), this.PROGRESS_DIALOG); //$NON-NLS-1$
+ }
+
+}
+
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 0cc40347a..83065d1a2 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -124,6 +124,8 @@ ExportProjectSetMainPage.&File_name__1=&File name:
TeamPreferencePage.General_settings_for_Team_support_1=General settings for Team support
TeamPreferencePage.&Use_Incoming/Outgoing_mode_when_synchronizing_2=&Use Incoming/Outgoing mode when synchronizing
+NatureToPropertyAction.label=Convert Nature
+
###############################################
# Target Management Messages
###############################################

Back to the top