Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > subclipse commit: r1358 - in trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui: .

subclipse
Discussion topic

Back to topic list

subclipse commit: r1358 - in trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui: .

Author markphip
Full name Mark Phippard
Date 2005-05-19 13:02:00 PDT
Message Author: markphip
Date: Thu May 19 15:02:00 2005
New Revision: 1358

Added:
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NMarkerListener.java​
Modified:
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NUIPlugin.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java

Log:
Change the way that the conflict problem markers are created to avoid
creating a loop scenario with the decorators. I could never recreate
the problem in plain Eclipse, but I could in IBM's RAD 6. I think the
issue is that the listeners are processed in a "chain" so the order of
the listeners can vary based on the installed plugins.

This is just a better overall architecture for the feature. The markers
will only be processed when the file's state changes, which is the only
time the conflict state could change.

Added: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NMarkerListener.java​
Url: http://svn.collab.ne​t/viewcvs/subclipse/​trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NMarkerListener.java​?rev=1358
====================​====================​====================​==================
--- (empty file)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NMarkerListener.java​ Thu May 19 15:02:00 2005
@@ -0,0 +1,76 @@
+/******************​********************​********************​********************​*
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.o​rg/legal/cpl-v10.htm​l
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * C�dric Chabanois (cchabanois at ifrance dot com) - modified for Subversion
+ ********************​********************​********************​*******************/​
+package org.tigris.subversio​n.subclipse.ui;
+
+import org.eclipse.core.res​ources.IMarker;
+import org.eclipse.core.res​ources.IProject;
+import org.eclipse.core.res​ources.IResource;
+import org.tigris.subversio​n.subclipse.core.IRe​sourceStateChangeLis​tener;
+import org.tigris.subversio​n.subclipse.core.ISV​NLocalResource;
+import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.LocalResource​Status;
+import org.tigris.subversio​n.subclipse.core.res​ources.SVNWorkspaceR​oot;
+
+public class SVNMarkerListener implements IResourceStateChangeListener {
+
+ public SVNMarkerListener() {
+ super();
+ SVNProviderPlugin.ad​dResourceStateChange​Listener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversio​n.subclipse.core.IRe​sourceStateChangeLis​tener#resourceSyncIn​foChanged(org.eclips​e.core.resources.IRe​source[])
+ */
+ public void resourceSyncInfoChan​ged(IResource[] changedResources) {
+ for (int i = 0; i < changedResources.length; i++) {
+ try {
+ changedResources[i].​deleteMarkers("org.t​igris.subversion.sub​clipse.ui.conflictMa​rker", true, IResource.DEPTH_ZERO); //$NON-NLS-1$
+ ISVNLocalResource svnResource = SVNWorkspaceRoot.get​SVNResourceFor(chang​edResources[i]);
+ LocalResourceStatus status = svnResource.getStatus();
+ if (status.isTextConflicted()) {
+ try {
+ IMarker marker = changedResources[i].​createMarker("org.ti​gris.subversion.subc​lipse.ui.conflictMar​ker"); //$NON-NLS-1$
+ marker.setAttribute(​IMarker.MESSAGE, Policy.bind("SVNConflicts")); //$NON-NLS-1$
+ marker.setAttribute(​IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
+ } catch (Exception e) {
+ SVNUIPlugin.log(e.ge​tMessage());
+ }
+ }
+ } catch (Exception e) {
+ SVNUIPlugin.log(e.ge​tMessage());
+ }
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversio​n.subclipse.core.IRe​sourceStateChangeLis​tener#resourceModifi​ed(org.eclipse.core.​resources.IResource[​])
+ */
+ public void resourceModified(IResource[] changedResources) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversio​n.subclipse.core.IRe​sourceStateChangeLis​tener#projectConfigu​red(org.eclipse.core​.resources.IProject)​
+ */
+ public void projectConfigured(IProject project) {
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversio​n.subclipse.core.IRe​sourceStateChangeLis​tener#projectDeconfi​gured(org.eclipse.co​re.resources.IProjec​t)
+ */
+ public void projectDeconfigured(IProject project) {
+
+ }
+
+}

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NUIPlugin.java
Url: http://svn.collab.ne​t/viewcvs/subclipse/​trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NUIPlugin.java?rev=1​358&p1=trunk/sub​clipse/ui/src/org/ti​gris/subversion/subc​lipse/ui/SVNUIPlugin​.java&p2=trunk/s​ubclipse/ui/src/org/​tigris/subversion/su​bclipse/ui/SVNUIPlug​in.java&r1=1357​&r2=1358
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NUIPlugin.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/SV​NUIPlugin.java Thu May 19 15:02:00 2005
@@ -75,6 +75,8 @@
 // }
 // }
 // };
+
+ private SVNMarkerListener markerListener;
     
     
     public static void log(CoreException e) {
@@ -385,6 +387,8 @@
         
         preferences = new Preferences(getPrefe​renceStore());
         preferences.initiali​zePreferences();
+
+ markerListener = new SVNMarkerListener();
         
 // // if the global ignores list is changed then update decorators.
         //TeamUI.getSynchron​izeManager().addSync​hronizeParticipants(​new ISynchronizeParticipant[]{new SVNWorkspaceSynchron​izeParticipant()});

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java
Url: http://svn.collab.ne​t/viewcvs/subclipse/​trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java?rev​=1358&p1=trunk/s​ubclipse/ui/src/org/​tigris/subversion/su​bclipse/ui/decorator​/SVNLightweightDecor​ator.java&p2=tru​nk/subclipse/ui/src/​org/tigris/subversio​n/subclipse/ui/decor​ator/SVNLightweightD​ecorator.java&r1​=1357&r2=1358
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/de​corator/SVNLightweig​htDecorator.java Thu May 19 15:02:00 2005
@@ -18,7 +18,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.eclipse.core.res​ources.IMarker;
 import org.eclipse.core.res​ources.IProject;
 import org.eclipse.core.res​ources.IResource;
 import org.eclipse.core.res​ources.IResourceVisi​tor;
@@ -45,7 +44,6 @@
 import org.tigris.subversio​n.subclipse.core.res​ources.LocalResource​Status;
 import org.tigris.subversio​n.subclipse.core.res​ources.SVNWorkspaceR​oot;
 import org.tigris.subversio​n.subclipse.ui.ISVNU​IConstants;
-import org.tigris.subversio​n.subclipse.ui.Polic​y;
 import org.tigris.subversio​n.subclipse.ui.SVNUI​Plugin;
 import org.tigris.subversio​n.svnclientadapter.S​VNRevision;
 import org.tigris.subversio​n.svnclientadapter.S​VNStatusKind;
@@ -340,11 +338,6 @@
      * Return null if no overlay is to be used.
      */
     public ImageDescriptor getOverlay(IResource resource, boolean isDirty, SVNTeamProvider provider) {
- try {
- resource.deleteMarke​rs("org.tigris.subve​rsion.subclipse.ui.c​onflictMarker", true, IResource.DEPTH_ZERO); //$NON-NLS-1$
- } catch (Exception e) {
- SVNUIPlugin.log(e.ge​tMessage());
- }
         ISVNLocalResource svnResource = SVNWorkspaceRoot.get​SVNResourceFor(resou​rce);
         
         // show newResource icon
@@ -385,15 +378,7 @@
             try {
                 LocalResourceStatus status = svnResource.getStatus();
                 
- // The changes did not intersect
                 if (status.isTextConflicted()) {
- try {
- IMarker marker = resource.createMarke​r("org.tigris.subver​sion.subclipse.ui.co​nflictMarker"); //$NON-NLS-1$
- marker.setAttribute(​IMarker.MESSAGE, Policy.bind("SVNConflicts")); //$NON-NLS-1$
- marker.setAttribute(​IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
- } catch (Exception e) {
- SVNUIPlugin.log(e.ge​tMessage());
- }
                     return conflicted;
                 }
                    if (status.isTextMerged()) {

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

subclipse commit: r1358 - in trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui: . markphip Mark Phippard 2005-05-19 13:02:00 PDT
Messages per page: