Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-02-11 23:12:19 +0000
committerjames2002-02-11 23:12:19 +0000
commit2837180c4b11bc2fbc26ffa30c6bc7822cef6abe (patch)
tree272da2d02bd358a1ebc79e96050398db57984d65
parent8efdafb52d992fc391e17f9562e827eb9a287eff (diff)
downloadeclipse.platform.team-2837180c4b11bc2fbc26ffa30c6bc7822cef6abe.tar.gz
eclipse.platform.team-2837180c4b11bc2fbc26ffa30c6bc7822cef6abe.tar.xz
eclipse.platform.team-2837180c4b11bc2fbc26ffa30c6bc7822cef6abe.zip
8995: Should not have to manually edit cvsignore
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.properties3
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml.off6
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java71
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties2
4 files changed, 82 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.properties b/bundles/org.eclipse.team.cvs.ui/plugin.properties
index ac370eca4..ee3f19ac0 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.properties
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.properties
@@ -35,6 +35,9 @@ CompareWithRevisionAction.tooltip=Compare with Revision on CVS Server
CompareWithTagAction.label=&Tag...
CompareWithTagAction.tooltip=Compare with Tag on CVS Server
+IgnoreAction.label=&Ignore
+IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing
+
RemoveBranchTagAction.label=Discard &Branch
RemoveBranchTagAction.tooltip=Discard Branch
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml.off b/bundles/org.eclipse.team.cvs.ui/plugin.xml.off
index d9865a648..f47e02a0a 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml.off
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml.off
@@ -94,6 +94,12 @@
menubarPath="team.main/group2"
class="org.eclipse.team.internal.ccvs.ui.actions.CommitAction"/>
<action
+ id="org.eclipse.team.ccvs.ui.ignore"
+ label="%IgnoreAction.label"
+ tooltip="%IgnoreAction.tooltip"
+ menubarPath="team.main/group1"
+ class="org.eclipse.team.internal.ccvs.ui.actions.IgnoreAction"/>
+ <action
id="org.eclipse.team.ccvs.ui.branch"
label="%BranchAction.label"
tooltip="%BranchAction.tooltip"
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
new file mode 100644
index 000000000..cc9899c34
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/IgnoreAction.java
@@ -0,0 +1,71 @@
+package org.eclipse.team.internal.ccvs.ui.actions;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.team.core.TeamException;
+import org.eclipse.team.internal.ccvs.core.CVSException;
+import org.eclipse.team.internal.ccvs.core.resources.ICVSResource;
+import org.eclipse.team.internal.ccvs.core.resources.LocalFile;
+import org.eclipse.team.internal.ccvs.core.resources.LocalFolder;
+import org.eclipse.team.internal.ccvs.ui.Policy;
+import org.eclipse.team.ui.actions.TeamAction;
+import org.eclipse.ui.actions.WorkspaceModifyOperation;
+
+public class IgnoreAction extends TeamAction {
+ protected boolean isEnabled() throws TeamException {
+ IResource[] resources = getSelectedResources();
+ if (resources.length == 0) return false;
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ ICVSResource cvsResource = null;
+ switch (resource.getType()) {
+ case IResource.FILE:
+ cvsResource = new LocalFile(resource.getLocation().toFile());
+ break;
+ case IResource.FOLDER:
+ cvsResource = new LocalFolder(resource.getLocation().toFile());
+ break;
+ default:
+ return false;
+ }
+ if (cvsResource.isManaged()) return false;
+ if (cvsResource.isIgnored()) return false;
+ }
+ return true;
+ }
+ public void run(IAction action) {
+ run(new WorkspaceModifyOperation() {
+ public void execute(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ IResource[] resources = getSelectedResources();
+ for (int i = 0; i < resources.length; i++) {
+ IResource resource = resources[i];
+ ICVSResource cvsResource = null;
+ switch (resource.getType()) {
+ case IResource.FILE:
+ cvsResource = new LocalFile(resource.getLocation().toFile());
+ break;
+ case IResource.FOLDER:
+ cvsResource = new LocalFolder(resource.getLocation().toFile());
+ break;
+ }
+ if (cvsResource != null) {
+ try {
+ cvsResource.setIgnored();
+ } catch (CVSException e) {
+ ErrorDialog.openError(getShell(), null, null, e.getStatus());
+ }
+ }
+ }
+ }
+ }, Policy.bind("IgnoreAction.ignore"), PROGRESS_BUSYCURSOR);
+ }
+}
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
index 3bd667f8b..f6d64042b 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties
@@ -198,6 +198,8 @@ HistoryView.showTags=Show Tag Viewer
HistoryView.title=Resource History
HistoryView.titleWithArgument=Resource History - {0}
+IgnoreAction.ignore=Error Ignoring Resource
+
MergeAction.problemsDuringSync=Problems During Synchronization
MergeEditorInput.title=Merge {0} with {1}

Back to the top