Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2011-10-27 16:52:33 +0000
committerMartin Fluegge2011-10-27 16:52:33 +0000
commita0e58a5611861c52a64b909ee24b0fa2078e5cd6 (patch)
treea2c20c42fc29c5fc8ea6d90dd4f675a7fc75fd5b /plugins/org.eclipse.emf.cdo.dawn.emf
parent4a6963d2cf1fd2f96c847b8530102b1f804d9c89 (diff)
downloadcdo-a0e58a5611861c52a64b909ee24b0fa2078e5cd6.tar.gz
cdo-a0e58a5611861c52a64b909ee24b0fa2078e5cd6.tar.xz
cdo-a0e58a5611861c52a64b909ee24b0fa2078e5cd6.zip
[359656] [Dawn] Provide collaborative extension for
Graphiti editors https://bugs.eclipse.org/bugs/show_bug.cgi?id=359656
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.emf')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java206
1 files changed, 103 insertions, 103 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java
index 0da1605dd8..8b7c19ddf7 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java
@@ -1,103 +1,103 @@
-/*
- * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Martin Fluegge - initial API and implementation
- */
-package org.eclipse.emf.cdo.dawn.emf.editors.impl;
-
-import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
-import org.eclipse.emf.cdo.dawn.editors.impl.DawnAbstractEditorSupport;
-import org.eclipse.emf.cdo.dawn.emf.notifications.impl.DawnEMFHandler;
-import org.eclipse.emf.cdo.dawn.emf.notifications.impl.DawnEMFLockingHandler;
-import org.eclipse.emf.cdo.dawn.notifications.BasicDawnListener;
-import org.eclipse.emf.cdo.dawn.spi.DawnState;
-import org.eclipse.emf.cdo.transaction.CDOTransactionHandlerBase;
-import org.eclipse.emf.cdo.util.CDOUtil;
-import org.eclipse.emf.cdo.view.CDOView;
-
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.ecore.EObject;
-
-import java.util.Map;
-
-/**
- * @author Martin Fluegge
- * @since 1.0
- */
-public class DawnEMFEditorSupport extends DawnAbstractEditorSupport
-{
- public DawnEMFEditorSupport(IDawnEditor editor)
- {
- super(editor);
- }
-
- public void close()
- {
- CDOView view = getView();
- if (view != null && !view.isClosed())
- {
- view.close();
- }
- }
-
- @Override
- protected BasicDawnListener getBasicHandler()
- {
- return new DawnEMFHandler(getEditor());
- }
-
- @Override
- protected BasicDawnListener getLockingHandler()
- {
- return new DawnEMFLockingHandler(getEditor());
- }
-
- @Override
- protected CDOTransactionHandlerBase getTransactionHandler()
- {
- return null;
- }
-
- @Override
- public void rollback()
- {
- super.rollback();
- refresh();
- }
-
- public void refresh()
- {
- ((IViewerProvider)getEditor()).getViewer().refresh();
- }
-
- public void lockObject(Object objectToBeLocked)
- {
- if (objectToBeLocked instanceof EObject)
- {
- CDOUtil.getCDOObject((EObject)objectToBeLocked).cdoWriteLock().lock();
- }
- refresh();
- }
-
- public void unlockObject(Object objectToBeUnlocked)
- {
- CDOUtil.getCDOObject((EObject)objectToBeUnlocked).cdoWriteLock().unlock();
- refresh();
- }
-
- public void handleRemoteLockChanges(Map<Object, DawnState> changedObjects)
- {
- getEditor().getSite().getShell().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- refresh();
- }
- });
- }
-}
+/*
+ * Copyright (c) 2004 - 2011 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Martin Fluegge - initial API and implementation
+ */
+package org.eclipse.emf.cdo.dawn.emf.editors.impl;
+
+import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
+import org.eclipse.emf.cdo.dawn.editors.impl.DawnAbstractEditorSupport;
+import org.eclipse.emf.cdo.dawn.emf.notifications.impl.DawnEMFHandler;
+import org.eclipse.emf.cdo.dawn.emf.notifications.impl.DawnEMFLockingHandler;
+import org.eclipse.emf.cdo.dawn.notifications.BasicDawnListener;
+import org.eclipse.emf.cdo.dawn.spi.DawnState;
+import org.eclipse.emf.cdo.transaction.CDOTransactionHandlerBase;
+import org.eclipse.emf.cdo.util.CDOUtil;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+import org.eclipse.emf.ecore.EObject;
+
+import java.util.Map;
+
+/**
+ * @author Martin Fluegge
+ * @since 1.0
+ */
+public class DawnEMFEditorSupport extends DawnAbstractEditorSupport
+{
+ public DawnEMFEditorSupport(IDawnEditor editor)
+ {
+ super(editor);
+ }
+
+ public void close()
+ {
+ CDOView view = getView();
+ if (view != null && !view.isClosed())
+ {
+ view.close();
+ }
+ }
+
+ @Override
+ protected BasicDawnListener getBasicHandler()
+ {
+ return new DawnEMFHandler(getEditor());
+ }
+
+ @Override
+ protected BasicDawnListener getLockingHandler()
+ {
+ return new DawnEMFLockingHandler(getEditor());
+ }
+
+ @Override
+ protected CDOTransactionHandlerBase getTransactionHandler()
+ {
+ return new DawnEMFHandler(getEditor());
+ }
+
+ @Override
+ public void rollback()
+ {
+ super.rollback();
+ refresh();
+ }
+
+ public void refresh()
+ {
+ ((IViewerProvider)getEditor()).getViewer().refresh();
+ }
+
+ public void lockObject(Object objectToBeLocked)
+ {
+ if (objectToBeLocked instanceof EObject)
+ {
+ CDOUtil.getCDOObject((EObject)objectToBeLocked).cdoWriteLock().lock();
+ }
+ refresh();
+ }
+
+ public void unlockObject(Object objectToBeUnlocked)
+ {
+ CDOUtil.getCDOObject((EObject)objectToBeUnlocked).cdoWriteLock().unlock();
+ refresh();
+ }
+
+ public void handleRemoteLockChanges(Map<Object, DawnState> changedObjects)
+ {
+ getEditor().getSite().getShell().getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ refresh();
+ }
+ });
+ }
+}

Back to the top