Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Fluegge2011-08-09 15:45:56 +0000
committerMartin Fluegge2011-08-09 15:45:56 +0000
commit6da925d59e1d48ac6200308c1951cc33132042a2 (patch)
treef873bc1ac786d85b8ce16845c97240f5ec66894a /plugins/org.eclipse.emf.cdo.dawn.emf
parentc897ef8db9fe36446d579a761896273208ac67f2 (diff)
downloadcdo-6da925d59e1d48ac6200308c1951cc33132042a2.tar.gz
cdo-6da925d59e1d48ac6200308c1951cc33132042a2.tar.xz
cdo-6da925d59e1d48ac6200308c1951cc33132042a2.zip
[332902] [Dawn] Decouple Dawn Runtime from integrated frameworks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=332902
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.dawn.emf')
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/.settings/org.eclipse.jdt.core.prefs2
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/Activator.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java62
-rw-r--r--plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/notifications/impl/DawnEMFHandler.java57
5 files changed, 127 insertions, 24 deletions
diff --git a/plugins/org.eclipse.emf.cdo.dawn.emf/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.dawn.emf/.settings/org.eclipse.jdt.core.prefs
index 0bde483c31..68ca3bb681 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.emf/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Sun Jul 31 19:11:46 CEST 2011
+#Fri Aug 05 08:40:50 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.codeComplete.argumentPrefixes=
org.eclipse.jdt.core.codeComplete.argumentSuffixes=
diff --git a/plugins/org.eclipse.emf.cdo.dawn.emf/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.dawn.emf/META-INF/MANIFEST.MF
index 4fd9102357..ac70245f3f 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.emf/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/META-INF/MANIFEST.MF
@@ -5,9 +5,13 @@ Bundle-SymbolicName: org.eclipse.emf.cdo.dawn.emf
Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.eclipse.emf.cdo.dawn.emf.Activator
Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)"
+ org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.emf.cdo.dawn;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.emf.common.ui;bundle-version="[2.6.0,3.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
-Export-Package: org.eclipse.emf.cdo.dawn.emf;version="2.0.0"
+Export-Package: org.eclipse.emf.cdo.dawn.emf;version="2.0.0",
+ org.eclipse.emf.cdo.dawn.emf.editors.impl;version="2.0.0",
+ org.eclipse.emf.cdo.dawn.emf.notifications.impl;version="2.0.0"
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/Activator.java b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/Activator.java
index 6293075f67..1ecdbbe0fd 100644
--- a/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/Activator.java
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/Activator.java
@@ -5,28 +5,18 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
- * The activator class controls the plug-in life cycle
+ * @author Martin Fluegge
*/
public class Activator extends AbstractUIPlugin
{
-
- // The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.emf.cdo.dawn.emf"; //$NON-NLS-1$
- // The shared instance
private static Activator plugin;
- /**
- * The constructor
- */
public Activator()
{
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
@Override
public void start(BundleContext context) throws Exception
{
@@ -34,10 +24,6 @@ public class Activator extends AbstractUIPlugin
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
@Override
public void stop(BundleContext context) throws Exception
{
@@ -45,14 +31,8 @@ public class Activator extends AbstractUIPlugin
super.stop(context);
}
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
public static Activator getDefault()
{
return plugin;
}
-
}
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
new file mode 100644
index 0000000000..1a6aca2fc4
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/editors/impl/DawnEMFEditorSupport.java
@@ -0,0 +1,62 @@
+/**
+ * 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.notifications.BasicDawnListener;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.view.CDOAdapterPolicy;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+/**
+ * @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();
+ }
+ }
+
+ public void registerListeners()
+ {
+ BasicDawnListener listener = new DawnEMFHandler(getEditor());
+ CDOView view = getView();
+ view.addListener(listener);
+
+ if (view instanceof CDOTransaction)
+ {
+ CDOTransaction transaction = (CDOTransaction)view;
+ transaction.options().addChangeSubscriptionPolicy(CDOAdapterPolicy.CDO);
+ }
+ }
+
+ @Override
+ public void rollback()
+ {
+ super.rollback();
+ ((IViewerProvider)getEditor()).getViewer().refresh();
+ }
+}
diff --git a/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/notifications/impl/DawnEMFHandler.java b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/notifications/impl/DawnEMFHandler.java
new file mode 100644
index 0000000000..94b5d25b29
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.dawn.emf/src/org/eclipse/emf/cdo/dawn/emf/notifications/impl/DawnEMFHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.notifications.impl;
+
+import org.eclipse.emf.cdo.dawn.editors.IDawnEditor;
+import org.eclipse.emf.cdo.dawn.notifications.BasicDawnListener;
+import org.eclipse.emf.cdo.transaction.CDOTransactionConflictEvent;
+import org.eclipse.emf.cdo.view.CDOViewInvalidationEvent;
+
+import org.eclipse.emf.common.ui.viewer.IViewerProvider;
+
+/**
+ * @author Martin Fluegge
+ */
+public class DawnEMFHandler extends BasicDawnListener
+{
+ /**
+ * @since 1.0
+ */
+ public DawnEMFHandler(IDawnEditor editor)
+ {
+ super(editor);
+ }
+
+ @Override
+ public void handleTransactionConflictEvent(CDOTransactionConflictEvent event)
+ {
+ super.handleTransactionConflictEvent(event);
+ refreshEditor();
+ }
+
+ @Override
+ public void handleViewInvalidationEvent(CDOViewInvalidationEvent event)
+ {
+ super.handleViewInvalidationEvent(event);
+ refreshEditor();
+ }
+
+ private void refreshEditor()
+ {
+ editor.getSite().getShell().getDisplay().asyncExec(new Runnable()
+ {
+ public void run()
+ {
+ ((IViewerProvider)editor).getViewer().refresh();
+ }
+ });
+ }
+}

Back to the top