Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2010-06-06 14:39:45 +0000
committerMartin Fluegge2010-06-06 14:39:45 +0000
commitda36bd46832db377b9f670735ec3265ec15f3410 (patch)
tree459630952de970e91405fb6efc9ef94378356056 /plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn
parenta55d29d37931b44d3c1d8464be9e75b24e9fcc9a (diff)
downloadcdo-da36bd46832db377b9f670735ec3265ec15f3410.tar.gz
cdo-da36bd46832db377b9f670735ec3265ec15f3410.tar.xz
cdo-da36bd46832db377b9f670735ec3265ec15f3410.zip
[308232] [Dawn] Develop collaborative support for GMF on CDO
https://bugs.eclipse.org/bugs/show_bug.cgi?id=308232
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DawnAcoreDiagramEditor.java53
1 files changed, 32 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DawnAcoreDiagramEditor.java b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DawnAcoreDiagramEditor.java
index 4b395417a7..0d5cd68e64 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DawnAcoreDiagramEditor.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.examples.acore.diagram.dawn/src/org/eclipse/emf/cdo/dawn/examples/acore/diagram/part/DawnAcoreDiagramEditor.java
@@ -10,10 +10,10 @@
******************************************************************************/
package org.eclipse.emf.cdo.dawn.examples.acore.diagram.part;
-import org.eclipse.emf.cdo.dawn.diagram.part.IDawnDiagramEditor;
-import org.eclipse.emf.cdo.dawn.notifications.DawnNotificationUtil;
+import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
+import org.eclipse.emf.cdo.dawn.editors.IDawnEditorSupport;
+import org.eclipse.emf.cdo.dawn.editors.impl.DawnGMFEditorSupport;
import org.eclipse.emf.cdo.dawn.ui.DawnEditorInput;
-import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.ui.CDOEditorInput;
import org.eclipse.emf.cdo.view.CDOView;
@@ -34,20 +34,19 @@ import org.eclipse.ui.IFileEditorInput;
/**
* @author Martin Fluegge
*/
-public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnDiagramEditor
+public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnEditor
{
- private CDOTransaction transaction;
-
- private boolean dirty;
-
public static String ID = "org.eclipse.emf.cdo.dawn.examples.acore.diagram.part.DawnAcoreDiagramEditor";
+ private IDawnEditorSupport dawnEditorSupport;
+
public DawnAcoreDiagramEditor()
{
super();
AcoreDiagramEditorPlugin.getInstance().logInfo("CDO Editor ist starting");
setDocumentProvider(new DawnAcoreDocumentProvider());
+ setDawnEditorSupport(new DawnGMFEditorSupport(this));
}
@Override
@@ -67,11 +66,13 @@ public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnD
Shell shell = getSite().getShell();
ErrorDialog.openError(shell, title, msg, x.getStatus());
}
- transaction = (CDOTransaction)((DawnEditorInput)input).getView();
+ // transaction = (CDOTransaction)((DawnEditorInput)input).getView();
+ dawnEditorSupport.setView(((DawnEditorInput)input).getView());
+ dawnEditorSupport.registerListeners();
- DawnNotificationUtil.registerResourceListeners(getEditingDomain().getResourceSet(), this);
- DawnNotificationUtil.registerTransactionListeners(transaction, this);
- DawnNotificationUtil.setChangeSubscriptionPolicy(transaction);
+ // DawnNotificationUtil.registerResourceListeners(getEditingDomain().getResourceSet(), this);
+ // DawnNotificationUtil.registerTransactionListeners(transaction, this);
+ // DawnNotificationUtil.setChangeSubscriptionPolicy(transaction);
}
@Override
@@ -85,7 +86,8 @@ public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnD
{
try
{
- dirty = false;
+ // dirty = false;
+ dawnEditorSupport.setDirty(false);
updateState(getEditorInput());
validateState(getEditorInput());
performSave(false, monitor);
@@ -110,12 +112,12 @@ public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnD
// return super.isDirty() | transaction.isDirty();
// return transaction.isDirty();
// return super.isDirty() ;
- return dirty;
+ return dawnEditorSupport.isDirty();
}
public String getContributorID()
{
- return null;
+ return ID;
}
/**
@@ -143,22 +145,31 @@ public class DawnAcoreDiagramEditor extends AcoreDiagramEditor implements IDawnD
}
finally
{
- if (transaction != null && !transaction.isClosed())
- {
- transaction.close();
- }
+ dawnEditorSupport.close();
}
}
public CDOView getView()
{
// TODO Auto-generated method stub
- return transaction;
+ // return transaction;
+ return dawnEditorSupport.getView();
}
public void setDirty()
{
- dirty = true;
+ // dirty = true;
+ dawnEditorSupport.setDirty(true);
((AbstractDocumentProvider)getDocumentProvider()).changed(getEditorInput());
}
+
+ public void setDawnEditorSupport(IDawnEditorSupport dawnEditorSupport)
+ {
+ this.dawnEditorSupport = dawnEditorSupport;
+ }
+
+ public IDawnEditorSupport getDawnEditorSupport()
+ {
+ return dawnEditorSupport;
+ }
}

Back to the top