Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdumoulin2009-11-28 01:17:19 +0000
committercdumoulin2009-11-28 01:17:19 +0000
commit89a37bd93b38c7d0e5df0f6adfc46cb612ce5383 (patch)
treedc57f0e7898d8395c56476c21fb215c99ffe01e0 /plugins/core
parent28e14f332ed60c1c6476ad5cfafecdf1d35090b3 (diff)
downloadorg.eclipse.papyrus-89a37bd93b38c7d0e5df0f6adfc46cb612ce5383.tar.gz
org.eclipse.papyrus-89a37bd93b38c7d0e5df0f6adfc46cb612ce5383.tar.xz
org.eclipse.papyrus-89a37bd93b38c7d0e5df0f6adfc46cb612ce5383.zip
292228: The diagram editor stays always dirty
https://bugs.eclipse.org/bugs/show_bug.cgi?id=292228 Resolve the isDirty flag problem
Diffstat (limited to 'plugins/core')
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/AbstractMultiPageSashEditor.java9
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/SashWindowsEventsProvider.java4
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/EditorPart.java8
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PTabFolder.java1
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PageVisitorWrapper.java17
-rw-r--r--plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/SashWindowsContainer.java7
6 files changed, 24 insertions, 22 deletions
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/AbstractMultiPageSashEditor.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/AbstractMultiPageSashEditor.java
index 73e057c91a5..246e1a30f54 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/AbstractMultiPageSashEditor.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/AbstractMultiPageSashEditor.java
@@ -235,7 +235,9 @@ public abstract class AbstractMultiPageSashEditor extends EditorPart implements
for( IEditorPart editorPart : visitor.getPages())
{
if( editorPart.isDirty())
+ {
return true;
+ }
}
return false;
@@ -290,11 +292,8 @@ public abstract class AbstractMultiPageSashEditor extends EditorPart implements
*/
public void accept(IEditorPage page) {
- IEditorPart editor = page.getIEditorPart();
-
- // Null values are also filtered out.
- if( editor instanceof EditorPart)
- pages.add(editor);
+ IEditorPart editor = page.getIEditorPart();
+ pages.add(editor);
}
}
}
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/SashWindowsEventsProvider.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/SashWindowsEventsProvider.java
index ddc7586a56b..80ffc07558a 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/SashWindowsEventsProvider.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/editor/SashWindowsEventsProvider.java
@@ -207,8 +207,6 @@ public class SashWindowsEventsProvider {
*/
private void activeEditorChanged(IEditorPart newEditor) {
- System.out.println("activeEditorChanged(" + newEditor + ")");
-
// Editor has changed. It can be null.
// Compute new container.
ISashWindowsContainer newContainer = null;
@@ -255,7 +253,6 @@ public class SashWindowsEventsProvider {
* @param activeEditor
*/
private void fireContainerChanged(ISashWindowsContainer newContainer) {
- System.out.println("fireContainerChanged(" + newContainer + ")");
// Propagate to all the listeners
containerEventsManager.fireEvent(newContainer);
}
@@ -268,7 +265,6 @@ public class SashWindowsEventsProvider {
*/
private void firePageChanged(IPage newPage) {
- System.out.println("event mngr firePageChanged(" + newPage + ")");
activePage = newPage;
// Propagate to all the listeners
pageEventsManager.fireEvent(newPage);
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/EditorPart.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/EditorPart.java
index 450a6351c46..bbcdead2168 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/EditorPart.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/EditorPart.java
@@ -18,7 +18,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.window.Window;
import org.eclipse.papyrus.sasheditor.Activator;
import org.eclipse.papyrus.sasheditor.contentprovider.IEditorModel;
-import org.eclipse.papyrus.sasheditor.editor.IComponentPage;
+import org.eclipse.papyrus.sasheditor.editor.IEditorPage;
import org.eclipse.papyrus.sasheditor.internal.eclipsecopy.MultiPageEditorSite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
@@ -46,7 +46,7 @@ import org.eclipse.ui.part.IWorkbenchPartOrientation;
*
*/
@SuppressWarnings("restriction")
-public class EditorPart extends PagePart implements IComponentPage {
+public class EditorPart extends PagePart implements IEditorPage {
/**
* The model representing the editor.
@@ -93,8 +93,8 @@ public class EditorPart extends PagePart implements IComponentPage {
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
public void handleEvent(Event event) {
- Point globalPos = new Point(event.x, event.y);
- System.out.println(this.getClass().getSimpleName() + ".handleEvent(" + eventName(event.type) + ", " + globalPos + ")");
+// Point globalPos = new Point(event.x, event.y);
+// System.out.println(this.getClass().getSimpleName() + ".handleEvent(" + eventName(event.type) + ", " + globalPos + ")");
}
};
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PTabFolder.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PTabFolder.java
index e9b818f866a..62bb4df62aa 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PTabFolder.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PTabFolder.java
@@ -97,7 +97,6 @@ public class PTabFolder {
public void handleEvent(Event e) {
Point globalPos = ((Control)e.widget).toDisplay(e.x, e.y);
- System.out.println("activateListener(" + globalPos + ", event=" + e + ")");
handleFolderReselected(globalPos, null);
}
};
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PageVisitorWrapper.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PageVisitorWrapper.java
index e7deba1644a..3b18d97a49a 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PageVisitorWrapper.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/PageVisitorWrapper.java
@@ -3,6 +3,7 @@
*/
package org.eclipse.papyrus.sasheditor.internal;
+import org.eclipse.papyrus.sasheditor.editor.IEditorPage;
import org.eclipse.papyrus.sasheditor.editor.IPageVisitor;
@@ -16,6 +17,11 @@ import org.eclipse.papyrus.sasheditor.editor.IPageVisitor;
public class PageVisitorWrapper extends PartVisitor {
/**
+ * The public visitor.
+ */
+ private IPageVisitor pageVisitor;
+
+ /**
* @param pageVisitor
*/
public PageVisitorWrapper(IPageVisitor pageVisitor) {
@@ -24,15 +30,10 @@ public class PageVisitorWrapper extends PartVisitor {
}
/**
- * The public visitor.
- */
- private IPageVisitor pageVisitor;
-
- /**
* We visit a Component part
*/
@Override
- public boolean accept(ComponentPart part) {
+ public boolean acceptEditorTile(ComponentPart part) {
pageVisitor.accept(part);
return true;
}
@@ -41,8 +42,8 @@ public class PageVisitorWrapper extends PartVisitor {
* We visit an {@link EditorPart}.
*/
@Override
- public boolean accept(EditorPart part) {
- pageVisitor.accept(part);
+ public boolean acceptEditorTile(EditorPart part) {
+ pageVisitor.accept((IEditorPage)part);
return true;
}
}
diff --git a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/SashWindowsContainer.java b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/SashWindowsContainer.java
index e8b18d9805a..252e95189ae 100644
--- a/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/SashWindowsContainer.java
+++ b/plugins/core/org.eclipse.papyrus.sasheditor/src2/org/eclipse/papyrus/sasheditor/internal/SashWindowsContainer.java
@@ -191,6 +191,13 @@ public class SashWindowsContainer implements ISashWindowsContainer {
* @param childPart
*/
protected void pageChangedEvent(PagePart childPart) {
+
+ // Check if it is really a change before changing the model (which can throw change event)
+ // The folder model change is done before the tracker fires the listeners, like this
+ // listeners can check the model.
+ if(getActivePage() == childPart)
+ return;
+
contentProvider.setCurrentFolder(childPart.getParent().getRawModel());
pageChanged(childPart);
}

Back to the top