Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2012-09-11 13:03:54 +0000
committerEd Merks2012-09-11 13:03:54 +0000
commit94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a (patch)
tree654101432538874162137c0acdf7b87ec8ad52d9 /examples
parent87762970bca247ee50356461d0735a04f24216ca (diff)
downloadorg.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.tar.gz
org.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.tar.xz
org.eclipse.emf-94a6c74e259d14ac81c90a75f8c5d20f9b7ef37a.zip
[389245] Fix line endings in repo
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.emf.activities/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core.model/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core.model/build.properties22
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core.model/plugin.properties4
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core/META-INF/MANIFEST.MF32
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core/build.properties20
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core/plugin.properties2
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.core/src/org/eclipse/emf/examples/databinding/project/core/internal/Activator.java136
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/META-INF/MANIFEST.MF44
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/build.properties16
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/icons/alt_launcher.xpm614
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.properties44
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.xml688
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/Activator.java292
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/Base64ToImageConverter.java146
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/StringToDateConverter.java162
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/dialogs/CommitterShipDialog.java398
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/NewXMIHandler.java214
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/OpenXMIHandler.java138
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectAdminViewPart.java588
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectCommittersPart.java406
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectExplorerPart.java1146
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectFormAreaPart.java840
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/RedoAction.java146
-rw-r--r--examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/UndoAction.java144
-rw-r--r--examples/org.eclipse.emf.examples.generator.validator/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.library.edit/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.library.editor/about.html54
-rw-r--r--examples/org.eclipse.emf.examples.library/about.html54
-rw-r--r--examples/org.eclipse.emf.examples/about.html54
-rw-r--r--examples/org.eclipse.emf.exporter.html/about.html54
-rw-r--r--examples/org.eclipse.emf.java.edit/about.html54
-rw-r--r--examples/org.eclipse.emf.java.editor/about.html54
-rw-r--r--examples/org.eclipse.emf.java.editor/plugin.properties2
-rw-r--r--examples/org.eclipse.emf.java/about.html54
37 files changed, 3473 insertions, 3473 deletions
diff --git a/examples/org.eclipse.emf.activities/about.html b/examples/org.eclipse.emf.activities/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.activities/about.html
+++ b/examples/org.eclipse.emf.activities/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core.model/about.html b/examples/org.eclipse.emf.examples.databinding.project.core.model/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core.model/about.html
+++ b/examples/org.eclipse.emf.examples.databinding.project.core.model/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core.model/build.properties b/examples/org.eclipse.emf.examples.databinding.project.core.model/build.properties
index f573cb2aa..7e9413701 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core.model/build.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.core.model/build.properties
@@ -1,11 +1,11 @@
-bin.includes = .,\
- model/,\
- about.html,\
- META-INF/,\
- plugin.xml,\
- plugin.properties
-src.includes = about.html
-jars.compile.order = .
-source.. = src/
-output.. = bin/
-
+bin.includes = .,\
+ model/,\
+ about.html,\
+ META-INF/,\
+ plugin.xml,\
+ plugin.properties
+src.includes = about.html
+jars.compile.order = .
+source.. = src/
+output.. = bin/
+
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core.model/plugin.properties b/examples/org.eclipse.emf.examples.databinding.project.core.model/plugin.properties
index dd60f5076..6e814942a 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core.model/plugin.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.core.model/plugin.properties
@@ -1,2 +1,2 @@
-pluginName = EMF Data Binding Example Model Project
-providerName = Eclipse Modeling Project
+pluginName = EMF Data Binding Example Model Project
+providerName = Eclipse Modeling Project
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core/META-INF/MANIFEST.MF b/examples/org.eclipse.emf.examples.databinding.project.core/META-INF/MANIFEST.MF
index 339a4bce1..e58d8fb20 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.emf.examples.databinding.project.core/META-INF/MANIFEST.MF
@@ -1,16 +1,16 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.emf.examples.databinding.project.core
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.emf.examples.databinding.project.core.internal.Activator
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.emf.ecore.xmi,
- org.eclipse.emf.edit
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.emf.examples.databinding.project.core
-Service-Component: META-INF/component.xml, META-INF/xmiprovider.xml
-Import-Package: org.eclipse.emf.examples.databinding.project.core.model.project
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.emf.examples.databinding.project.core
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.emf.examples.databinding.project.core.internal.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.emf.ecore.xmi,
+ org.eclipse.emf.edit
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.eclipse.emf.examples.databinding.project.core
+Service-Component: META-INF/component.xml, META-INF/xmiprovider.xml
+Import-Package: org.eclipse.emf.examples.databinding.project.core.model.project
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core/about.html b/examples/org.eclipse.emf.examples.databinding.project.core/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core/about.html
+++ b/examples/org.eclipse.emf.examples.databinding.project.core/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core/build.properties b/examples/org.eclipse.emf.examples.databinding.project.core/build.properties
index 214ae2d30..ea78d1c31 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core/build.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.core/build.properties
@@ -1,10 +1,10 @@
-bin.includes = META-INF/,\
- .,\
- about.html,\
- META-INF/xmiprovider.xml,\
- META-INF/component.xml,\
- plugin.properties
-src.includes = about.html
-output.. = bin/
-source.. = src/
-
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ META-INF/xmiprovider.xml,\
+ META-INF/component.xml,\
+ plugin.properties
+src.includes = about.html
+output.. = bin/
+source.. = src/
+
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core/plugin.properties b/examples/org.eclipse.emf.examples.databinding.project.core/plugin.properties
index 48d52f10e..050234971 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core/plugin.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.core/plugin.properties
@@ -1,2 +1,2 @@
-pluginName = EMF Data Binding Example Project
+pluginName = EMF Data Binding Example Project
providerName = Eclipse Modeling Project \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.core/src/org/eclipse/emf/examples/databinding/project/core/internal/Activator.java b/examples/org.eclipse.emf.examples.databinding.project.core/src/org/eclipse/emf/examples/databinding/project/core/internal/Activator.java
index 911c98fe8..8d3dffcbd 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.core/src/org/eclipse/emf/examples/databinding/project/core/internal/Activator.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.core/src/org/eclipse/emf/examples/databinding/project/core/internal/Activator.java
@@ -1,68 +1,68 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.examples.databinding.project.core.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends Plugin
-{
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.emf.examples.databinding.project.core";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator()
- {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault()
- {
- return plugin;
- }
-
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.examples.databinding.project.core.internal;
+
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin
+{
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.emf.examples.databinding.project.core";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator()
+ {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception
+ {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception
+ {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault()
+ {
+ return plugin;
+ }
+
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/META-INF/MANIFEST.MF b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/META-INF/MANIFEST.MF
index 3df35f017..fe6d7cfc0 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/META-INF/MANIFEST.MF
@@ -1,22 +1,22 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Bundle-SymbolicName: org.eclipse.emf.examples.databinding.project.ui.rcp;singleton:=true
-Bundle-Version: 1.0.0.qualifier
-Bundle-Activator: org.eclipse.emf.example.databinding.project.ui.rcp.Activator
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.core.databinding,
- org.eclipse.core.databinding.property,
- org.eclipse.jface.databinding,
- org.eclipse.ui.forms,
- org.eclipse.emf.databinding,
- org.eclipse.emf.databinding.edit,
- org.eclipse.emf.examples.databinding.project.core;bundle-version="1.0.0",
- org.eclipse.core.expressions,
- org.eclipse.emf.ecore.xmi
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.emf.examples.databinding.project.core.model.project
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.eclipse.emf.examples.databinding.project.ui.rcp;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.emf.example.databinding.project.ui.rcp.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.databinding,
+ org.eclipse.core.databinding.property,
+ org.eclipse.jface.databinding,
+ org.eclipse.ui.forms,
+ org.eclipse.emf.databinding,
+ org.eclipse.emf.databinding.edit,
+ org.eclipse.emf.examples.databinding.project.core;bundle-version="1.0.0",
+ org.eclipse.core.expressions,
+ org.eclipse.emf.ecore.xmi
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Import-Package: org.eclipse.emf.examples.databinding.project.core.model.project
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/about.html b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/about.html
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/build.properties b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/build.properties
index b736e3a2c..cac19fe67 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/build.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/build.properties
@@ -1,8 +1,8 @@
-bin.includes = plugin.xml,\
- META-INF/,\
- about.html,\
- .,\
- plugin.properties
-output.. = bin/
-source.. = src/
-
+bin.includes = plugin.xml,\
+ META-INF/,\
+ about.html,\
+ .,\
+ plugin.properties
+output.. = bin/
+source.. = src/
+
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/icons/alt_launcher.xpm b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/icons/alt_launcher.xpm
index b0c139e06..0ff90332a 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/icons/alt_launcher.xpm
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/icons/alt_launcher.xpm
@@ -1,307 +1,307 @@
-/* XPM */
-static char * icon48_xpm[] = {
-"48 48 256 2",
-" c #4B4B3B3B9090",
-". c #0D0D0E0E5454",
-"X c #11110E0E5B5B",
-"o c #17170F0F6363",
-"O c #1D1D13136969",
-"+ c #212114146C6C",
-"@ c #252514147171",
-"# c #282811116C6C",
-"$ c #26260D0D6363",
-"% c #22220B0B5E5E",
-"& c #1C1C0B0B5A5A",
-"* c #1C1C0B0B5252",
-"= c #1B1B05055353",
-"- c #161606064D4D",
-"; c #161605054949",
-": c #111104044848",
-"> c #131304044545",
-", c #131305054242",
-"< c #141410105E5E",
-"1 c #2C2C15157373",
-"2 c #2B2B1B1B7575",
-"3 c #343416167272",
-"4 c #313113136E6E",
-"5 c #222209095757",
-"6 c #1B1B06064D4D",
-"7 c #15150B0B4242",
-"8 c #13130C0C5555",
-"9 c #2E2E1B1B7878",
-"0 c #33331F1F7C7C",
-"q c #343418187878",
-"w c #3B3B1C1C7575",
-"e c #2E2E10106767",
-"r c #1B1B07074747",
-"t c #18180B0B4646",
-"y c #151513136262",
-"u c #1A1A15156464",
-"i c #34341F1F7777",
-"p c #40401E1E8080",
-"a c #42421B1B7A7A",
-"s c #3B3B15157474",
-"d c #2B2B0B0B5B5B",
-"f c #222207075252",
-"g c #373727277A7A",
-"h c #474724248484",
-"j c #393915156E6E",
-"k c #373711116A6A",
-"l c #343413136363",
-"z c #232319196E6E",
-"x c #292919197070",
-"c c #3C3C2C2C8282",
-"v c #444431318585",
-"b c #494934348A8A",
-"n c #505026268A8A",
-"m c #3D3D1B1B6E6E",
-"M c #31310E0E5C5C",
-"N c #2B2B0D0D5353",
-"B c #222207074A4A",
-"V c #52523C3C9292",
-"C c #58583C3C9494",
-"Z c #5D5D44449797",
-"A c #5C5C2E2E9292",
-"S c #676733339595",
-"D c #424228287575",
-"F c #29290A0A4F4F",
-"G c #6C6C4A4A9E9E",
-"H c #72725454A7A7",
-"J c #8C8C6D6DB2B2",
-"K c #343424246E6E",
-"L c #3A3A23236A6A",
-"P c #3A3A1C1C6767",
-"I c #24240A0A4B4B",
-"U c #151518186161",
-"Y c #76766F6FA5A5",
-"T c #ADAD9191CCCC",
-"R c #98988989D3D3",
-"E c #45453B3B8686",
-"W c #3C3C35357979",
-"Q c #363631317575",
-"! c #32322D2D6B6B",
-"~ c #323229296363",
-"^ c #30301F1F6262",
-"/ c #323218185E5E",
-"( c #272707074B4B",
-") c #202028286C6C",
-"_ c #1E1E1D1D6868",
-"` c #9A9A8282BBBB",
-"' c #C8C8B3B3D3D3",
-"] c #B3B3AFAFE7E7",
-"[ c #84847272C6C6",
-"{ c #58585757A3A3",
-"} c #3F3F3C3C8A8A",
-"| c #3B3B3A3A8484",
-" . c #414139397D7D",
-".. c #3D3D39397A7A",
-"X. c #37372E2E6E6E",
-"o. c #2C2C21215A5A",
-"O. c #2E2E1B1B5B5B",
-"+. c #F5F5EFEFF5F5",
-"@. c #656566669A9A",
-"#. c #47474B4B8E8E",
-"$. c #3C3C44447B7B",
-"%. c #444442428080",
-"&. c #45453E3E8181",
-"*. c #40403C3C8181",
-"=. c #3D3D33337474",
-"-. c #3B3B30306E6E",
-";. c #38382D2D6969",
-":. c #303026265D5D",
-">. c #2C2C15155A5A",
-",. c #1F1F1C1C7070",
-"<. c #25251E1E7171",
-"1. c #59595C5C9191",
-"2. c #4D4D53538989",
-"3. c #4C4C49498484",
-"4. c #484845458585",
-"5. c #494941418585",
-"6. c #494940408181",
-"7. c #2F2F1C1C5353",
-"8. c #2B2B28287676",
-"9. c #323231317F7F",
-"0. c #545452528B8B",
-"q. c #51514E4E8989",
-"w. c #4E4E4B4B8C8C",
-"e. c #4C4C47478686",
-"r. c #46463D3D7E7E",
-"t. c #434336367A7A",
-"y. c #2B2B13135555",
-"u. c #47473D3D8D8D",
-"i. c #575757578E8E",
-"p. c #48483E3E7F7F",
-"a. c #46463A3A7D7D",
-"s. c #424235357575",
-"d. c #404034347171",
-"f. c #BFBFCBCBFAFA",
-"g. c #B8B8A8A8DDDD",
-"h. c #5E5E60609292",
-"j. c #565655558C8C",
-"k. c #4B4B44448282",
-"l. c #454539397B7B",
-"z. c #434338387878",
-"x. c #3F3F32326D6D",
-"c. c #3D3D30306969",
-"v. c #3A3A2E2E6363",
-"b. c #36362A2A5C5C",
-"n. c #343424245555",
-"m. c #30301E1E4D4D",
-"M. c #49493C3C8282",
-"N. c #5E5E4F4F8C8C",
-"B. c #56563B3B8B8B",
-"V. c #545407078585",
-"C. c #424234347272",
-"Z. c #9797A4A4F7F7",
-"A. c #444436367676",
-"S. c #7D7D7979D5D5",
-"D. c #464640408A8A",
-"F. c #44444B4B8282",
-"G. c #414107077777",
-"H. c #71716161C1C1",
-"J. c #303039397979",
-"K. c #8E8E8E8EE6E6",
-"L. c #404033338B8B",
-"P. c #4A4A45458C8C",
-"I. c #46463A3A8080",
-"U. c #363629295454",
-"Y. c #303022224848",
-"T. c #424237377575",
-"R. c #2E2E1D1D6363",
-"E. c #79798383EAEA",
-"W. c #74747B7BE4E4",
-"Q. c #6D6D7676D6D6",
-"!. c #6A6A7171CECE",
-"~. c #66666969C6C6",
-"^. c #62626565BCBC",
-"/. c #5F5F6060B5B5",
-"(. c #5B5B5B5BACAC",
-"). c #535353539898",
-"_. c #4F4F4F4FA4A4",
-"`. c #54544D4DA4A4",
-"'. c #323204046B6B",
-"]. c #303035357979",
-"[. c #313122224343",
-"{. c #5A5A5B5BB7B7",
-"}. c #484846468080",
-"|. c #454541417575",
-" X c #4B4B31318282",
-".X c #47473C3C8484",
-"XX c #3E3E35356E6E",
-"oX c #2F2F26264040",
-"OX c #2B2B23233A3A",
-"+X c #262619195C5C",
-"@X c #252515155A5A",
-"#X c #55555151B3B3",
-"$X c #3C3C2D2D5D5D",
-"%X c #39392F2F5656",
-"&X c #37372D2D5050",
-"*X c #25251F1F3030",
-"=X c #24241D1D4343",
-"-X c #202013135656",
-";X c #41413B3B6C6C",
-":X c #444442429696",
-">X c #212100005E5E",
-",X c #444436367272",
-"<X c #444436366F6F",
-"1X c #424236366868",
-"2X c #3F3F34346161",
-"3X c #3C3C32325A5A",
-"4X c #34342A2A4A4A",
-"5X c #21211B1B2121",
-"6X c #22221C1C6363",
-"7X c #2D2D01015E5E",
-"8X c #20201B1B2525",
-"9X c #49492F2F7B7B",
-"0X c #434334346C6C",
-"qX c #323229294545",
-"wX c #1C1C10104F4F",
-"eX c #222217176363",
-"rX c #37371E1E6B6B",
-"tX c #424232326E6E",
-"yX c #444433336969",
-"uX c #424233336565",
-"iX c #1E1E1A1A1E1E",
-"pX c #161601014C4C",
-"aX c #1C1C11115454",
-"sX c #252503035B5B",
-"dX c #414131316A6A",
-"fX c #22221F1F7878",
-"gX c #272724246767",
-"hX c #1D1D16165E5E",
-"jX c #131305055151",
-"kX c #40402F2F6464",
-"lX c #111107074E4E",
-"zX c #0C0C05054B4B",
-"xX c #22221E1E5757",
-"cX c #1A1A0D0D4D4D",
-"vX c #16160B0B4D4D",
-"bX c #060604044747",
-"nX c #040403034343",
-"mX c #3B3B27276565",
-"MX c #0E0E03034141",
-"NX c #111106064A4A",
-"BX c #0E0E04044646",
-"VX c #111105053B3B",
-"CX c #0D0D01013A3A",
-"ZX c #030305053F3F",
-"AX c #0F0F0F0F4C4C",
-"SX c #020207073B3B",
-"DX c #0D0D03034646",
-"FX c #0B0B02023F3F",
-"GX c #0D0D02023434",
-"HX c #0A0A0E0E4444",
-"JX c #161614145252",
-"KX c #0B0B04044646",
-"LX c #0A0A03034444",
-"PX c #1D1D21215757",
-"IX c #090910104040",
-"UX c #18181E1E5353",
-" ",
-" . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , , ",
-" . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7 ",
-" . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t ",
-" . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t ",
-" X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r ",
-" X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r ",
-" < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r ",
-" < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r ",
-" U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r ",
-" ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } | .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r ",
-" ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B ",
-" ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I ",
-" ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I ",
-" 8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I ",
-" 9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I ",
-" <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F ",
-" + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y. ",
-" O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y. ",
-" O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y. ",
-" O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y. ",
-" $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>. ",
-" E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._. ",
-" + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>. ",
-" ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.} ",
-" .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X ",
-" E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._. ",
-" & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X ",
-" {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} } ",
-" & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X ",
-" & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X ",
-" 8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX ",
-" 8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX ",
-" 6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX ",
-" Y Y .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX ",
-" gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX ",
-" 8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX ",
-" zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX ",
-" bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX ",
-" nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX ",
-" nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t ",
-" nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7 ",
-" ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7 ",
-" SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7 ",
-" SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX ",
-" SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX ",
-" IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX ",
-" "};
+/* XPM */
+static char * icon48_xpm[] = {
+"48 48 256 2",
+" c #4B4B3B3B9090",
+". c #0D0D0E0E5454",
+"X c #11110E0E5B5B",
+"o c #17170F0F6363",
+"O c #1D1D13136969",
+"+ c #212114146C6C",
+"@ c #252514147171",
+"# c #282811116C6C",
+"$ c #26260D0D6363",
+"% c #22220B0B5E5E",
+"& c #1C1C0B0B5A5A",
+"* c #1C1C0B0B5252",
+"= c #1B1B05055353",
+"- c #161606064D4D",
+"; c #161605054949",
+": c #111104044848",
+"> c #131304044545",
+", c #131305054242",
+"< c #141410105E5E",
+"1 c #2C2C15157373",
+"2 c #2B2B1B1B7575",
+"3 c #343416167272",
+"4 c #313113136E6E",
+"5 c #222209095757",
+"6 c #1B1B06064D4D",
+"7 c #15150B0B4242",
+"8 c #13130C0C5555",
+"9 c #2E2E1B1B7878",
+"0 c #33331F1F7C7C",
+"q c #343418187878",
+"w c #3B3B1C1C7575",
+"e c #2E2E10106767",
+"r c #1B1B07074747",
+"t c #18180B0B4646",
+"y c #151513136262",
+"u c #1A1A15156464",
+"i c #34341F1F7777",
+"p c #40401E1E8080",
+"a c #42421B1B7A7A",
+"s c #3B3B15157474",
+"d c #2B2B0B0B5B5B",
+"f c #222207075252",
+"g c #373727277A7A",
+"h c #474724248484",
+"j c #393915156E6E",
+"k c #373711116A6A",
+"l c #343413136363",
+"z c #232319196E6E",
+"x c #292919197070",
+"c c #3C3C2C2C8282",
+"v c #444431318585",
+"b c #494934348A8A",
+"n c #505026268A8A",
+"m c #3D3D1B1B6E6E",
+"M c #31310E0E5C5C",
+"N c #2B2B0D0D5353",
+"B c #222207074A4A",
+"V c #52523C3C9292",
+"C c #58583C3C9494",
+"Z c #5D5D44449797",
+"A c #5C5C2E2E9292",
+"S c #676733339595",
+"D c #424228287575",
+"F c #29290A0A4F4F",
+"G c #6C6C4A4A9E9E",
+"H c #72725454A7A7",
+"J c #8C8C6D6DB2B2",
+"K c #343424246E6E",
+"L c #3A3A23236A6A",
+"P c #3A3A1C1C6767",
+"I c #24240A0A4B4B",
+"U c #151518186161",
+"Y c #76766F6FA5A5",
+"T c #ADAD9191CCCC",
+"R c #98988989D3D3",
+"E c #45453B3B8686",
+"W c #3C3C35357979",
+"Q c #363631317575",
+"! c #32322D2D6B6B",
+"~ c #323229296363",
+"^ c #30301F1F6262",
+"/ c #323218185E5E",
+"( c #272707074B4B",
+") c #202028286C6C",
+"_ c #1E1E1D1D6868",
+"` c #9A9A8282BBBB",
+"' c #C8C8B3B3D3D3",
+"] c #B3B3AFAFE7E7",
+"[ c #84847272C6C6",
+"{ c #58585757A3A3",
+"} c #3F3F3C3C8A8A",
+"| c #3B3B3A3A8484",
+" . c #414139397D7D",
+".. c #3D3D39397A7A",
+"X. c #37372E2E6E6E",
+"o. c #2C2C21215A5A",
+"O. c #2E2E1B1B5B5B",
+"+. c #F5F5EFEFF5F5",
+"@. c #656566669A9A",
+"#. c #47474B4B8E8E",
+"$. c #3C3C44447B7B",
+"%. c #444442428080",
+"&. c #45453E3E8181",
+"*. c #40403C3C8181",
+"=. c #3D3D33337474",
+"-. c #3B3B30306E6E",
+";. c #38382D2D6969",
+":. c #303026265D5D",
+">. c #2C2C15155A5A",
+",. c #1F1F1C1C7070",
+"<. c #25251E1E7171",
+"1. c #59595C5C9191",
+"2. c #4D4D53538989",
+"3. c #4C4C49498484",
+"4. c #484845458585",
+"5. c #494941418585",
+"6. c #494940408181",
+"7. c #2F2F1C1C5353",
+"8. c #2B2B28287676",
+"9. c #323231317F7F",
+"0. c #545452528B8B",
+"q. c #51514E4E8989",
+"w. c #4E4E4B4B8C8C",
+"e. c #4C4C47478686",
+"r. c #46463D3D7E7E",
+"t. c #434336367A7A",
+"y. c #2B2B13135555",
+"u. c #47473D3D8D8D",
+"i. c #575757578E8E",
+"p. c #48483E3E7F7F",
+"a. c #46463A3A7D7D",
+"s. c #424235357575",
+"d. c #404034347171",
+"f. c #BFBFCBCBFAFA",
+"g. c #B8B8A8A8DDDD",
+"h. c #5E5E60609292",
+"j. c #565655558C8C",
+"k. c #4B4B44448282",
+"l. c #454539397B7B",
+"z. c #434338387878",
+"x. c #3F3F32326D6D",
+"c. c #3D3D30306969",
+"v. c #3A3A2E2E6363",
+"b. c #36362A2A5C5C",
+"n. c #343424245555",
+"m. c #30301E1E4D4D",
+"M. c #49493C3C8282",
+"N. c #5E5E4F4F8C8C",
+"B. c #56563B3B8B8B",
+"V. c #545407078585",
+"C. c #424234347272",
+"Z. c #9797A4A4F7F7",
+"A. c #444436367676",
+"S. c #7D7D7979D5D5",
+"D. c #464640408A8A",
+"F. c #44444B4B8282",
+"G. c #414107077777",
+"H. c #71716161C1C1",
+"J. c #303039397979",
+"K. c #8E8E8E8EE6E6",
+"L. c #404033338B8B",
+"P. c #4A4A45458C8C",
+"I. c #46463A3A8080",
+"U. c #363629295454",
+"Y. c #303022224848",
+"T. c #424237377575",
+"R. c #2E2E1D1D6363",
+"E. c #79798383EAEA",
+"W. c #74747B7BE4E4",
+"Q. c #6D6D7676D6D6",
+"!. c #6A6A7171CECE",
+"~. c #66666969C6C6",
+"^. c #62626565BCBC",
+"/. c #5F5F6060B5B5",
+"(. c #5B5B5B5BACAC",
+"). c #535353539898",
+"_. c #4F4F4F4FA4A4",
+"`. c #54544D4DA4A4",
+"'. c #323204046B6B",
+"]. c #303035357979",
+"[. c #313122224343",
+"{. c #5A5A5B5BB7B7",
+"}. c #484846468080",
+"|. c #454541417575",
+" X c #4B4B31318282",
+".X c #47473C3C8484",
+"XX c #3E3E35356E6E",
+"oX c #2F2F26264040",
+"OX c #2B2B23233A3A",
+"+X c #262619195C5C",
+"@X c #252515155A5A",
+"#X c #55555151B3B3",
+"$X c #3C3C2D2D5D5D",
+"%X c #39392F2F5656",
+"&X c #37372D2D5050",
+"*X c #25251F1F3030",
+"=X c #24241D1D4343",
+"-X c #202013135656",
+";X c #41413B3B6C6C",
+":X c #444442429696",
+">X c #212100005E5E",
+",X c #444436367272",
+"<X c #444436366F6F",
+"1X c #424236366868",
+"2X c #3F3F34346161",
+"3X c #3C3C32325A5A",
+"4X c #34342A2A4A4A",
+"5X c #21211B1B2121",
+"6X c #22221C1C6363",
+"7X c #2D2D01015E5E",
+"8X c #20201B1B2525",
+"9X c #49492F2F7B7B",
+"0X c #434334346C6C",
+"qX c #323229294545",
+"wX c #1C1C10104F4F",
+"eX c #222217176363",
+"rX c #37371E1E6B6B",
+"tX c #424232326E6E",
+"yX c #444433336969",
+"uX c #424233336565",
+"iX c #1E1E1A1A1E1E",
+"pX c #161601014C4C",
+"aX c #1C1C11115454",
+"sX c #252503035B5B",
+"dX c #414131316A6A",
+"fX c #22221F1F7878",
+"gX c #272724246767",
+"hX c #1D1D16165E5E",
+"jX c #131305055151",
+"kX c #40402F2F6464",
+"lX c #111107074E4E",
+"zX c #0C0C05054B4B",
+"xX c #22221E1E5757",
+"cX c #1A1A0D0D4D4D",
+"vX c #16160B0B4D4D",
+"bX c #060604044747",
+"nX c #040403034343",
+"mX c #3B3B27276565",
+"MX c #0E0E03034141",
+"NX c #111106064A4A",
+"BX c #0E0E04044646",
+"VX c #111105053B3B",
+"CX c #0D0D01013A3A",
+"ZX c #030305053F3F",
+"AX c #0F0F0F0F4C4C",
+"SX c #020207073B3B",
+"DX c #0D0D03034646",
+"FX c #0B0B02023F3F",
+"GX c #0D0D02023434",
+"HX c #0A0A0E0E4444",
+"JX c #161614145252",
+"KX c #0B0B04044646",
+"LX c #0A0A03034444",
+"PX c #1D1D21215757",
+"IX c #090910104040",
+"UX c #18181E1E5353",
+" ",
+" . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , , ",
+" . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7 ",
+" . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t ",
+" . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t ",
+" X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r ",
+" X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r ",
+" < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r ",
+" < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r ",
+" U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r ",
+" ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } | .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r ",
+" ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B ",
+" ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I ",
+" ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I ",
+" 8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I ",
+" 9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I ",
+" <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F ",
+" + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y. ",
+" O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y. ",
+" O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y. ",
+" O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y. ",
+" $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>. ",
+" E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._. ",
+" + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>. ",
+" ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.} ",
+" .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X ",
+" E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._. ",
+" & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X ",
+" {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} } ",
+" & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X ",
+" & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X ",
+" 8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX ",
+" 8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX ",
+" 6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX ",
+" Y Y .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX ",
+" gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX ",
+" 8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX ",
+" zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX ",
+" bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX ",
+" nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX ",
+" nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t ",
+" nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7 ",
+" ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7 ",
+" SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7 ",
+" SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX ",
+" SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX ",
+" IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX ",
+" "};
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.properties b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.properties
index 498622881..8ad8a4d50 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.properties
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.properties
@@ -1,23 +1,23 @@
-pluginName = EMF Data Binding Example RCP Project
-providerName = Eclipse Modeling Project
-perspective.name = RCP Perspective
-view.name = Project Administration
-command.name = New Person
-commandParameter.name = Action
-command.name.0 = Edit Person
-commandParameter.name.0 = Action
-command.name.1 = Open XMI
-command.name.2 = New XMI
-command.name.3 = New Toplevel Project
-command.name.4 = New Sublevel Project
-command.name.5 = New Committership
-command.name.6 = Edit Committership
-command.label = Edit Person
-command.label.0 = Add Committership
-command.label.1 = Edit Committership
-command.label.2 = Add Subproject
-command.label.3 = XMI Resource ...
-command.label.4 = XMI Resource ...
-command.label.5 = Sublevel Project
-command.label.6 = Toplevel Project
+pluginName = EMF Data Binding Example RCP Project
+providerName = Eclipse Modeling Project
+perspective.name = RCP Perspective
+view.name = Project Administration
+command.name = New Person
+commandParameter.name = Action
+command.name.0 = Edit Person
+commandParameter.name.0 = Action
+command.name.1 = Open XMI
+command.name.2 = New XMI
+command.name.3 = New Toplevel Project
+command.name.4 = New Sublevel Project
+command.name.5 = New Committership
+command.name.6 = Edit Committership
+command.label = Edit Person
+command.label.0 = Add Committership
+command.label.1 = Edit Committership
+command.label.2 = Add Subproject
+command.label.3 = XMI Resource ...
+command.label.4 = XMI Resource ...
+command.label.5 = Sublevel Project
+command.label.6 = Toplevel Project
command.label.7 = Person ... \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.xml b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.xml
index f690497d8..edd827e02 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.xml
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/plugin.xml
@@ -1,344 +1,344 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
- <extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.eclipse.emf.example.databinding.project.ui.rcp.Application">
- </run>
- </application>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="%perspective.name"
- class="org.eclipse.emf.example.databinding.project.ui.rcp.Perspective"
- id="org.eclipse.emf.example.project.ui.rcp.perspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <view
- allowMultiple="true"
- class="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
- id="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
- name="%view.name"
- restorable="true">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.services">
- <sourceProvider
- provider="org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider">
- <variable
- name="modelresource"
- priorityLevel="activePartId">
- </variable>
- <variable
- name="committer"
- priorityLevel="activePartId">
- </variable>
- <variable
- name="project"
- priorityLevel="activePartId">
- </variable>
- </sourceProvider>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
- name="%command.name">
- <commandParameter
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
- name="%commandParameter.name"
- optional="true"
- values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
- </commandParameter>
- </command>
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
- name="%command.name.0">
- <commandParameter
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
- name="%commandParameter.name.0"
- optional="true"
- values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
- </commandParameter>
- </command>
- <command
- defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.OpenXMIHandler"
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
- name="%command.name.1">
- </command>
- <command
- defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.NewXMIHandler"
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
- name="%command.name.2">
- </command>
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
- name="%command.name.3">
- </command>
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
- name="%command.name.4">
- </command>
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
- name="%command.name.5">
- </command>
- <command
- id="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
- name="%command.name.6">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.menus">
- <menuContribution
- locationURI="popup:org.eclipse.emf.examples.databinding.project.ui.rcp.projectexp?after=additions">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
- label="%command.label"
- style="push">
- <parameter
- name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
- value="edit">
- </parameter>
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
- label="%command.label.0"
- style="push">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="activeMenuSelection">
- <and>
- <count
- value="1">
- </count>
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
- </instanceof>
- </iterate>
- </and>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
- label="%command.label.1"
- style="push">
- <visibleWhen
- checkEnabled="true">
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
- label="%command.label.2"
- style="push">
- <visibleWhen
- checkEnabled="true">
- <with
- variable="activeMenuSelection">
- <and>
- <count
- value="1">
- </count>
- <iterate
- ifEmpty="false"
- operator="and">
- <instanceof
- value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
- </instanceof>
- </iterate>
- </and>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:open?after=additions">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
- label="%command.label.3"
- style="push">
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:new?before=after_resource">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
- label="%command.label.4"
- style="push">
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:new?after=after_resource">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
- label="%command.label.5"
- style="push">
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:new?after=after_resource">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
- label="%command.label.6"
- style="push">
- </command>
- </menuContribution>
- <menuContribution
- locationURI="menu:new?after=after_resource">
- <command
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
- label="%command.label.7"
- style="push">
- <parameter
- name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
- value="new">
- </parameter>
- </command>
- </menuContribution>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson">
- <enabledWhen>
- <and>
- <with
- variable="committer">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </and>
-
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateToplevelProjectHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject">
- <enabledWhen>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateSublevelProjectHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject">
- <enabledWhen>
- <and>
- <with
- variable="project">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </and>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateCommittershipHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership">
- <enabledWhen>
- <and>
- <with
- variable="project">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </and>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson">
- <enabledWhen>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </enabledWhen>
- </handler>
- <handler
- class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.EditCommittershipHandler"
- commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership">
- <enabledWhen>
- <and>
- <with
- variable="committer">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- <with
- variable="modelresource">
- <not>
- <equals
- value="null">
- </equals>
- </not>
- </with>
- </and>
- </enabledWhen>
- </handler>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ id="application"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.Application">
+ </run>
+ </application>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="%perspective.name"
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.Perspective"
+ id="org.eclipse.emf.example.project.ui.rcp.perspective">
+ </perspective>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ allowMultiple="true"
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
+ id="org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart"
+ name="%view.name"
+ restorable="true">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.services">
+ <sourceProvider
+ provider="org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider">
+ <variable
+ name="modelresource"
+ priorityLevel="activePartId">
+ </variable>
+ <variable
+ name="committer"
+ priorityLevel="activePartId">
+ </variable>
+ <variable
+ name="project"
+ priorityLevel="activePartId">
+ </variable>
+ </sourceProvider>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
+ name="%command.name">
+ <commandParameter
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
+ name="%commandParameter.name"
+ optional="true"
+ values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
+ </commandParameter>
+ </command>
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
+ name="%command.name.0">
+ <commandParameter
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
+ name="%commandParameter.name.0"
+ optional="true"
+ values="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonParamValues">
+ </commandParameter>
+ </command>
+ <command
+ defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.OpenXMIHandler"
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
+ name="%command.name.1">
+ </command>
+ <command
+ defaultHandler="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.NewXMIHandler"
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
+ name="%command.name.2">
+ </command>
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
+ name="%command.name.3">
+ </command>
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
+ name="%command.name.4">
+ </command>
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
+ name="%command.name.5">
+ </command>
+ <command
+ id="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
+ name="%command.name.6">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:org.eclipse.emf.examples.databinding.project.ui.rcp.projectexp?after=additions">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson"
+ label="%command.label"
+ style="push">
+ <parameter
+ name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
+ value="edit">
+ </parameter>
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership"
+ label="%command.label.0"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
+ </instanceof>
+ </iterate>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership"
+ label="%command.label.1"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ </visibleWhen>
+ </command>
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
+ label="%command.label.2"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="activeMenuSelection">
+ <and>
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <instanceof
+ value="org.eclipse.emf.examples.databinding.project.core.model.project.Project">
+ </instanceof>
+ </iterate>
+ </and>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:open?after=additions">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.openxmi"
+ label="%command.label.3"
+ style="push">
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:new?before=after_resource">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newxmi"
+ label="%command.label.4"
+ style="push">
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:new?after=after_resource">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject"
+ label="%command.label.5"
+ style="push">
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:new?after=after_resource">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject"
+ label="%command.label.6"
+ style="push">
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="menu:new?after=after_resource">
+ <command
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson"
+ label="%command.label.7"
+ style="push">
+ <parameter
+ name="org.eclipse.emf.examples.databinding.project.ui.rcp.person.action"
+ value="new">
+ </parameter>
+ </command>
+ </menuContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editperson">
+ <enabledWhen>
+ <and>
+ <with
+ variable="committer">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </and>
+
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateToplevelProjectHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createtopproject">
+ <enabledWhen>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateSublevelProjectHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.createsubproject">
+ <enabledWhen>
+ <and>
+ <with
+ variable="project">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </and>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateCommittershipHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newcommittership">
+ <enabledWhen>
+ <and>
+ <with
+ variable="project">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </and>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.PersonEditingHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.newperson">
+ <enabledWhen>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </enabledWhen>
+ </handler>
+ <handler
+ class="org.eclipse.emf.example.databinding.project.ui.rcp.handlers.EditCommittershipHandler"
+ commandId="org.eclipse.emf.examples.databinding.project.ui.rcp.editcommittership">
+ <enabledWhen>
+ <and>
+ <with
+ variable="committer">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ <with
+ variable="modelresource">
+ <not>
+ <equals
+ value="null">
+ </equals>
+ </not>
+ </with>
+ </and>
+ </enabledWhen>
+ </handler>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/Activator.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/Activator.java
index b912d7af8..004b7df69 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/Activator.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/Activator.java
@@ -1,146 +1,146 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import org.eclipse.emf.examples.databinding.project.core.IModelLoadingService;
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.util.tracker.ServiceTracker;
-
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class Activator extends AbstractUIPlugin implements ServiceListener
-{
-
- /**
- * The plug-in ID
- */
- public static final String PLUGIN_ID = "org.eclipse.emf.examples.databinding.project.ui.rcp";
-
- // The shared instance
- private static Activator plugin;
-
- private ServiceTracker tracker;
-
- private IModelLoadingService loadingService;
-
- private BundleContext context;
-
- /**
- * The constructor
- */
- public Activator()
- {
- }
-
- @Override
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- this.context = context;
- plugin = this;
-
- tracker = new ServiceTracker(context, IModelLoadingService.class.getName(), null);
- tracker.open();
-
- loadingService = (IModelLoadingService)tracker.getService();
-
- context.addServiceListener(this, "(objectclass=" + IModelLoadingService.class.getName() + ")");
- }
-
- @Override
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- tracker.close();
- tracker = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault()
- {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path)
- {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-
- /**
- * Load the model resource
- * @param uri the uri
- * @return the resource
- */
- public IModelResource loadResource(String uri)
- {
- if (loadingService != null)
- {
- return loadingService.findAndLoadResource(uri);
- }
- else
- {
- getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Model loading service not available"));
- }
-
- return null;
- }
-
- public void serviceChanged(ServiceEvent event)
- {
- ServiceReference sr = event.getServiceReference();
- switch (event.getType())
- {
- case ServiceEvent.REGISTERED: {
- loadingService = (IModelLoadingService)context.getService(sr);
- }
- break;
- case ServiceEvent.UNREGISTERING: {
- loadingService = null;
- }
- break;
- }
- }
-
- public void log(Throwable throwable)
- {
- String message = throwable.getLocalizedMessage();
- if (message == null)
- {
- message = "";
- }
-
- getLog().log(new Status(IStatus.WARNING, getBundle().getSymbolicName(), 0, message, throwable));
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+import org.eclipse.emf.examples.databinding.project.core.IModelLoadingService;
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceEvent;
+import org.osgi.framework.ServiceListener;
+import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin implements ServiceListener
+{
+
+ /**
+ * The plug-in ID
+ */
+ public static final String PLUGIN_ID = "org.eclipse.emf.examples.databinding.project.ui.rcp";
+
+ // The shared instance
+ private static Activator plugin;
+
+ private ServiceTracker tracker;
+
+ private IModelLoadingService loadingService;
+
+ private BundleContext context;
+
+ /**
+ * The constructor
+ */
+ public Activator()
+ {
+ }
+
+ @Override
+ public void start(BundleContext context) throws Exception
+ {
+ super.start(context);
+ this.context = context;
+ plugin = this;
+
+ tracker = new ServiceTracker(context, IModelLoadingService.class.getName(), null);
+ tracker.open();
+
+ loadingService = (IModelLoadingService)tracker.getService();
+
+ context.addServiceListener(this, "(objectclass=" + IModelLoadingService.class.getName() + ")");
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception
+ {
+ plugin = null;
+ tracker.close();
+ tracker = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path)
+ {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ /**
+ * Load the model resource
+ * @param uri the uri
+ * @return the resource
+ */
+ public IModelResource loadResource(String uri)
+ {
+ if (loadingService != null)
+ {
+ return loadingService.findAndLoadResource(uri);
+ }
+ else
+ {
+ getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Model loading service not available"));
+ }
+
+ return null;
+ }
+
+ public void serviceChanged(ServiceEvent event)
+ {
+ ServiceReference sr = event.getServiceReference();
+ switch (event.getType())
+ {
+ case ServiceEvent.REGISTERED: {
+ loadingService = (IModelLoadingService)context.getService(sr);
+ }
+ break;
+ case ServiceEvent.UNREGISTERING: {
+ loadingService = null;
+ }
+ break;
+ }
+ }
+
+ public void log(Throwable throwable)
+ {
+ String message = throwable.getLocalizedMessage();
+ if (message == null)
+ {
+ message = "";
+ }
+
+ getLog().log(new Status(IStatus.WARNING, getBundle().getSymbolicName(), 0, message, throwable));
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/Base64ToImageConverter.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/Base64ToImageConverter.java
index 7a180f250..cbf0e4599 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/Base64ToImageConverter.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/Base64ToImageConverter.java
@@ -1,73 +1,73 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.databinding;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-
-
-/**
- * Converter which able to convert base64 encoded values into SWT-images.
- * The convert remembers the last created image and disposes when a new one is allocated but the
- * last image set on the control has to be disposed by the control itself
- */
-public class Base64ToImageConverter extends Converter
-{
- private Image lastImage;
- private Display display;
-
- /**
- * Create a new converter
- * @param display the display the images are created on
- */
- public Base64ToImageConverter(Display display)
- {
- super(String.class, Image.class);
- this.display = display;
- }
-
- public Object convert(Object fromObject)
- {
- if (lastImage != null && !lastImage.isDisposed())
- {
- lastImage.dispose();
- lastImage = null;
- }
-
- if (fromObject != null)
- {
- ByteArrayInputStream in = new ByteArrayInputStream(XMLTypeFactory.eINSTANCE.createBase64Binary(fromObject.toString()));
- Image img = new Image(display, in);
-
- try
- {
- in.close();
- }
- catch (IOException e)
- {
- Activator.getDefault().log(e);
- }
-
- lastImage = img;
-
- return img;
- }
-
- return null;
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.databinding;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+import org.eclipse.emf.ecore.xml.type.XMLTypeFactory;
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+
+
+/**
+ * Converter which able to convert base64 encoded values into SWT-images.
+ * The convert remembers the last created image and disposes when a new one is allocated but the
+ * last image set on the control has to be disposed by the control itself
+ */
+public class Base64ToImageConverter extends Converter
+{
+ private Image lastImage;
+ private Display display;
+
+ /**
+ * Create a new converter
+ * @param display the display the images are created on
+ */
+ public Base64ToImageConverter(Display display)
+ {
+ super(String.class, Image.class);
+ this.display = display;
+ }
+
+ public Object convert(Object fromObject)
+ {
+ if (lastImage != null && !lastImage.isDisposed())
+ {
+ lastImage.dispose();
+ lastImage = null;
+ }
+
+ if (fromObject != null)
+ {
+ ByteArrayInputStream in = new ByteArrayInputStream(XMLTypeFactory.eINSTANCE.createBase64Binary(fromObject.toString()));
+ Image img = new Image(display, in);
+
+ try
+ {
+ in.close();
+ }
+ catch (IOException e)
+ {
+ Activator.getDefault().log(e);
+ }
+
+ lastImage = img;
+
+ return img;
+ }
+
+ return null;
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/StringToDateConverter.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/StringToDateConverter.java
index 99d0d6ccf..08c5d3fe2 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/StringToDateConverter.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/databinding/StringToDateConverter.java
@@ -1,82 +1,82 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.databinding;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-
-
-/**
- * Convert a String to a date
- */
-public class StringToDateConverter extends Converter implements IValidator
-{
- private List<DateFormat> formats = new ArrayList<DateFormat>();
- private String message;
-
- /**
- * New converter
- * @param message message when conversion fails
- */
- public StringToDateConverter(String message)
- {
- super(String.class, Date.class);
- this.message = message;
- formats.add(DateFormat.getDateInstance(DateFormat.SHORT));
- formats.add(new SimpleDateFormat("yyyy-MM-dd"));
- }
-
- public Object convert(Object fromObject)
- {
- if (fromObject == null || fromObject.toString().trim().length() == 0)
- {
- return null;
- }
-
- for (DateFormat f : formats)
- {
- try
- {
- return f.parse(fromObject.toString());
- }
- catch (ParseException e)
- {
- // Ignore
- }
- }
-
- throw new RuntimeException(message);
- }
-
- public IStatus validate(Object value)
- {
- try
- {
- convert(value);
- }
- catch (Exception e)
- {
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message);
- }
- return Status.OK_STATUS;
- }
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.databinding;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+
+
+/**
+ * Convert a String to a date
+ */
+public class StringToDateConverter extends Converter implements IValidator
+{
+ private List<DateFormat> formats = new ArrayList<DateFormat>();
+ private String message;
+
+ /**
+ * New converter
+ * @param message message when conversion fails
+ */
+ public StringToDateConverter(String message)
+ {
+ super(String.class, Date.class);
+ this.message = message;
+ formats.add(DateFormat.getDateInstance(DateFormat.SHORT));
+ formats.add(new SimpleDateFormat("yyyy-MM-dd"));
+ }
+
+ public Object convert(Object fromObject)
+ {
+ if (fromObject == null || fromObject.toString().trim().length() == 0)
+ {
+ return null;
+ }
+
+ for (DateFormat f : formats)
+ {
+ try
+ {
+ return f.parse(fromObject.toString());
+ }
+ catch (ParseException e)
+ {
+ // Ignore
+ }
+ }
+
+ throw new RuntimeException(message);
+ }
+
+ public IStatus validate(Object value)
+ {
+ try
+ {
+ convert(value);
+ }
+ catch (Exception e)
+ {
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, message);
+ }
+ return Status.OK_STATUS;
+ }
} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/dialogs/CommitterShipDialog.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/dialogs/CommitterShipDialog.java
index 3f76e9952..ad0feeb53 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/dialogs/CommitterShipDialog.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/dialogs/CommitterShipDialog.java
@@ -1,200 +1,200 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.dialogs;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.ObservablesManager;
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport;
-import org.eclipse.jface.databinding.swt.IWidgetValueProperty;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.custom.ViewForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.databinding.EMFDataBindingContext;
-import org.eclipse.emf.databinding.EMFUpdateValueStrategy;
-import org.eclipse.emf.databinding.edit.EMFEditProperties;
-import org.eclipse.emf.databinding.edit.IEMFEditValueProperty;
-import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.EMFObservablesManager;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.UpdateStrategyFactory;
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
-
-
-/**
- * Dialog to edit the committer ship
- */
-public class CommitterShipDialog extends TitleAreaDialog
-{
- private final DataBindingContext ctx;
- private final CommitterShip committership;
- final IModelResource resource;
- private final boolean isnew;
-
- /**
- * Create new dialog
- * @param parentShell the parent shell
- * @param resource the resource
- * @param committership the committership instance
- * @param isnew flag to indicate if the committer ship is new
- */
- public CommitterShipDialog(Shell parentShell, IModelResource resource, CommitterShip committership, boolean isnew)
- {
- super(parentShell);
- this.committership = committership;
- this.resource = resource;
- this.isnew = isnew;
- this.ctx = new EMFDataBindingContext();
- }
-
- @Override
- protected Control createDialogArea(Composite parent)
- {
- getShell().setText("Edit Committership");
- setTitle("Edit Committership");
- setMessage("Edit the committership of a person in the project");
-
- final Composite comp = (Composite)super.createDialogArea(parent);
-
- ObservablesManager mgr = new EMFObservablesManager();
- mgr.runAndCollect(new Runnable()
- {
-
- public void run()
- {
- createForm(comp).setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- });
-
- return comp;
- }
-
- private Control createForm(final Composite comp)
- {
-
- Composite container = new Composite(comp, SWT.NONE);
- container.setLayout(new GridLayout(3, false));
-
- {
- Label l = new Label(container, SWT.NONE);
- l.setText("Committer");
-
- IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__PERSON);
-
- ViewForm form = new ViewForm(container, SWT.BORDER | SWT.FLAT);
- form.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- CLabel label = new CLabel(form, SWT.NONE);
- form.setContent(label);
-
- ctx.bindValue(
- WidgetProperties.text().observe(label),
- mprop.observe(committership),
- null,
- new EMFUpdateValueStrategy().setConverter(new PersonToStringConverter()));
-
- Button b = new Button(container, SWT.PUSH);
- b.setText("...");
- b.setEnabled(isnew);
- b.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- FilteredItemsSelectionDialog dialog = new PersonFilterDialog(comp.getShell(), resource);
- dialog.open();
- Person p = (Person)dialog.getFirstResult();
-
- if (p != null)
- {
- Command cmd = SetCommand.create(resource.getEditingDomain(), committership, ProjectPackage.Literals.COMMITTER_SHIP__PERSON, p);
- if (cmd.canExecute())
- {
- resource.executeCmd(cmd);
- }
- }
- }
- });
- }
-
- IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify);
-
- {
- Label l = new Label(container, SWT.NONE);
- l.setText("Startdate");
-
- IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__START);
-
- Text t = new Text(container, SWT.BORDER);
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
-
- ctx.bindValue(textProp.observe(t), mprop.observe(committership), UpdateStrategyFactory.stringToDateNotNull(
- "Can't convert start date value into a valid date",
- "The start date can not be null"), UpdateStrategyFactory.dateToString());
- }
-
- {
- Label l = new Label(container, SWT.NONE);
- l.setText("Enddate");
-
- IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__END);
-
- Text t = new Text(container, SWT.BORDER);
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
-
- ctx.bindValue(
- textProp.observe(t),
- mprop.observe(committership),
- UpdateStrategyFactory.stringToDate("Can't convert end date value into a valid date"),
- UpdateStrategyFactory.dateToString());
- }
-
- TitleAreaDialogSupport.create(this, ctx);
-
- return container;
- }
-
- private class PersonToStringConverter extends Converter
- {
- public PersonToStringConverter()
- {
- super(Person.class, String.class);
- }
-
- public Object convert(Object fromObject)
- {
- if (fromObject != null)
- {
- Person p = (Person)fromObject;
- return p.getLastname() + ", " + p.getFirstname();
- }
-
- return null;
- }
- }
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.dialogs;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.ObservablesManager;
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.jface.databinding.dialog.TitleAreaDialogSupport;
+import org.eclipse.jface.databinding.swt.IWidgetValueProperty;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.ViewForm;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.EMFUpdateValueStrategy;
+import org.eclipse.emf.databinding.edit.EMFEditProperties;
+import org.eclipse.emf.databinding.edit.IEMFEditValueProperty;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.EMFObservablesManager;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.UpdateStrategyFactory;
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
+
+
+/**
+ * Dialog to edit the committer ship
+ */
+public class CommitterShipDialog extends TitleAreaDialog
+{
+ private final DataBindingContext ctx;
+ private final CommitterShip committership;
+ final IModelResource resource;
+ private final boolean isnew;
+
+ /**
+ * Create new dialog
+ * @param parentShell the parent shell
+ * @param resource the resource
+ * @param committership the committership instance
+ * @param isnew flag to indicate if the committer ship is new
+ */
+ public CommitterShipDialog(Shell parentShell, IModelResource resource, CommitterShip committership, boolean isnew)
+ {
+ super(parentShell);
+ this.committership = committership;
+ this.resource = resource;
+ this.isnew = isnew;
+ this.ctx = new EMFDataBindingContext();
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent)
+ {
+ getShell().setText("Edit Committership");
+ setTitle("Edit Committership");
+ setMessage("Edit the committership of a person in the project");
+
+ final Composite comp = (Composite)super.createDialogArea(parent);
+
+ ObservablesManager mgr = new EMFObservablesManager();
+ mgr.runAndCollect(new Runnable()
+ {
+
+ public void run()
+ {
+ createForm(comp).setLayoutData(new GridData(GridData.FILL_BOTH));
+ }
+
+ });
+
+ return comp;
+ }
+
+ private Control createForm(final Composite comp)
+ {
+
+ Composite container = new Composite(comp, SWT.NONE);
+ container.setLayout(new GridLayout(3, false));
+
+ {
+ Label l = new Label(container, SWT.NONE);
+ l.setText("Committer");
+
+ IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__PERSON);
+
+ ViewForm form = new ViewForm(container, SWT.BORDER | SWT.FLAT);
+ form.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ CLabel label = new CLabel(form, SWT.NONE);
+ form.setContent(label);
+
+ ctx.bindValue(
+ WidgetProperties.text().observe(label),
+ mprop.observe(committership),
+ null,
+ new EMFUpdateValueStrategy().setConverter(new PersonToStringConverter()));
+
+ Button b = new Button(container, SWT.PUSH);
+ b.setText("...");
+ b.setEnabled(isnew);
+ b.addSelectionListener(new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected(SelectionEvent e)
+ {
+ FilteredItemsSelectionDialog dialog = new PersonFilterDialog(comp.getShell(), resource);
+ dialog.open();
+ Person p = (Person)dialog.getFirstResult();
+
+ if (p != null)
+ {
+ Command cmd = SetCommand.create(resource.getEditingDomain(), committership, ProjectPackage.Literals.COMMITTER_SHIP__PERSON, p);
+ if (cmd.canExecute())
+ {
+ resource.executeCmd(cmd);
+ }
+ }
+ }
+ });
+ }
+
+ IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify);
+
+ {
+ Label l = new Label(container, SWT.NONE);
+ l.setText("Startdate");
+
+ IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__START);
+
+ Text t = new Text(container, SWT.BORDER);
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+
+ ctx.bindValue(textProp.observe(t), mprop.observe(committership), UpdateStrategyFactory.stringToDateNotNull(
+ "Can't convert start date value into a valid date",
+ "The start date can not be null"), UpdateStrategyFactory.dateToString());
+ }
+
+ {
+ Label l = new Label(container, SWT.NONE);
+ l.setText("Enddate");
+
+ IEMFEditValueProperty mprop = EMFEditProperties.value(resource.getEditingDomain(), ProjectPackage.Literals.COMMITTER_SHIP__END);
+
+ Text t = new Text(container, SWT.BORDER);
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+
+ ctx.bindValue(
+ textProp.observe(t),
+ mprop.observe(committership),
+ UpdateStrategyFactory.stringToDate("Can't convert end date value into a valid date"),
+ UpdateStrategyFactory.dateToString());
+ }
+
+ TitleAreaDialogSupport.create(this, ctx);
+
+ return container;
+ }
+
+ private class PersonToStringConverter extends Converter
+ {
+ public PersonToStringConverter()
+ {
+ super(Person.class, String.class);
+ }
+
+ public Object convert(Object fromObject)
+ {
+ if (fromObject != null)
+ {
+ Person p = (Person)fromObject;
+ return p.getLastname() + ", " + p.getFirstname();
+ }
+
+ return null;
+ }
+ }
} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/NewXMIHandler.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/NewXMIHandler.java
index 4fe6ae054..ba63e89be 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/NewXMIHandler.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/NewXMIHandler.java
@@ -1,107 +1,107 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.handlers;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
-import org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Foundation;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectFactory;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
-
-
-/**
- * Handles the creation of a new XMI-Resource
- */
-public class NewXMIHandler extends AbstractHandler
-{
-
- public Object execute(ExecutionEvent event) throws ExecutionException
- {
- IEvaluationContext ctx = (IEvaluationContext)event.getApplicationContext();
- Shell shell = (Shell)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_SHELL_NAME);
-
- FileDialog dialog = new FileDialog(shell, SWT.SAVE);
- String name = dialog.open();
-
- if (name != null)
- {
- File f = new File(name);
-
- if (!f.exists())
- {
- ResourceSet resourceSet = new ResourceSetImpl();
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
- Resource.Factory.Registry.DEFAULT_EXTENSION,
- new XMIResourceFactoryImpl());
- resourceSet.getPackageRegistry().put(ProjectPackage.eNS_URI, ProjectPackage.eINSTANCE);
-
- Resource resource = resourceSet.createResource(URI.createURI("http:///My.project"));
- Foundation root = ProjectFactory.eINSTANCE.createFoundation();
- resource.getContents().add(root);
- try
- {
- FileOutputStream out = new FileOutputStream(f);
- resource.save(out, null);
- out.close();
- }
- catch (FileNotFoundException e)
- {
- e.printStackTrace();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- try
- {
- IWorkbenchWindow w = (IWorkbenchWindow)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- String path = f.toURI().toURL().toString();
- path = path.replaceAll(":", "#_#");
-
- w.getActivePage().showView(ProjectAdminViewPart.ID, path, IWorkbenchPage.VIEW_ACTIVATE);
- }
- catch (PartInitException e)
- {
- e.printStackTrace();
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- return null;
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.handlers;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Foundation;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectFactory;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
+
+
+/**
+ * Handles the creation of a new XMI-Resource
+ */
+public class NewXMIHandler extends AbstractHandler
+{
+
+ public Object execute(ExecutionEvent event) throws ExecutionException
+ {
+ IEvaluationContext ctx = (IEvaluationContext)event.getApplicationContext();
+ Shell shell = (Shell)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_SHELL_NAME);
+
+ FileDialog dialog = new FileDialog(shell, SWT.SAVE);
+ String name = dialog.open();
+
+ if (name != null)
+ {
+ File f = new File(name);
+
+ if (!f.exists())
+ {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
+ Resource.Factory.Registry.DEFAULT_EXTENSION,
+ new XMIResourceFactoryImpl());
+ resourceSet.getPackageRegistry().put(ProjectPackage.eNS_URI, ProjectPackage.eINSTANCE);
+
+ Resource resource = resourceSet.createResource(URI.createURI("http:///My.project"));
+ Foundation root = ProjectFactory.eINSTANCE.createFoundation();
+ resource.getContents().add(root);
+ try
+ {
+ FileOutputStream out = new FileOutputStream(f);
+ resource.save(out, null);
+ out.close();
+ }
+ catch (FileNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ try
+ {
+ IWorkbenchWindow w = (IWorkbenchWindow)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
+ String path = f.toURI().toURL().toString();
+ path = path.replaceAll(":", "#_#");
+
+ w.getActivePage().showView(ProjectAdminViewPart.ID, path, IWorkbenchPage.VIEW_ACTIVATE);
+ }
+ catch (PartInitException e)
+ {
+ e.printStackTrace();
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/OpenXMIHandler.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/OpenXMIHandler.java
index e4c58357a..8aef6aa52 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/OpenXMIHandler.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/handlers/OpenXMIHandler.java
@@ -1,69 +1,69 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.handlers;
-
-import java.io.File;
-import java.net.MalformedURLException;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-
-import org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart;
-
-
-/**
- * Handles the opening of a XMI-Resource
- */
-public class OpenXMIHandler extends AbstractHandler
-{
-
- public Object execute(ExecutionEvent event) throws ExecutionException
- {
- IEvaluationContext ctx = (IEvaluationContext)event.getApplicationContext();
- Shell shell = (Shell)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_SHELL_NAME);
-
- FileDialog dialog = new FileDialog(shell, SWT.OPEN);
- String name = dialog.open();
-
- if (name != null)
- {
- File f = new File(name);
- try
- {
- IWorkbenchWindow w = (IWorkbenchWindow)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
- String path = f.toURI().toURL().toString();
- path = path.replaceAll(":", "#_#");
-
- w.getActivePage().showView(ProjectAdminViewPart.ID, path, IWorkbenchPage.VIEW_ACTIVATE);
- }
- catch (PartInitException e)
- {
- e.printStackTrace();
- }
- catch (MalformedURLException e)
- {
- e.printStackTrace();
- }
- }
-
- return null;
- }
-
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.handlers;
+
+import java.io.File;
+import java.net.MalformedURLException;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+import org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart;
+
+
+/**
+ * Handles the opening of a XMI-Resource
+ */
+public class OpenXMIHandler extends AbstractHandler
+{
+
+ public Object execute(ExecutionEvent event) throws ExecutionException
+ {
+ IEvaluationContext ctx = (IEvaluationContext)event.getApplicationContext();
+ Shell shell = (Shell)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_SHELL_NAME);
+
+ FileDialog dialog = new FileDialog(shell, SWT.OPEN);
+ String name = dialog.open();
+
+ if (name != null)
+ {
+ File f = new File(name);
+ try
+ {
+ IWorkbenchWindow w = (IWorkbenchWindow)ctx.getVariable(ISources.ACTIVE_WORKBENCH_WINDOW_NAME);
+ String path = f.toURI().toURL().toString();
+ path = path.replaceAll(":", "#_#");
+
+ w.getActivePage().showView(ProjectAdminViewPart.ID, path, IWorkbenchPage.VIEW_ACTIVATE);
+ }
+ catch (PartInitException e)
+ {
+ e.printStackTrace();
+ }
+ catch (MalformedURLException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectAdminViewPart.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectAdminViewPart.java
index f9d3b3891..e5509527c 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectAdminViewPart.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectAdminViewPart.java
@@ -1,294 +1,294 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import org.eclipse.core.databinding.ObservablesManager;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.ISaveablePart2;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPartReference;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.services.ISourceProviderService;
-
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Project;
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-import org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.EMFObservablesManager;
-
-
-/**
- * The workbench part displayed to the user
- */
-public class ProjectAdminViewPart extends ViewPart implements ISaveablePart2
-{
- /**
- * Id of the view
- */
- public static final String ID = "org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart";
-
- private SashForm sashForm;
-
- private FormToolkit toolkit;
-
- private float divider = 0.2f;
- private static final String DIVIDER_KEY = Activator.PLUGIN_ID + ".divider";
-
- private ObservablesManager mgr;
- private ObservablesManager defaultMgr;
- private IModelResource resource;
-
- private ProjectExplorerPart projectExplorer;
- private ProjectFormAreaPart projectDataForm;
- private IPartListener2 listener;
- private UndoAction undoAction;
- private RedoAction redoAction;
- private IModelResource.Listener modelListener;
-
- @Override
- public void init(final IViewSite site, IMemento memento) throws PartInitException
- {
- super.init(site, memento);
- if (memento != null && memento.getFloat(DIVIDER_KEY) != null)
- {
- divider = memento.getFloat(DIVIDER_KEY);
- }
-
- listener = new PartListenerImpl(site);
- site.getPage().addPartListener(listener);
- }
-
- @Override
- public void saveState(IMemento memento)
- {
- super.saveState(memento);
- int total = sashForm.getWeights()[0] + sashForm.getWeights()[1];
- memento.putFloat(DIVIDER_KEY, sashForm.getWeights()[0] * 1.f / total);
- }
-
- @Override
- public void createPartControl(Composite parent)
- {
- String path = getViewSite().getSecondaryId().replaceAll("#_#", ":");
-
- resource = Activator.getDefault().loadResource(path); //FIXME This needs to be a real URI
- modelListener = new IModelResource.Listener()
- {
-
- public void dirtyStateChanged()
- {
- firePropertyChange(PROP_DIRTY);
- }
-
- public void commandStackChanged()
- {
- // Ignore
- }
-
- };
-
- resource.addListener(modelListener);
-
- if (resource == null)
- {
- throw new RuntimeException("Could not load resource!");
- }
-
- toolkit = new FormToolkit(parent.getDisplay());
- sashForm = new SashForm(parent, SWT.HORIZONTAL);
-
- /*
- * Track the creation of observables so that we don't leak listeners
- * when the view part is closed
- */
- mgr = new EMFObservablesManager();
- defaultMgr = new ObservablesManager();
- mgr.runAndCollect(new Runnable()
- {
-
- public void run()
- {
- projectExplorer = new ProjectExplorerPart(getViewSite(), sashForm, toolkit, resource.getFoundation(), defaultMgr);
- projectDataForm = new ProjectFormAreaPart(
- getViewSite(),
- sashForm,
- toolkit,
- resource,
- defaultMgr,
- projectExplorer.getProjectObservable());
- }
- });
-
- int left = (int)(100 * divider);
- sashForm.setWeights(new int []{ left, 100 - left });
-
- makeActions();
-
- }
-
- private void makeActions()
- {
- undoAction = new UndoAction(resource);
- redoAction = new RedoAction(resource);
-
- getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
- getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
- }
-
- @Override
- public void setFocus()
- {
- projectExplorer.setFocus();
- }
-
- @Override
- public void dispose()
- {
- if (undoAction != null)
- undoAction.dispose();
-
- if (redoAction != null)
- redoAction.dispose();
-
- if (modelListener != null && resource != null)
- resource.removeListener(modelListener);
-
- ISourceProviderService s = (ISourceProviderService)getSite().getService(ISourceProviderService.class);
- ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
- p.setModelResource(null);
- getSite().getPage().removePartListener(listener);
-
- projectDataForm.dispose();
- projectExplorer.dispose();
-
- if (toolkit != null)
- {
- toolkit.dispose();
- }
-
- if (defaultMgr != null)
- {
- defaultMgr.dispose();
- }
-
- if (mgr != null)
- {
- mgr.dispose();
- }
-
- super.dispose();
- }
-
- private class PartListenerImpl implements IPartListener2
- {
- private IViewSite site;
-
- public PartListenerImpl(IViewSite site)
- {
- this.site = site;
- }
-
- public void partVisible(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partOpened(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partInputChanged(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partHidden(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partDeactivated(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partClosed(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partBroughtToTop(IWorkbenchPartReference partRef)
- {
- // Ignore
- }
-
- public void partActivated(IWorkbenchPartReference partRef)
- {
- ISourceProviderService s = (ISourceProviderService)site.getService(ISourceProviderService.class);
- ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
- p.setModelResource(resource);
- p.setCommitter(projectExplorer.getCommitter());
- p.setProject((Project)projectExplorer.getProjectObservable().getValue());
- }
- }
-
- public int promptToSaveOnClose()
- {
- return ISaveablePart2.DEFAULT;
- }
-
- public void doSave(IProgressMonitor monitor)
- {
- if (resource != null)
- {
- IStatus s = resource.save();
- if (!s.isOK())
- {
- Activator.getDefault().getLog().log(s);
- throw new RuntimeException();
- }
- else
- {
- firePropertyChange(PROP_DIRTY);
- }
- }
- }
-
- public void doSaveAs()
- {
- // Ignore
- }
-
- public boolean isDirty()
- {
- return resource.isDirty();
- }
-
- public boolean isSaveAsAllowed()
- {
- return false;
- }
-
- public boolean isSaveOnCloseNeeded()
- {
- return true;
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import org.eclipse.core.databinding.ObservablesManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPartListener2;
+import org.eclipse.ui.ISaveablePart2;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.services.ISourceProviderService;
+
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Project;
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+import org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.EMFObservablesManager;
+
+
+/**
+ * The workbench part displayed to the user
+ */
+public class ProjectAdminViewPart extends ViewPart implements ISaveablePart2
+{
+ /**
+ * Id of the view
+ */
+ public static final String ID = "org.eclipse.emf.example.databinding.project.ui.rcp.views.ProjectAdminViewPart";
+
+ private SashForm sashForm;
+
+ private FormToolkit toolkit;
+
+ private float divider = 0.2f;
+ private static final String DIVIDER_KEY = Activator.PLUGIN_ID + ".divider";
+
+ private ObservablesManager mgr;
+ private ObservablesManager defaultMgr;
+ private IModelResource resource;
+
+ private ProjectExplorerPart projectExplorer;
+ private ProjectFormAreaPart projectDataForm;
+ private IPartListener2 listener;
+ private UndoAction undoAction;
+ private RedoAction redoAction;
+ private IModelResource.Listener modelListener;
+
+ @Override
+ public void init(final IViewSite site, IMemento memento) throws PartInitException
+ {
+ super.init(site, memento);
+ if (memento != null && memento.getFloat(DIVIDER_KEY) != null)
+ {
+ divider = memento.getFloat(DIVIDER_KEY);
+ }
+
+ listener = new PartListenerImpl(site);
+ site.getPage().addPartListener(listener);
+ }
+
+ @Override
+ public void saveState(IMemento memento)
+ {
+ super.saveState(memento);
+ int total = sashForm.getWeights()[0] + sashForm.getWeights()[1];
+ memento.putFloat(DIVIDER_KEY, sashForm.getWeights()[0] * 1.f / total);
+ }
+
+ @Override
+ public void createPartControl(Composite parent)
+ {
+ String path = getViewSite().getSecondaryId().replaceAll("#_#", ":");
+
+ resource = Activator.getDefault().loadResource(path); //FIXME This needs to be a real URI
+ modelListener = new IModelResource.Listener()
+ {
+
+ public void dirtyStateChanged()
+ {
+ firePropertyChange(PROP_DIRTY);
+ }
+
+ public void commandStackChanged()
+ {
+ // Ignore
+ }
+
+ };
+
+ resource.addListener(modelListener);
+
+ if (resource == null)
+ {
+ throw new RuntimeException("Could not load resource!");
+ }
+
+ toolkit = new FormToolkit(parent.getDisplay());
+ sashForm = new SashForm(parent, SWT.HORIZONTAL);
+
+ /*
+ * Track the creation of observables so that we don't leak listeners
+ * when the view part is closed
+ */
+ mgr = new EMFObservablesManager();
+ defaultMgr = new ObservablesManager();
+ mgr.runAndCollect(new Runnable()
+ {
+
+ public void run()
+ {
+ projectExplorer = new ProjectExplorerPart(getViewSite(), sashForm, toolkit, resource.getFoundation(), defaultMgr);
+ projectDataForm = new ProjectFormAreaPart(
+ getViewSite(),
+ sashForm,
+ toolkit,
+ resource,
+ defaultMgr,
+ projectExplorer.getProjectObservable());
+ }
+ });
+
+ int left = (int)(100 * divider);
+ sashForm.setWeights(new int []{ left, 100 - left });
+
+ makeActions();
+
+ }
+
+ private void makeActions()
+ {
+ undoAction = new UndoAction(resource);
+ redoAction = new RedoAction(resource);
+
+ getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
+ getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+ }
+
+ @Override
+ public void setFocus()
+ {
+ projectExplorer.setFocus();
+ }
+
+ @Override
+ public void dispose()
+ {
+ if (undoAction != null)
+ undoAction.dispose();
+
+ if (redoAction != null)
+ redoAction.dispose();
+
+ if (modelListener != null && resource != null)
+ resource.removeListener(modelListener);
+
+ ISourceProviderService s = (ISourceProviderService)getSite().getService(ISourceProviderService.class);
+ ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
+ p.setModelResource(null);
+ getSite().getPage().removePartListener(listener);
+
+ projectDataForm.dispose();
+ projectExplorer.dispose();
+
+ if (toolkit != null)
+ {
+ toolkit.dispose();
+ }
+
+ if (defaultMgr != null)
+ {
+ defaultMgr.dispose();
+ }
+
+ if (mgr != null)
+ {
+ mgr.dispose();
+ }
+
+ super.dispose();
+ }
+
+ private class PartListenerImpl implements IPartListener2
+ {
+ private IViewSite site;
+
+ public PartListenerImpl(IViewSite site)
+ {
+ this.site = site;
+ }
+
+ public void partVisible(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partOpened(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partInputChanged(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partHidden(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partDeactivated(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partClosed(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partBroughtToTop(IWorkbenchPartReference partRef)
+ {
+ // Ignore
+ }
+
+ public void partActivated(IWorkbenchPartReference partRef)
+ {
+ ISourceProviderService s = (ISourceProviderService)site.getService(ISourceProviderService.class);
+ ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
+ p.setModelResource(resource);
+ p.setCommitter(projectExplorer.getCommitter());
+ p.setProject((Project)projectExplorer.getProjectObservable().getValue());
+ }
+ }
+
+ public int promptToSaveOnClose()
+ {
+ return ISaveablePart2.DEFAULT;
+ }
+
+ public void doSave(IProgressMonitor monitor)
+ {
+ if (resource != null)
+ {
+ IStatus s = resource.save();
+ if (!s.isOK())
+ {
+ Activator.getDefault().getLog().log(s);
+ throw new RuntimeException();
+ }
+ else
+ {
+ firePropertyChange(PROP_DIRTY);
+ }
+ }
+ }
+
+ public void doSaveAs()
+ {
+ // Ignore
+ }
+
+ public boolean isDirty()
+ {
+ return resource.isDirty();
+ }
+
+ public boolean isSaveAsAllowed()
+ {
+ return false;
+ }
+
+ public boolean isSaveOnCloseNeeded()
+ {
+ return true;
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectCommittersPart.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectCommittersPart.java
index beeed8921..1f65987f9 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectCommittersPart.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectCommittersPart.java
@@ -1,203 +1,203 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.ObservablesManager;
-import org.eclipse.core.databinding.conversion.Converter;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.property.list.IListProperty;
-import org.eclipse.core.databinding.property.value.IValueProperty;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.custom.CTabItem;
-import org.eclipse.ui.IViewSite;
-
-import org.eclipse.emf.databinding.EMFUpdateValueStrategy;
-import org.eclipse.emf.databinding.FeaturePath;
-import org.eclipse.emf.databinding.edit.EMFEditProperties;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.GenericMapCellLabelProvider;
-import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
-
-
-/**
- * Part showing the current committers
- */
-public class ProjectCommittersPart
-{
- private static final String END_DATE_PROPERTY = "enddate";
-
- /**
- * Create a new part
- * @param site the site
- * @param folder the folder where shown
- * @param ctx the databinding context
- * @param editingDomain the editing domain to make changes
- * @param manager manager for observables to avoid leaks
- * @param master the master observable
- */
- public ProjectCommittersPart(
- IViewSite site,
- CTabFolder folder,
- DataBindingContext ctx,
- EditingDomain editingDomain,
- ObservablesManager manager,
- IObservableValue master)
- {
- init(site, folder, ctx, editingDomain, master);
- }
-
- private void init(IViewSite site, CTabFolder folder, DataBindingContext ctx, EditingDomain editingDomain, IObservableValue master)
- {
- final TableViewer viewer = new TableViewer(folder, SWT.FULL_SELECTION);
-
- {
- IValueProperty prop = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__COMMITTERS);
- CTabItem item = new CTabItem(folder, SWT.NONE);
- item.setControl(viewer.getControl());
-
- ctx.bindValue(
- WidgetProperties.text().observe(item),
- prop.observeDetail(master),
- new EMFUpdateValueStrategy(),
- new EMFUpdateValueStrategy().setConverter(new LengthConverter()));
- }
-
- folder.setSelection(0);
-
- viewer.getTable().setHeaderVisible(true);
- ObservableListContentProvider cp = new ObservableListContentProvider();
-
- {
- IObservableMap[] attributeMap = new IObservableMap [2];
- attributeMap[0] = EMFEditProperties.value(
- editingDomain,
- FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__LASTNAME)).observeDetail(
- cp.getKnownElements());
- attributeMap[1] = EMFEditProperties.value(
- editingDomain,
- FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__FIRSTNAME)).observeDetail(
- cp.getKnownElements());
-
- TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
- column.getColumn().setText("Name");
- column.getColumn().setWidth(150);
- column.setLabelProvider(new GenericMapCellLabelProvider("{0}, {1}", attributeMap));
- }
-
- {
- IObservableMap attributeMap = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.COMMITTER_SHIP__START).observeDetail(
- cp.getKnownElements());
- TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
- column.getColumn().setText("Start");
- column.getColumn().setWidth(100);
- column.setLabelProvider(new GenericMapCellLabelProvider("{0,date,short}", attributeMap));
- }
-
- {
- IObservableMap attributeMap = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.COMMITTER_SHIP__END).observeDetail(
- cp.getKnownElements());
- TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
- column.getColumn().setText("End");
- column.getColumn().setWidth(100);
- column.setLabelProvider(new GenericMapCellLabelProvider("{0,date,short}", attributeMap));
- }
-
- IListProperty prop = EMFEditProperties.list(editingDomain, ProjectPackage.Literals.PROJECT__COMMITTERS);
- viewer.setContentProvider(cp);
- viewer.setInput(prop.observeDetail(master));
-
- MenuManager mgr = new MenuManager();
- mgr.add(new Action("Hide historic committers", IAction.AS_CHECK_BOX)
- {
- @Override
- public void run()
- {
- if (isChecked())
- {
- viewer.addFilter(new ViewerFilterImpl());
- }
- else
- {
- viewer.setFilters(new ViewerFilter [0]);
- }
- }
- });
-
- viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));
-
- site.registerContextMenu(Activator.PLUGIN_ID + ".committers", mgr, viewer);
- }
-
- private class LengthConverter extends Converter
- {
-
- public LengthConverter()
- {
- super(Collection.class, String.class);
- }
-
- public Object convert(Object fromObject)
- {
- return "Committers (" + (fromObject != null ? ((Collection< ? >)fromObject).size() : "0") + ")";
- }
- }
-
- private class ViewerFilterImpl extends ViewerFilter
- {
- @Override
- public boolean isFilterProperty(Object element, String property)
- {
- if (property != null && property == END_DATE_PROPERTY)
- {
- return true;
- }
- return super.isFilterProperty(element, property);
- }
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element)
- {
- Date enddate = ((CommitterShip)element).getEnd();
- if (enddate == null || enddate.getTime() > Calendar.getInstance().getTimeInMillis())
- {
- return true;
- }
- return false;
- }
-
- }
-
- /**
- * Release all allocated resources
- */
- public void dispose()
- {
- // Ignore
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Date;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.ObservablesManager;
+import org.eclipse.core.databinding.conversion.Converter;
+import org.eclipse.core.databinding.observable.map.IObservableMap;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.property.list.IListProperty;
+import org.eclipse.core.databinding.property.value.IValueProperty;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.ui.IViewSite;
+
+import org.eclipse.emf.databinding.EMFUpdateValueStrategy;
+import org.eclipse.emf.databinding.FeaturePath;
+import org.eclipse.emf.databinding.edit.EMFEditProperties;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.GenericMapCellLabelProvider;
+import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
+
+
+/**
+ * Part showing the current committers
+ */
+public class ProjectCommittersPart
+{
+ private static final String END_DATE_PROPERTY = "enddate";
+
+ /**
+ * Create a new part
+ * @param site the site
+ * @param folder the folder where shown
+ * @param ctx the databinding context
+ * @param editingDomain the editing domain to make changes
+ * @param manager manager for observables to avoid leaks
+ * @param master the master observable
+ */
+ public ProjectCommittersPart(
+ IViewSite site,
+ CTabFolder folder,
+ DataBindingContext ctx,
+ EditingDomain editingDomain,
+ ObservablesManager manager,
+ IObservableValue master)
+ {
+ init(site, folder, ctx, editingDomain, master);
+ }
+
+ private void init(IViewSite site, CTabFolder folder, DataBindingContext ctx, EditingDomain editingDomain, IObservableValue master)
+ {
+ final TableViewer viewer = new TableViewer(folder, SWT.FULL_SELECTION);
+
+ {
+ IValueProperty prop = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__COMMITTERS);
+ CTabItem item = new CTabItem(folder, SWT.NONE);
+ item.setControl(viewer.getControl());
+
+ ctx.bindValue(
+ WidgetProperties.text().observe(item),
+ prop.observeDetail(master),
+ new EMFUpdateValueStrategy(),
+ new EMFUpdateValueStrategy().setConverter(new LengthConverter()));
+ }
+
+ folder.setSelection(0);
+
+ viewer.getTable().setHeaderVisible(true);
+ ObservableListContentProvider cp = new ObservableListContentProvider();
+
+ {
+ IObservableMap[] attributeMap = new IObservableMap [2];
+ attributeMap[0] = EMFEditProperties.value(
+ editingDomain,
+ FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__LASTNAME)).observeDetail(
+ cp.getKnownElements());
+ attributeMap[1] = EMFEditProperties.value(
+ editingDomain,
+ FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__FIRSTNAME)).observeDetail(
+ cp.getKnownElements());
+
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText("Name");
+ column.getColumn().setWidth(150);
+ column.setLabelProvider(new GenericMapCellLabelProvider("{0}, {1}", attributeMap));
+ }
+
+ {
+ IObservableMap attributeMap = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.COMMITTER_SHIP__START).observeDetail(
+ cp.getKnownElements());
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText("Start");
+ column.getColumn().setWidth(100);
+ column.setLabelProvider(new GenericMapCellLabelProvider("{0,date,short}", attributeMap));
+ }
+
+ {
+ IObservableMap attributeMap = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.COMMITTER_SHIP__END).observeDetail(
+ cp.getKnownElements());
+ TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+ column.getColumn().setText("End");
+ column.getColumn().setWidth(100);
+ column.setLabelProvider(new GenericMapCellLabelProvider("{0,date,short}", attributeMap));
+ }
+
+ IListProperty prop = EMFEditProperties.list(editingDomain, ProjectPackage.Literals.PROJECT__COMMITTERS);
+ viewer.setContentProvider(cp);
+ viewer.setInput(prop.observeDetail(master));
+
+ MenuManager mgr = new MenuManager();
+ mgr.add(new Action("Hide historic committers", IAction.AS_CHECK_BOX)
+ {
+ @Override
+ public void run()
+ {
+ if (isChecked())
+ {
+ viewer.addFilter(new ViewerFilterImpl());
+ }
+ else
+ {
+ viewer.setFilters(new ViewerFilter [0]);
+ }
+ }
+ });
+
+ viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));
+
+ site.registerContextMenu(Activator.PLUGIN_ID + ".committers", mgr, viewer);
+ }
+
+ private class LengthConverter extends Converter
+ {
+
+ public LengthConverter()
+ {
+ super(Collection.class, String.class);
+ }
+
+ public Object convert(Object fromObject)
+ {
+ return "Committers (" + (fromObject != null ? ((Collection< ? >)fromObject).size() : "0") + ")";
+ }
+ }
+
+ private class ViewerFilterImpl extends ViewerFilter
+ {
+ @Override
+ public boolean isFilterProperty(Object element, String property)
+ {
+ if (property != null && property == END_DATE_PROPERTY)
+ {
+ return true;
+ }
+ return super.isFilterProperty(element, property);
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element)
+ {
+ Date enddate = ((CommitterShip)element).getEnd();
+ if (enddate == null || enddate.getTime() > Calendar.getInstance().getTimeInMillis())
+ {
+ return true;
+ }
+ return false;
+ }
+
+ }
+
+ /**
+ * Release all allocated resources
+ */
+ public void dispose()
+ {
+ // Ignore
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectExplorerPart.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectExplorerPart.java
index 71ac359a1..6a4c52b1f 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectExplorerPart.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectExplorerPart.java
@@ -1,573 +1,573 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IExecutionListener;
-import org.eclipse.core.commands.NotHandledException;
-import org.eclipse.core.databinding.ObservablesManager;
-import org.eclipse.core.databinding.observable.IObservable;
-import org.eclipse.core.databinding.observable.list.IObservableList;
-import org.eclipse.core.databinding.observable.map.IMapChangeListener;
-import org.eclipse.core.databinding.observable.map.IObservableMap;
-import org.eclipse.core.databinding.observable.map.MapChangeEvent;
-import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
-import org.eclipse.core.databinding.observable.set.IObservableSet;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider;
-import org.eclipse.jface.databinding.viewers.TreeStructureAdvisor;
-import org.eclipse.jface.databinding.viewers.ViewerProperties;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnViewer;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProviderChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.StyledCellLabelProvider;
-import org.eclipse.jface.viewers.StyledString;
-import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.jface.window.ToolTip;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.program.Program;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.forms.IFormColors;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.services.ISourceProviderService;
-
-import org.eclipse.emf.databinding.EMFProperties;
-import org.eclipse.emf.databinding.FeaturePath;
-import org.eclipse.emf.databinding.IEMFListProperty;
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-import org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.Base64ToImageConverter;
-import org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateSublevelProjectHandler;
-import org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateToplevelProjectHandler;
-import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Foundation;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Project;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
-
-
-/**
- * Part responsible for rendering the project tree
- */
-public class ProjectExplorerPart
-{
- private final TreeViewer viewer;
- private FormToolkit toolkit;
-
- private final Image projectImage;
- private final Image committerImage;
- private final IObservableValue master = new WritableValue();
- private final IExecutionListener paramListener;
- private final IViewSite site;
-
- /**
- * Create a new project explorer
- * @param site the view site
- * @param parent the parent control to renderer on
- * @param toolkit the toolkit
- * @param foundation the foundation instance
- * @param manager manager for observables to avoid leaks
- */
- public ProjectExplorerPart(IViewSite site, Composite parent, FormToolkit toolkit, Foundation foundation, ObservablesManager manager)
- {
- this.toolkit = toolkit;
- this.site = site;
-
- ImageDescriptor desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/generic_elements.gif");
- if (desc != null)
- {
- projectImage = desc.createImage();
- }
- else
- {
- projectImage = null;
- }
-
- desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/signed_yes_tbl.gif");
- if (desc != null)
- {
- committerImage = desc.createImage();
- }
- else
- {
- committerImage = null;
- }
-
- viewer = init(parent, foundation);
-
- paramListener = new CommandListener();
- ICommandService service = (ICommandService)site.getService(ICommandService.class);
- service.addExecutionListener(paramListener);
- }
-
- private TreeViewer init(Composite parent, Foundation foundation)
- {
- TreeViewer viewer = new TreeViewer(parent);
-
- ObservableListTreeContentProvider cp = new ObservableListTreeContentProvider(new TreeFactoryImpl(), new TreeStructureAdvisorImpl());
- viewer.setContentProvider(cp);
-
- IObservableSet set = cp.getKnownElements();
-
- IObservableMap[] map = new IObservableMap [4];
- map[0] = EMFProperties.value(ProjectPackage.Literals.PROJECT__SHORTNAME).observeDetail(set);
- map[1] = EMFProperties.value(ProjectPackage.Literals.PROJECT__COMMITTERS).observeDetail(set);
- map[2] = EMFProperties.value(
- FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__FIRSTNAME)).observeDetail(set);
- map[3] = EMFProperties.value(
- FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__LASTNAME)).observeDetail(set);
-
- viewer.setLabelProvider(new TreeLabelProviderImpl(map));
-
- IEMFListProperty projects = EMFProperties.list(ProjectPackage.Literals.FOUNDATION__PROJECTS);
- viewer.setInput(projects.observe(foundation));
-
- MenuManager mgr = new MenuManager();
- mgr.add(new GroupMarker("additions"));
- viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));
-
- site.registerContextMenu(Activator.PLUGIN_ID + ".projectexp", mgr, viewer);
- site.setSelectionProvider(viewer);
-
- ColumnViewerToolTipSupportImpl.enableFor(viewer, toolkit);
-
- IObservableValue treeObs = ViewerProperties.singleSelection().observe(viewer);
- treeObs.addValueChangeListener(new IValueChangeListener()
- {
-
- public void handleValueChange(ValueChangeEvent event)
- {
- ISourceProviderService s = (ISourceProviderService)site.getService(ISourceProviderService.class);
- ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
-
- if (event.diff.getNewValue() instanceof Project)
- {
- Project pr = (Project)event.diff.getNewValue();
- master.setValue(pr);
- p.setCommitter(null);
- p.setProject(pr);
- }
- else if (event.diff.getNewValue() != null)
- {
- CommitterShip cm = (CommitterShip)event.diff.getNewValue();
- master.setValue(cm.getProject());
- p.setCommitter(cm);
- p.setProject(cm.getProject());
- }
- else
- {
- p.setCommitter(null);
- p.setProject(null);
- }
- }
- });
-
- return viewer;
- }
-
- /**
- * @return observable of the current active project in the tree
- */
- public IObservableValue getProjectObservable()
- {
- return master;
- }
-
- private static class TreeFactoryImpl implements IObservableFactory
- {
- private IEMFListProperty multi = EMFProperties.multiList(
- ProjectPackage.Literals.PROJECT__SUBPROJECTS,
- ProjectPackage.Literals.PROJECT__COMMITTERS);
-
- public IObservable createObservable(final Object target)
- {
- if (target instanceof IObservableList)
- {
- return (IObservable)target;
- }
- else if (target instanceof Project)
- {
- return multi.observe(target);
- }
-
- return null;
- }
- }
-
- private static class TreeStructureAdvisorImpl extends TreeStructureAdvisor
- {
- @Override
- public Object getParent(Object element)
- {
- if (element instanceof Project)
- {
- return ((Project)element).getParent();
- }
-
- return null;
- }
-
- @Override
- public Boolean hasChildren(Object element)
- {
- if (element instanceof Project && (((Project)element).getCommitters().size() > 0 || ((Project)element).getSubprojects().size() > 0))
- {
- return Boolean.TRUE;
- }
- return super.hasChildren(element);
- }
- }
-
- private class TreeLabelProviderImpl extends StyledCellLabelProvider
- {
-
- private IMapChangeListener mapChangeListener = new IMapChangeListener()
- {
- public void handleMapChange(MapChangeEvent event)
- {
- Set< ? > affectedElements = event.diff.getChangedKeys();
- if (!affectedElements.isEmpty())
- {
- LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent(TreeLabelProviderImpl.this, affectedElements.toArray());
- fireLabelProviderChanged(newEvent);
- }
- }
- };
-
- public TreeLabelProviderImpl(IObservableMap... attributeMaps)
- {
- for (int i = 0; i < attributeMaps.length; i++)
- {
- attributeMaps[i].addMapChangeListener(mapChangeListener);
- }
- }
-
- @Override
- public String getToolTipText(Object element)
- {
- return "#dummy#";
- }
-
- @Override
- public void update(ViewerCell cell)
- {
- if (cell.getElement() instanceof Project)
- {
- Project p = (Project)cell.getElement();
-
- StyledString styledString = new StyledString(p.getShortname() != null ? p.getShortname() : "*noname*", null);
- String decoration = " (" + p.getCommitters().size() + " Committers)";
- styledString.append(decoration, StyledString.COUNTER_STYLER);
- cell.setText(styledString.getString());
- cell.setImage(projectImage);
- cell.setStyleRanges(styledString.getStyleRanges());
- }
- else if (cell.getElement() instanceof CommitterShip)
- {
- Person p = ((CommitterShip)cell.getElement()).getPerson();
- String value = "*noname*";
- if (p != null)
- {
- value = p.getLastname() + ", " + p.getFirstname();
- }
- StyledString styledString = new StyledString(value, null);
- cell.setText(styledString.getString());
- cell.setForeground(cell.getControl().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
- cell.setImage(committerImage);
- cell.setStyleRanges(styledString.getStyleRanges());
- }
- }
- }
-
- private static class ColumnViewerToolTipSupportImpl extends ColumnViewerToolTipSupport
- {
- private FormToolkit toolkit;
-
- protected ColumnViewerToolTipSupportImpl(FormToolkit toolkit, ColumnViewer viewer, int style)
- {
- super(viewer, style, false);
- setHideOnMouseDown(false);
- this.toolkit = toolkit;
- }
-
- @Override
- protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent)
- {
- if (cell.getElement() instanceof Project)
- {
- final Project p = (Project)cell.getElement();
-
- StringBuilder b = new StringBuilder();
- for (Person lead : p.getProjectleads())
- {
- if (b.length() > 0)
- {
- b.append(", ");
- }
- b.append(lead.getFirstname() + " " + lead.getLastname());
- }
-
- Form form = toolkit.createForm(parent);
- toolkit.decorateFormHeading(form);
- form.setText(p.getShortname() + " - " + p.getLongname());
- Composite body = form.getBody();
- body.setLayout(new GridLayout(2, false));
-
- toolkit.createLabel(body, "Project creation:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- toolkit.createLabel(body, p.getStart() != null ? DateFormat.getDateInstance().format(p.getStart()) : "");
-
- toolkit.createLabel(body, "Project lead:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- toolkit.createLabel(body, b.toString());
-
- toolkit.createLabel(body, "Committers:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- toolkit.createLabel(body, p.getCommitters().size() + "");
-
- toolkit.createLabel(body, "Mailing-List:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- if (p.getDevmail() != null)
- {
- toolkit.createHyperlink(body, p.getDevmail(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
- {
-
- public void linkExited(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkEntered(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkActivated(HyperlinkEvent e)
- {
- Program.launch(p.getDevmail());
- }
- });
- }
- else
- {
- toolkit.createLabel(body, "-");
- }
-
- toolkit.createLabel(body, "Homepage:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- if (p.getHomepage() != null)
- {
- toolkit.createHyperlink(body, p.getHomepage(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
- {
-
- public void linkExited(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkEntered(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkActivated(HyperlinkEvent e)
- {
- Program.launch(p.getHomepage());
- }
- });
- }
- else
- {
- toolkit.createLabel(body, "-");
- }
-
- return form;
- }
- else
- {
- final CommitterShip committership = (CommitterShip)cell.getElement();
- Form form = toolkit.createForm(parent);
- toolkit.decorateFormHeading(form);
- form.setText(committership.getPerson().getFirstname() + ", " + committership.getPerson().getLastname());
-
- Composite formBody = form.getBody();
- formBody.setLayout(new GridLayout(2, false));
-
- GridData gd = new GridData();
-
- final Label l = toolkit.createLabel(formBody, "");
- l.setLayoutData(gd);
-
- Base64ToImageConverter c = new Base64ToImageConverter(form.getDisplay());
- l.setImage((Image)c.convert(committership.getPerson().getImage()));
- l.addDisposeListener(new DisposeListener()
- {
-
- public void widgetDisposed(DisposeEvent e)
- {
- if (l.getImage() != null)
- l.getImage().dispose();
- }
- });
-
- Composite body = toolkit.createComposite(formBody);
- body.setLayout(new GridLayout(2, false));
-
- toolkit.createLabel(body, "Start:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- toolkit.createLabel(body, committership.getStart() != null ? DateFormat.getDateInstance().format(committership.getStart()) : "");
-
- toolkit.createLabel(body, "End:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- toolkit.createLabel(body, committership.getEnd() != null ? DateFormat.getDateInstance().format(committership.getEnd()) : "");
-
- toolkit.createLabel(body, "E-Mail:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- if (committership.getPerson().getEmail() != null)
- {
- toolkit.createHyperlink(body, committership.getPerson().getEmail(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
- {
-
- public void linkExited(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkEntered(HyperlinkEvent e)
- {
- // Ignore
- }
-
- public void linkActivated(HyperlinkEvent e)
- {
- Program.launch(committership.getPerson().getEmail());
- }
- });
- }
- else
- {
- toolkit.createLabel(body, "");
- }
-
- return form;
- }
- }
-
- static void enableFor(ColumnViewer viewer, FormToolkit toolkit)
- {
- new ColumnViewerToolTipSupportImpl(toolkit, viewer, ToolTip.NO_RECREATE);
- }
- }
-
- /**
- * Set the focus
- */
- public void setFocus()
- {
- viewer.getControl().setFocus();
- if (viewer.getTree().getItemCount() > 0)
- {
- viewer.setSelection(new StructuredSelection(viewer.getTree().getItem(0).getData()));
- }
- }
-
- /**
- * Dispose all resources and remove all listeners
- */
- public void dispose()
- {
- ICommandService service = (ICommandService)site.getService(ICommandService.class);
- service.removeExecutionListener(paramListener);
-
- if (projectImage != null)
- {
- projectImage.dispose();
- }
-
- if (committerImage != null)
- {
- committerImage.dispose();
- }
- }
-
- /**
- * @return the current selected committer
- */
- public CommitterShip getCommitter()
- {
- Object obj = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
- return (CommitterShip)((obj instanceof CommitterShip) ? obj : null);
- }
-
- private class CommandListener implements IExecutionListener
- {
-
- public void preExecute(String commandId, ExecutionEvent event)
- {
- // Ignore
- }
-
- public void postExecuteSuccess(String commandId, Object returnValue)
- {
- if (site.getPage() != null && site.getPage().getActivePart() != null && site.getPage().getActivePart().getSite() == site)
- {
- if (commandId.equals(CreateToplevelProjectHandler.ID) && returnValue != null)
- {
- viewer.setSelection(new StructuredSelection(returnValue));
- }
- else if (commandId.equals(CreateSublevelProjectHandler.ID) && returnValue != null)
- {
- Project project = (Project)returnValue;
- List<Project> path = new ArrayList<Project>();
- path.add(project);
- while ((project = project.getParent()) != null)
- {
- path.add(0, project);
- }
-
- viewer.expandToLevel(new TreePath(path.toArray()), 0);
- viewer.setSelection(new TreeSelection(new TreePath(path.toArray())));
- }
- }
- }
-
- public void postExecuteFailure(String commandId, ExecutionException exception)
- {
- // Ignore
- }
-
- public void notHandled(String commandId, NotHandledException exception)
- {
- // Ignore
- }
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IExecutionListener;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.databinding.ObservablesManager;
+import org.eclipse.core.databinding.observable.IObservable;
+import org.eclipse.core.databinding.observable.list.IObservableList;
+import org.eclipse.core.databinding.observable.map.IMapChangeListener;
+import org.eclipse.core.databinding.observable.map.IObservableMap;
+import org.eclipse.core.databinding.observable.map.MapChangeEvent;
+import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory;
+import org.eclipse.core.databinding.observable.set.IObservableSet;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.IValueChangeListener;
+import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
+import org.eclipse.core.databinding.observable.value.WritableValue;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.databinding.viewers.ObservableListTreeContentProvider;
+import org.eclipse.jface.databinding.viewers.TreeStructureAdvisor;
+import org.eclipse.jface.databinding.viewers.ViewerProperties;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnViewer;
+import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.StyledCellLabelProvider;
+import org.eclipse.jface.viewers.StyledString;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerCell;
+import org.eclipse.jface.window.ToolTip;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.services.ISourceProviderService;
+
+import org.eclipse.emf.databinding.EMFProperties;
+import org.eclipse.emf.databinding.FeaturePath;
+import org.eclipse.emf.databinding.IEMFListProperty;
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+import org.eclipse.emf.example.databinding.project.ui.rcp.ResourceProvider;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.Base64ToImageConverter;
+import org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateSublevelProjectHandler;
+import org.eclipse.emf.example.databinding.project.ui.rcp.handlers.CreateToplevelProjectHandler;
+import org.eclipse.emf.examples.databinding.project.core.model.project.CommitterShip;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Foundation;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Project;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
+
+
+/**
+ * Part responsible for rendering the project tree
+ */
+public class ProjectExplorerPart
+{
+ private final TreeViewer viewer;
+ private FormToolkit toolkit;
+
+ private final Image projectImage;
+ private final Image committerImage;
+ private final IObservableValue master = new WritableValue();
+ private final IExecutionListener paramListener;
+ private final IViewSite site;
+
+ /**
+ * Create a new project explorer
+ * @param site the view site
+ * @param parent the parent control to renderer on
+ * @param toolkit the toolkit
+ * @param foundation the foundation instance
+ * @param manager manager for observables to avoid leaks
+ */
+ public ProjectExplorerPart(IViewSite site, Composite parent, FormToolkit toolkit, Foundation foundation, ObservablesManager manager)
+ {
+ this.toolkit = toolkit;
+ this.site = site;
+
+ ImageDescriptor desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/generic_elements.gif");
+ if (desc != null)
+ {
+ projectImage = desc.createImage();
+ }
+ else
+ {
+ projectImage = null;
+ }
+
+ desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/signed_yes_tbl.gif");
+ if (desc != null)
+ {
+ committerImage = desc.createImage();
+ }
+ else
+ {
+ committerImage = null;
+ }
+
+ viewer = init(parent, foundation);
+
+ paramListener = new CommandListener();
+ ICommandService service = (ICommandService)site.getService(ICommandService.class);
+ service.addExecutionListener(paramListener);
+ }
+
+ private TreeViewer init(Composite parent, Foundation foundation)
+ {
+ TreeViewer viewer = new TreeViewer(parent);
+
+ ObservableListTreeContentProvider cp = new ObservableListTreeContentProvider(new TreeFactoryImpl(), new TreeStructureAdvisorImpl());
+ viewer.setContentProvider(cp);
+
+ IObservableSet set = cp.getKnownElements();
+
+ IObservableMap[] map = new IObservableMap [4];
+ map[0] = EMFProperties.value(ProjectPackage.Literals.PROJECT__SHORTNAME).observeDetail(set);
+ map[1] = EMFProperties.value(ProjectPackage.Literals.PROJECT__COMMITTERS).observeDetail(set);
+ map[2] = EMFProperties.value(
+ FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__FIRSTNAME)).observeDetail(set);
+ map[3] = EMFProperties.value(
+ FeaturePath.fromList(ProjectPackage.Literals.COMMITTER_SHIP__PERSON, ProjectPackage.Literals.PERSON__LASTNAME)).observeDetail(set);
+
+ viewer.setLabelProvider(new TreeLabelProviderImpl(map));
+
+ IEMFListProperty projects = EMFProperties.list(ProjectPackage.Literals.FOUNDATION__PROJECTS);
+ viewer.setInput(projects.observe(foundation));
+
+ MenuManager mgr = new MenuManager();
+ mgr.add(new GroupMarker("additions"));
+ viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));
+
+ site.registerContextMenu(Activator.PLUGIN_ID + ".projectexp", mgr, viewer);
+ site.setSelectionProvider(viewer);
+
+ ColumnViewerToolTipSupportImpl.enableFor(viewer, toolkit);
+
+ IObservableValue treeObs = ViewerProperties.singleSelection().observe(viewer);
+ treeObs.addValueChangeListener(new IValueChangeListener()
+ {
+
+ public void handleValueChange(ValueChangeEvent event)
+ {
+ ISourceProviderService s = (ISourceProviderService)site.getService(ISourceProviderService.class);
+ ResourceProvider p = (ResourceProvider)s.getSourceProvider(ResourceProvider.MODEL_RESOURCE_NAME);
+
+ if (event.diff.getNewValue() instanceof Project)
+ {
+ Project pr = (Project)event.diff.getNewValue();
+ master.setValue(pr);
+ p.setCommitter(null);
+ p.setProject(pr);
+ }
+ else if (event.diff.getNewValue() != null)
+ {
+ CommitterShip cm = (CommitterShip)event.diff.getNewValue();
+ master.setValue(cm.getProject());
+ p.setCommitter(cm);
+ p.setProject(cm.getProject());
+ }
+ else
+ {
+ p.setCommitter(null);
+ p.setProject(null);
+ }
+ }
+ });
+
+ return viewer;
+ }
+
+ /**
+ * @return observable of the current active project in the tree
+ */
+ public IObservableValue getProjectObservable()
+ {
+ return master;
+ }
+
+ private static class TreeFactoryImpl implements IObservableFactory
+ {
+ private IEMFListProperty multi = EMFProperties.multiList(
+ ProjectPackage.Literals.PROJECT__SUBPROJECTS,
+ ProjectPackage.Literals.PROJECT__COMMITTERS);
+
+ public IObservable createObservable(final Object target)
+ {
+ if (target instanceof IObservableList)
+ {
+ return (IObservable)target;
+ }
+ else if (target instanceof Project)
+ {
+ return multi.observe(target);
+ }
+
+ return null;
+ }
+ }
+
+ private static class TreeStructureAdvisorImpl extends TreeStructureAdvisor
+ {
+ @Override
+ public Object getParent(Object element)
+ {
+ if (element instanceof Project)
+ {
+ return ((Project)element).getParent();
+ }
+
+ return null;
+ }
+
+ @Override
+ public Boolean hasChildren(Object element)
+ {
+ if (element instanceof Project && (((Project)element).getCommitters().size() > 0 || ((Project)element).getSubprojects().size() > 0))
+ {
+ return Boolean.TRUE;
+ }
+ return super.hasChildren(element);
+ }
+ }
+
+ private class TreeLabelProviderImpl extends StyledCellLabelProvider
+ {
+
+ private IMapChangeListener mapChangeListener = new IMapChangeListener()
+ {
+ public void handleMapChange(MapChangeEvent event)
+ {
+ Set< ? > affectedElements = event.diff.getChangedKeys();
+ if (!affectedElements.isEmpty())
+ {
+ LabelProviderChangedEvent newEvent = new LabelProviderChangedEvent(TreeLabelProviderImpl.this, affectedElements.toArray());
+ fireLabelProviderChanged(newEvent);
+ }
+ }
+ };
+
+ public TreeLabelProviderImpl(IObservableMap... attributeMaps)
+ {
+ for (int i = 0; i < attributeMaps.length; i++)
+ {
+ attributeMaps[i].addMapChangeListener(mapChangeListener);
+ }
+ }
+
+ @Override
+ public String getToolTipText(Object element)
+ {
+ return "#dummy#";
+ }
+
+ @Override
+ public void update(ViewerCell cell)
+ {
+ if (cell.getElement() instanceof Project)
+ {
+ Project p = (Project)cell.getElement();
+
+ StyledString styledString = new StyledString(p.getShortname() != null ? p.getShortname() : "*noname*", null);
+ String decoration = " (" + p.getCommitters().size() + " Committers)";
+ styledString.append(decoration, StyledString.COUNTER_STYLER);
+ cell.setText(styledString.getString());
+ cell.setImage(projectImage);
+ cell.setStyleRanges(styledString.getStyleRanges());
+ }
+ else if (cell.getElement() instanceof CommitterShip)
+ {
+ Person p = ((CommitterShip)cell.getElement()).getPerson();
+ String value = "*noname*";
+ if (p != null)
+ {
+ value = p.getLastname() + ", " + p.getFirstname();
+ }
+ StyledString styledString = new StyledString(value, null);
+ cell.setText(styledString.getString());
+ cell.setForeground(cell.getControl().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
+ cell.setImage(committerImage);
+ cell.setStyleRanges(styledString.getStyleRanges());
+ }
+ }
+ }
+
+ private static class ColumnViewerToolTipSupportImpl extends ColumnViewerToolTipSupport
+ {
+ private FormToolkit toolkit;
+
+ protected ColumnViewerToolTipSupportImpl(FormToolkit toolkit, ColumnViewer viewer, int style)
+ {
+ super(viewer, style, false);
+ setHideOnMouseDown(false);
+ this.toolkit = toolkit;
+ }
+
+ @Override
+ protected Composite createViewerToolTipContentArea(Event event, ViewerCell cell, Composite parent)
+ {
+ if (cell.getElement() instanceof Project)
+ {
+ final Project p = (Project)cell.getElement();
+
+ StringBuilder b = new StringBuilder();
+ for (Person lead : p.getProjectleads())
+ {
+ if (b.length() > 0)
+ {
+ b.append(", ");
+ }
+ b.append(lead.getFirstname() + " " + lead.getLastname());
+ }
+
+ Form form = toolkit.createForm(parent);
+ toolkit.decorateFormHeading(form);
+ form.setText(p.getShortname() + " - " + p.getLongname());
+ Composite body = form.getBody();
+ body.setLayout(new GridLayout(2, false));
+
+ toolkit.createLabel(body, "Project creation:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(body, p.getStart() != null ? DateFormat.getDateInstance().format(p.getStart()) : "");
+
+ toolkit.createLabel(body, "Project lead:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(body, b.toString());
+
+ toolkit.createLabel(body, "Committers:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(body, p.getCommitters().size() + "");
+
+ toolkit.createLabel(body, "Mailing-List:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ if (p.getDevmail() != null)
+ {
+ toolkit.createHyperlink(body, p.getDevmail(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
+ {
+
+ public void linkExited(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkEntered(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkActivated(HyperlinkEvent e)
+ {
+ Program.launch(p.getDevmail());
+ }
+ });
+ }
+ else
+ {
+ toolkit.createLabel(body, "-");
+ }
+
+ toolkit.createLabel(body, "Homepage:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ if (p.getHomepage() != null)
+ {
+ toolkit.createHyperlink(body, p.getHomepage(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
+ {
+
+ public void linkExited(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkEntered(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkActivated(HyperlinkEvent e)
+ {
+ Program.launch(p.getHomepage());
+ }
+ });
+ }
+ else
+ {
+ toolkit.createLabel(body, "-");
+ }
+
+ return form;
+ }
+ else
+ {
+ final CommitterShip committership = (CommitterShip)cell.getElement();
+ Form form = toolkit.createForm(parent);
+ toolkit.decorateFormHeading(form);
+ form.setText(committership.getPerson().getFirstname() + ", " + committership.getPerson().getLastname());
+
+ Composite formBody = form.getBody();
+ formBody.setLayout(new GridLayout(2, false));
+
+ GridData gd = new GridData();
+
+ final Label l = toolkit.createLabel(formBody, "");
+ l.setLayoutData(gd);
+
+ Base64ToImageConverter c = new Base64ToImageConverter(form.getDisplay());
+ l.setImage((Image)c.convert(committership.getPerson().getImage()));
+ l.addDisposeListener(new DisposeListener()
+ {
+
+ public void widgetDisposed(DisposeEvent e)
+ {
+ if (l.getImage() != null)
+ l.getImage().dispose();
+ }
+ });
+
+ Composite body = toolkit.createComposite(formBody);
+ body.setLayout(new GridLayout(2, false));
+
+ toolkit.createLabel(body, "Start:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(body, committership.getStart() != null ? DateFormat.getDateInstance().format(committership.getStart()) : "");
+
+ toolkit.createLabel(body, "End:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(body, committership.getEnd() != null ? DateFormat.getDateInstance().format(committership.getEnd()) : "");
+
+ toolkit.createLabel(body, "E-Mail:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ if (committership.getPerson().getEmail() != null)
+ {
+ toolkit.createHyperlink(body, committership.getPerson().getEmail(), SWT.NONE).addHyperlinkListener(new IHyperlinkListener()
+ {
+
+ public void linkExited(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkEntered(HyperlinkEvent e)
+ {
+ // Ignore
+ }
+
+ public void linkActivated(HyperlinkEvent e)
+ {
+ Program.launch(committership.getPerson().getEmail());
+ }
+ });
+ }
+ else
+ {
+ toolkit.createLabel(body, "");
+ }
+
+ return form;
+ }
+ }
+
+ static void enableFor(ColumnViewer viewer, FormToolkit toolkit)
+ {
+ new ColumnViewerToolTipSupportImpl(toolkit, viewer, ToolTip.NO_RECREATE);
+ }
+ }
+
+ /**
+ * Set the focus
+ */
+ public void setFocus()
+ {
+ viewer.getControl().setFocus();
+ if (viewer.getTree().getItemCount() > 0)
+ {
+ viewer.setSelection(new StructuredSelection(viewer.getTree().getItem(0).getData()));
+ }
+ }
+
+ /**
+ * Dispose all resources and remove all listeners
+ */
+ public void dispose()
+ {
+ ICommandService service = (ICommandService)site.getService(ICommandService.class);
+ service.removeExecutionListener(paramListener);
+
+ if (projectImage != null)
+ {
+ projectImage.dispose();
+ }
+
+ if (committerImage != null)
+ {
+ committerImage.dispose();
+ }
+ }
+
+ /**
+ * @return the current selected committer
+ */
+ public CommitterShip getCommitter()
+ {
+ Object obj = ((IStructuredSelection)viewer.getSelection()).getFirstElement();
+ return (CommitterShip)((obj instanceof CommitterShip) ? obj : null);
+ }
+
+ private class CommandListener implements IExecutionListener
+ {
+
+ public void preExecute(String commandId, ExecutionEvent event)
+ {
+ // Ignore
+ }
+
+ public void postExecuteSuccess(String commandId, Object returnValue)
+ {
+ if (site.getPage() != null && site.getPage().getActivePart() != null && site.getPage().getActivePart().getSite() == site)
+ {
+ if (commandId.equals(CreateToplevelProjectHandler.ID) && returnValue != null)
+ {
+ viewer.setSelection(new StructuredSelection(returnValue));
+ }
+ else if (commandId.equals(CreateSublevelProjectHandler.ID) && returnValue != null)
+ {
+ Project project = (Project)returnValue;
+ List<Project> path = new ArrayList<Project>();
+ path.add(project);
+ while ((project = project.getParent()) != null)
+ {
+ path.add(0, project);
+ }
+
+ viewer.expandToLevel(new TreePath(path.toArray()), 0);
+ viewer.setSelection(new TreeSelection(new TreePath(path.toArray())));
+ }
+ }
+ }
+
+ public void postExecuteFailure(String commandId, ExecutionException exception)
+ {
+ // Ignore
+ }
+
+ public void notHandled(String commandId, NotHandledException exception)
+ {
+ // Ignore
+ }
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectFormAreaPart.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectFormAreaPart.java
index 005cfc2d6..1436a7b10 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectFormAreaPart.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/ProjectFormAreaPart.java
@@ -1,420 +1,420 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.databinding.AggregateValidationStatus;
-import org.eclipse.core.databinding.DataBindingContext;
-import org.eclipse.core.databinding.ObservablesManager;
-import org.eclipse.core.databinding.ValidationStatusProvider;
-import org.eclipse.core.databinding.observable.value.ComputedValue;
-import org.eclipse.core.databinding.observable.value.IObservableValue;
-import org.eclipse.core.databinding.observable.value.IValueChangeListener;
-import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.databinding.swt.IWidgetValueProperty;
-import org.eclipse.jface.databinding.swt.WidgetProperties;
-import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CTabFolder;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.forms.IFormColors;
-import org.eclipse.ui.forms.IMessage;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.databinding.EMFDataBindingContext;
-import org.eclipse.emf.databinding.IEMFListProperty;
-import org.eclipse.emf.databinding.IEMFValueProperty;
-import org.eclipse.emf.databinding.edit.EMFEditProperties;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
-import org.eclipse.emf.example.databinding.project.ui.rcp.NLSMessages;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.FormTextProperty;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.UpdateStrategyFactory;
-import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.Util;
-import org.eclipse.emf.example.databinding.project.ui.rcp.dialogs.PersonFilterDialog;
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
-import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
-
-
-/**
- * Part creating the form area
- */
-public class ProjectFormAreaPart
-{
- private DataBindingContext ctx;
- private Form form;
- private ProjectCommittersPart committerPart;
- private Image projectImage;
-
- /**
- * Create a new part instance
- * @param site the site
- * @param parent the parent composite
- * @param toolkit the form toolkit to use
- * @param resource the resource
- * @param manager manager for observables to avoid leaks
- * @param master the master observable
- */
- public ProjectFormAreaPart(
- IViewSite site,
- Composite parent,
- FormToolkit toolkit,
- IModelResource resource,
- ObservablesManager manager,
- IObservableValue master)
- {
- ImageDescriptor desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/generic_elements.gif");
- if (desc != null)
- {
- projectImage = desc.createImage();
- }
- else
- {
- projectImage = null;
- }
- createFormArea(site, parent, toolkit, resource, manager, master);
- }
-
- private void createFormArea(
- IViewSite site,
- final Composite parent,
- FormToolkit toolkit,
- final IModelResource resource,
- ObservablesManager manager,
- final IObservableValue master)
- {
-
- final EditingDomain editingDomain = resource.getEditingDomain();
-
- ctx = new EMFDataBindingContext();
- // Fix for bug 278301
- Util.masterDetailFixup(ctx, master);
-
- addStatusSupport(manager, ctx);
-
- form = toolkit.createForm(parent);
- toolkit.decorateFormHeading(form);
- form.setText(" ");
- form.setImage(projectImage);
-
- Composite body = form.getBody();
- body.setLayout(new GridLayout(3, false));
-
- IWidgetValueProperty prop = WidgetProperties.text(SWT.Modify);
-
- {
- final IEMFValueProperty shortProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__SHORTNAME);
- toolkit.createLabel(body, "&Short name");
- Text t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(prop.observeDelayed(400, t), shortProp.observeDetail(master));
-
- final IEMFValueProperty longProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__LONGNAME);
- toolkit.createLabel(body, "&Long name");
- t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(prop.observeDelayed(400, t), longProp.observeDetail(master));
-
- ComputedValue cVal = new ComputedValue()
- {
- private IObservableValue shortname = shortProp.observeDetail(master);
- private IObservableValue longname = longProp.observeDetail(master);
-
- @Override
- protected Object calculate()
- {
- return shortname.getValue() + " - " + longname.getValue();
- }
- };
- manager.addObservable(cVal);
- ctx.bindValue(FormTextProperty.create().observe(form), cVal);
- }
-
- {
- IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__START);
- toolkit.createLabel(body, "Start Date");
- Text t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master), UpdateStrategyFactory.stringToDateNotNull(
- NLSMessages.ProjectAdminViewPart_StartDateNotParseable,
- "Start date must not be null"), UpdateStrategyFactory.dateToString());
- }
-
- {
- IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__END);
- toolkit.createLabel(body, "End Date");
- Text t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(
- prop.observeDelayed(400, t),
- mProp.observeDetail(master),
- UpdateStrategyFactory.stringToDate(NLSMessages.ProjectAdminViewPart_EndDateNotParseable),
- UpdateStrategyFactory.dateToString());
- }
-
- {
- IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__HOMEPAGE);
- toolkit.createLabel(body, "Homepage");
- Text t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master));
- }
-
- {
- IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__DEVMAIL);
- toolkit.createLabel(body, "Dev-Mail");
- Text t = toolkit.createText(body, "");
- t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
- ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master));
- }
-
- {
- IEMFListProperty mProp = EMFEditProperties.list(editingDomain, ProjectPackage.Literals.PROJECT__PROJECTLEADS);
- toolkit.createLabel(body, "Project Leads").setLayoutData(new GridData(SWT.TOP, SWT.DEFAULT, false, false));
-
- Table c = toolkit.createTable(body, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- final TableViewer tv = new TableViewer(c);
- tv.setLabelProvider(new ColumnLabelProvider()
- {
- @Override
- public String getText(Object element)
- {
- Person p = (Person)element;
- return p.getLastname() + ", " + p.getFirstname();
- }
- });
- tv.setContentProvider(new ObservableListContentProvider());
- tv.setInput(mProp.observeDetail(master));
-
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.heightHint = 100;
- c.setLayoutData(gd);
-
- Composite buttonContainer = toolkit.createComposite(body);
- buttonContainer.setLayoutData(new GridData(SWT.DEFAULT, SWT.BOTTOM, false, false));
- buttonContainer.setLayout(new GridLayout());
-
- Button b = toolkit.createButton(buttonContainer, "Add ...", SWT.FLAT);
- gd = new GridData(SWT.DEFAULT, SWT.DEFAULT);
- gd.horizontalAlignment = SWT.FILL;
- b.setLayoutData(gd);
- b.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- PersonFilterDialog dialog = new PersonFilterDialog(parent.getShell(), resource);
- if (dialog.open() == IDialogConstants.OK_ID)
- {
- Command cmd = AddCommand.create(
- editingDomain,
- master.getValue(),
- ProjectPackage.Literals.PROJECT__PROJECTLEADS,
- dialog.getFirstResult());
- if (cmd.canExecute())
- {
- resource.executeCmd(cmd);
- }
- }
- }
- });
- b = toolkit.createButton(buttonContainer, "Remove", SWT.FLAT);
- gd = new GridData(SWT.DEFAULT, SWT.DEFAULT);
- gd.horizontalAlignment = SWT.FILL;
- b.setLayoutData(gd);
- b.addSelectionListener(new SelectionAdapter()
- {
- @Override
- public void widgetSelected(SelectionEvent e)
- {
- IStructuredSelection s = (IStructuredSelection)tv.getSelection();
- if (!s.isEmpty())
- {
- Command cmd = RemoveCommand.create(
- editingDomain,
- master.getValue(),
- ProjectPackage.Literals.PROJECT__PROJECTLEADS,
- s.toList());
- if (cmd.canExecute())
- {
- resource.executeCmd(cmd);
- }
- }
- }
- });
- }
-
- addTabArea(site, body, toolkit, ctx, editingDomain, manager, master);
- body.setBackgroundMode(SWT.INHERIT_DEFAULT);
- }
-
- private void addTabArea(
- IViewSite site,
- Composite parent,
- FormToolkit toolkit,
- DataBindingContext ctx,
- EditingDomain editingDomain,
- ObservablesManager manager,
- IObservableValue master)
- {
- CTabFolder folder = new CTabFolder(parent, SWT.BORDER);
- folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
- folder.setSelectionBackground(new Color []{
- toolkit.getColors().getColor(IFormColors.H_GRADIENT_END),
- toolkit.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int []{ 25 }, true);
- folder.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- folder.setSelectionForeground(toolkit.getColors().getColor(IFormColors.TITLE));
- folder.setSimple(false);
-
- committerPart = new ProjectCommittersPart(site, folder, ctx, editingDomain, manager, master);
- }
-
- private void addStatusSupport(ObservablesManager mgr, final DataBindingContext ctx)
- {
- AggregateValidationStatus aggregateStatus = new AggregateValidationStatus(
- ctx.getValidationStatusProviders(),
- AggregateValidationStatus.MAX_SEVERITY);
-
- aggregateStatus.addValueChangeListener(new IValueChangeListener()
- {
- public void handleValueChange(ValueChangeEvent event)
- {
- handleStateChange((IStatus)event.diff.getNewValue(), ctx);
- }
- });
- }
-
- private void handleStateChange(IStatus currentStatus, DataBindingContext ctx)
- {
- if (form.isDisposed() || form.getHead().isDisposed())
- {
- return;
- }
-
- if (currentStatus != null && currentStatus.getSeverity() != IStatus.OK)
- {
- int type = convertType(currentStatus.getSeverity());
-
- List<IMessage> list = new ArrayList<IMessage>();
- for (Iterator< ? > it = ctx.getValidationStatusProviders().iterator(); it.hasNext();)
- {
- ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)it.next();
- final IStatus status = (IStatus)validationStatusProvider.getValidationStatus().getValue();
- if (!status.isOK())
- {
- list.add(new IMessage()
- {
-
- public Control getControl()
- {
- return null;
- }
-
- public Object getData()
- {
- return null;
- }
-
- public Object getKey()
- {
- return null;
- }
-
- public String getPrefix()
- {
- return null;
- }
-
- public String getMessage()
- {
- return status.getMessage();
- }
-
- public int getMessageType()
- {
- return convertType(status.getSeverity());
- }
-
- });
- }
- }
-
- form.setMessage("Data invalid", type, list.toArray(new IMessage [0]));
- }
- else
- {
- form.setMessage(null);
- }
- }
-
- private int convertType(int severity)
- {
- switch (severity)
- {
- case IStatus.OK:
- return IMessageProvider.NONE;
- case IStatus.CANCEL:
- return IMessageProvider.NONE;
- case IStatus.INFO:
- return IMessageProvider.INFORMATION;
- case IStatus.WARNING:
- return IMessageProvider.WARNING;
- case IStatus.ERROR:
- return IMessageProvider.ERROR;
- default:
- return IMessageProvider.NONE;
- }
- }
-
- /**
- * release all sources allocated
- */
- public void dispose()
- {
- if (projectImage != null)
- {
- projectImage.dispose();
- }
-
- committerPart.dispose();
-
- if (ctx != null)
- {
- ctx.dispose();
- }
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.databinding.AggregateValidationStatus;
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.core.databinding.ObservablesManager;
+import org.eclipse.core.databinding.ValidationStatusProvider;
+import org.eclipse.core.databinding.observable.value.ComputedValue;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
+import org.eclipse.core.databinding.observable.value.IValueChangeListener;
+import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.databinding.swt.IWidgetValueProperty;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
+import org.eclipse.jface.databinding.viewers.ObservableListContentProvider;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.IMessage;
+import org.eclipse.ui.forms.widgets.Form;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.databinding.EMFDataBindingContext;
+import org.eclipse.emf.databinding.IEMFListProperty;
+import org.eclipse.emf.databinding.IEMFValueProperty;
+import org.eclipse.emf.databinding.edit.EMFEditProperties;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.example.databinding.project.ui.rcp.Activator;
+import org.eclipse.emf.example.databinding.project.ui.rcp.NLSMessages;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.FormTextProperty;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.UpdateStrategyFactory;
+import org.eclipse.emf.example.databinding.project.ui.rcp.databinding.Util;
+import org.eclipse.emf.example.databinding.project.ui.rcp.dialogs.PersonFilterDialog;
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+import org.eclipse.emf.examples.databinding.project.core.model.project.Person;
+import org.eclipse.emf.examples.databinding.project.core.model.project.ProjectPackage;
+
+
+/**
+ * Part creating the form area
+ */
+public class ProjectFormAreaPart
+{
+ private DataBindingContext ctx;
+ private Form form;
+ private ProjectCommittersPart committerPart;
+ private Image projectImage;
+
+ /**
+ * Create a new part instance
+ * @param site the site
+ * @param parent the parent composite
+ * @param toolkit the form toolkit to use
+ * @param resource the resource
+ * @param manager manager for observables to avoid leaks
+ * @param master the master observable
+ */
+ public ProjectFormAreaPart(
+ IViewSite site,
+ Composite parent,
+ FormToolkit toolkit,
+ IModelResource resource,
+ ObservablesManager manager,
+ IObservableValue master)
+ {
+ ImageDescriptor desc = Activator.imageDescriptorFromPlugin("org.eclipse.ui", "icons/full/obj16/generic_elements.gif");
+ if (desc != null)
+ {
+ projectImage = desc.createImage();
+ }
+ else
+ {
+ projectImage = null;
+ }
+ createFormArea(site, parent, toolkit, resource, manager, master);
+ }
+
+ private void createFormArea(
+ IViewSite site,
+ final Composite parent,
+ FormToolkit toolkit,
+ final IModelResource resource,
+ ObservablesManager manager,
+ final IObservableValue master)
+ {
+
+ final EditingDomain editingDomain = resource.getEditingDomain();
+
+ ctx = new EMFDataBindingContext();
+ // Fix for bug 278301
+ Util.masterDetailFixup(ctx, master);
+
+ addStatusSupport(manager, ctx);
+
+ form = toolkit.createForm(parent);
+ toolkit.decorateFormHeading(form);
+ form.setText(" ");
+ form.setImage(projectImage);
+
+ Composite body = form.getBody();
+ body.setLayout(new GridLayout(3, false));
+
+ IWidgetValueProperty prop = WidgetProperties.text(SWT.Modify);
+
+ {
+ final IEMFValueProperty shortProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__SHORTNAME);
+ toolkit.createLabel(body, "&Short name");
+ Text t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(prop.observeDelayed(400, t), shortProp.observeDetail(master));
+
+ final IEMFValueProperty longProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__LONGNAME);
+ toolkit.createLabel(body, "&Long name");
+ t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(prop.observeDelayed(400, t), longProp.observeDetail(master));
+
+ ComputedValue cVal = new ComputedValue()
+ {
+ private IObservableValue shortname = shortProp.observeDetail(master);
+ private IObservableValue longname = longProp.observeDetail(master);
+
+ @Override
+ protected Object calculate()
+ {
+ return shortname.getValue() + " - " + longname.getValue();
+ }
+ };
+ manager.addObservable(cVal);
+ ctx.bindValue(FormTextProperty.create().observe(form), cVal);
+ }
+
+ {
+ IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__START);
+ toolkit.createLabel(body, "Start Date");
+ Text t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master), UpdateStrategyFactory.stringToDateNotNull(
+ NLSMessages.ProjectAdminViewPart_StartDateNotParseable,
+ "Start date must not be null"), UpdateStrategyFactory.dateToString());
+ }
+
+ {
+ IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__END);
+ toolkit.createLabel(body, "End Date");
+ Text t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(
+ prop.observeDelayed(400, t),
+ mProp.observeDetail(master),
+ UpdateStrategyFactory.stringToDate(NLSMessages.ProjectAdminViewPart_EndDateNotParseable),
+ UpdateStrategyFactory.dateToString());
+ }
+
+ {
+ IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__HOMEPAGE);
+ toolkit.createLabel(body, "Homepage");
+ Text t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master));
+ }
+
+ {
+ IEMFValueProperty mProp = EMFEditProperties.value(editingDomain, ProjectPackage.Literals.PROJECT__DEVMAIL);
+ toolkit.createLabel(body, "Dev-Mail");
+ Text t = toolkit.createText(body, "");
+ t.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, true, false, 2, 1));
+ ctx.bindValue(prop.observeDelayed(400, t), mProp.observeDetail(master));
+ }
+
+ {
+ IEMFListProperty mProp = EMFEditProperties.list(editingDomain, ProjectPackage.Literals.PROJECT__PROJECTLEADS);
+ toolkit.createLabel(body, "Project Leads").setLayoutData(new GridData(SWT.TOP, SWT.DEFAULT, false, false));
+
+ Table c = toolkit.createTable(body, SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ final TableViewer tv = new TableViewer(c);
+ tv.setLabelProvider(new ColumnLabelProvider()
+ {
+ @Override
+ public String getText(Object element)
+ {
+ Person p = (Person)element;
+ return p.getLastname() + ", " + p.getFirstname();
+ }
+ });
+ tv.setContentProvider(new ObservableListContentProvider());
+ tv.setInput(mProp.observeDetail(master));
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.heightHint = 100;
+ c.setLayoutData(gd);
+
+ Composite buttonContainer = toolkit.createComposite(body);
+ buttonContainer.setLayoutData(new GridData(SWT.DEFAULT, SWT.BOTTOM, false, false));
+ buttonContainer.setLayout(new GridLayout());
+
+ Button b = toolkit.createButton(buttonContainer, "Add ...", SWT.FLAT);
+ gd = new GridData(SWT.DEFAULT, SWT.DEFAULT);
+ gd.horizontalAlignment = SWT.FILL;
+ b.setLayoutData(gd);
+ b.addSelectionListener(new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected(SelectionEvent e)
+ {
+ PersonFilterDialog dialog = new PersonFilterDialog(parent.getShell(), resource);
+ if (dialog.open() == IDialogConstants.OK_ID)
+ {
+ Command cmd = AddCommand.create(
+ editingDomain,
+ master.getValue(),
+ ProjectPackage.Literals.PROJECT__PROJECTLEADS,
+ dialog.getFirstResult());
+ if (cmd.canExecute())
+ {
+ resource.executeCmd(cmd);
+ }
+ }
+ }
+ });
+ b = toolkit.createButton(buttonContainer, "Remove", SWT.FLAT);
+ gd = new GridData(SWT.DEFAULT, SWT.DEFAULT);
+ gd.horizontalAlignment = SWT.FILL;
+ b.setLayoutData(gd);
+ b.addSelectionListener(new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected(SelectionEvent e)
+ {
+ IStructuredSelection s = (IStructuredSelection)tv.getSelection();
+ if (!s.isEmpty())
+ {
+ Command cmd = RemoveCommand.create(
+ editingDomain,
+ master.getValue(),
+ ProjectPackage.Literals.PROJECT__PROJECTLEADS,
+ s.toList());
+ if (cmd.canExecute())
+ {
+ resource.executeCmd(cmd);
+ }
+ }
+ }
+ });
+ }
+
+ addTabArea(site, body, toolkit, ctx, editingDomain, manager, master);
+ body.setBackgroundMode(SWT.INHERIT_DEFAULT);
+ }
+
+ private void addTabArea(
+ IViewSite site,
+ Composite parent,
+ FormToolkit toolkit,
+ DataBindingContext ctx,
+ EditingDomain editingDomain,
+ ObservablesManager manager,
+ IObservableValue master)
+ {
+ CTabFolder folder = new CTabFolder(parent, SWT.BORDER);
+ folder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+ folder.setSelectionBackground(new Color []{
+ toolkit.getColors().getColor(IFormColors.H_GRADIENT_END),
+ toolkit.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int []{ 25 }, true);
+ folder.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ folder.setSelectionForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ folder.setSimple(false);
+
+ committerPart = new ProjectCommittersPart(site, folder, ctx, editingDomain, manager, master);
+ }
+
+ private void addStatusSupport(ObservablesManager mgr, final DataBindingContext ctx)
+ {
+ AggregateValidationStatus aggregateStatus = new AggregateValidationStatus(
+ ctx.getValidationStatusProviders(),
+ AggregateValidationStatus.MAX_SEVERITY);
+
+ aggregateStatus.addValueChangeListener(new IValueChangeListener()
+ {
+ public void handleValueChange(ValueChangeEvent event)
+ {
+ handleStateChange((IStatus)event.diff.getNewValue(), ctx);
+ }
+ });
+ }
+
+ private void handleStateChange(IStatus currentStatus, DataBindingContext ctx)
+ {
+ if (form.isDisposed() || form.getHead().isDisposed())
+ {
+ return;
+ }
+
+ if (currentStatus != null && currentStatus.getSeverity() != IStatus.OK)
+ {
+ int type = convertType(currentStatus.getSeverity());
+
+ List<IMessage> list = new ArrayList<IMessage>();
+ for (Iterator< ? > it = ctx.getValidationStatusProviders().iterator(); it.hasNext();)
+ {
+ ValidationStatusProvider validationStatusProvider = (ValidationStatusProvider)it.next();
+ final IStatus status = (IStatus)validationStatusProvider.getValidationStatus().getValue();
+ if (!status.isOK())
+ {
+ list.add(new IMessage()
+ {
+
+ public Control getControl()
+ {
+ return null;
+ }
+
+ public Object getData()
+ {
+ return null;
+ }
+
+ public Object getKey()
+ {
+ return null;
+ }
+
+ public String getPrefix()
+ {
+ return null;
+ }
+
+ public String getMessage()
+ {
+ return status.getMessage();
+ }
+
+ public int getMessageType()
+ {
+ return convertType(status.getSeverity());
+ }
+
+ });
+ }
+ }
+
+ form.setMessage("Data invalid", type, list.toArray(new IMessage [0]));
+ }
+ else
+ {
+ form.setMessage(null);
+ }
+ }
+
+ private int convertType(int severity)
+ {
+ switch (severity)
+ {
+ case IStatus.OK:
+ return IMessageProvider.NONE;
+ case IStatus.CANCEL:
+ return IMessageProvider.NONE;
+ case IStatus.INFO:
+ return IMessageProvider.INFORMATION;
+ case IStatus.WARNING:
+ return IMessageProvider.WARNING;
+ case IStatus.ERROR:
+ return IMessageProvider.ERROR;
+ default:
+ return IMessageProvider.NONE;
+ }
+ }
+
+ /**
+ * release all sources allocated
+ */
+ public void dispose()
+ {
+ if (projectImage != null)
+ {
+ projectImage.dispose();
+ }
+
+ committerPart.dispose();
+
+ if (ctx != null)
+ {
+ ctx.dispose();
+ }
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/RedoAction.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/RedoAction.java
index 949852d75..9dc4c12b8 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/RedoAction.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/RedoAction.java
@@ -1,73 +1,73 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-
-
-public class RedoAction extends Action
-{
- private final IModelResource resource;
- private final IModelResource.Listener listener;
-
- public RedoAction(IModelResource resource)
- {
- this.resource = resource;
- this.listener = new IModelResource.Listener()
- {
-
- public void dirtyStateChanged()
- {
- // Ignore
- }
-
- public void commandStackChanged()
- {
- update();
- }
- };
- resource.addListener(listener);
- update();
- }
-
- @Override
- public void run()
- {
- if (resource.canRedo().isOK())
- {
- resource.redo();
- }
- }
-
- private void update()
- {
- if (resource.canRedo().isOK())
- {
- setText("Redo " + resource.getEditingDomain().getCommandStack().getRedoCommand().getLabel());
- setEnabled(true);
- }
- else
- {
- setText("Redo");
- setEnabled(false);
- }
- }
-
- /**
- * Clean up
- */
- public void dispose()
- {
- resource.removeListener(listener);
- }
-}
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import org.eclipse.jface.action.Action;
+
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+
+
+public class RedoAction extends Action
+{
+ private final IModelResource resource;
+ private final IModelResource.Listener listener;
+
+ public RedoAction(IModelResource resource)
+ {
+ this.resource = resource;
+ this.listener = new IModelResource.Listener()
+ {
+
+ public void dirtyStateChanged()
+ {
+ // Ignore
+ }
+
+ public void commandStackChanged()
+ {
+ update();
+ }
+ };
+ resource.addListener(listener);
+ update();
+ }
+
+ @Override
+ public void run()
+ {
+ if (resource.canRedo().isOK())
+ {
+ resource.redo();
+ }
+ }
+
+ private void update()
+ {
+ if (resource.canRedo().isOK())
+ {
+ setText("Redo " + resource.getEditingDomain().getCommandStack().getRedoCommand().getLabel());
+ setEnabled(true);
+ }
+ else
+ {
+ setText("Redo");
+ setEnabled(false);
+ }
+ }
+
+ /**
+ * Clean up
+ */
+ public void dispose()
+ {
+ resource.removeListener(listener);
+ }
+}
diff --git a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/UndoAction.java b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/UndoAction.java
index 1af4328ef..e14752ae1 100644
--- a/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/UndoAction.java
+++ b/examples/org.eclipse.emf.examples.databinding.project.ui.rcp/src/org/eclipse/emf/example/databinding/project/ui/rcp/views/UndoAction.java
@@ -1,73 +1,73 @@
-/**
- * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
- *
- * Contributors:
- * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
- */
-package org.eclipse.emf.example.databinding.project.ui.rcp.views;
-
-import org.eclipse.jface.action.Action;
-
-import org.eclipse.emf.examples.databinding.project.core.IModelResource;
-
-
-public class UndoAction extends Action
-{
- private final IModelResource resource;
- private final IModelResource.Listener listener;
-
- public UndoAction(IModelResource resource)
- {
- this.resource = resource;
- this.listener = new IModelResource.Listener()
- {
-
- public void dirtyStateChanged()
- {
- // Ignore
- }
-
- public void commandStackChanged()
- {
- update();
- }
- };
- resource.addListener(listener);
- update();
- }
-
- @Override
- public void run()
- {
- if (resource.canUndo().isOK())
- {
- resource.undo();
- }
- }
-
- private void update()
- {
- if (resource.canUndo().isOK())
- {
- setText("Undo " + resource.getEditingDomain().getCommandStack().getUndoCommand().getLabel());
- setEnabled(true);
- }
- else
- {
- setText("Undo");
- setEnabled(false);
- }
- }
-
- /**
- * Clean up
- */
- public void dispose()
- {
- resource.removeListener(listener);
- }
+/**
+ * Copyright (c) 2009 Bestsolution.at 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.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl<tom.schindl@bestsolution.at> - Initial API and implementation
+ */
+package org.eclipse.emf.example.databinding.project.ui.rcp.views;
+
+import org.eclipse.jface.action.Action;
+
+import org.eclipse.emf.examples.databinding.project.core.IModelResource;
+
+
+public class UndoAction extends Action
+{
+ private final IModelResource resource;
+ private final IModelResource.Listener listener;
+
+ public UndoAction(IModelResource resource)
+ {
+ this.resource = resource;
+ this.listener = new IModelResource.Listener()
+ {
+
+ public void dirtyStateChanged()
+ {
+ // Ignore
+ }
+
+ public void commandStackChanged()
+ {
+ update();
+ }
+ };
+ resource.addListener(listener);
+ update();
+ }
+
+ @Override
+ public void run()
+ {
+ if (resource.canUndo().isOK())
+ {
+ resource.undo();
+ }
+ }
+
+ private void update()
+ {
+ if (resource.canUndo().isOK())
+ {
+ setText("Undo " + resource.getEditingDomain().getCommandStack().getUndoCommand().getLabel());
+ setEnabled(true);
+ }
+ else
+ {
+ setText("Undo");
+ setEnabled(false);
+ }
+ }
+
+ /**
+ * Clean up
+ */
+ public void dispose()
+ {
+ resource.removeListener(listener);
+ }
} \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.generator.validator/about.html b/examples/org.eclipse.emf.examples.generator.validator/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.generator.validator/about.html
+++ b/examples/org.eclipse.emf.examples.generator.validator/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.library.edit/about.html b/examples/org.eclipse.emf.examples.library.edit/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.library.edit/about.html
+++ b/examples/org.eclipse.emf.examples.library.edit/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.library.editor/about.html b/examples/org.eclipse.emf.examples.library.editor/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.library.editor/about.html
+++ b/examples/org.eclipse.emf.examples.library.editor/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples.library/about.html b/examples/org.eclipse.emf.examples.library/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples.library/about.html
+++ b/examples/org.eclipse.emf.examples.library/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.examples/about.html b/examples/org.eclipse.emf.examples/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.examples/about.html
+++ b/examples/org.eclipse.emf.examples/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.exporter.html/about.html b/examples/org.eclipse.emf.exporter.html/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.exporter.html/about.html
+++ b/examples/org.eclipse.emf.exporter.html/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.java.edit/about.html b/examples/org.eclipse.emf.java.edit/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.java.edit/about.html
+++ b/examples/org.eclipse.emf.java.edit/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.java.editor/about.html b/examples/org.eclipse.emf.java.editor/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.java.editor/about.html
+++ b/examples/org.eclipse.emf.java.editor/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file
diff --git a/examples/org.eclipse.emf.java.editor/plugin.properties b/examples/org.eclipse.emf.java.editor/plugin.properties
index e5bcdc98c..54d8e7109 100644
--- a/examples/org.eclipse.emf.java.editor/plugin.properties
+++ b/examples/org.eclipse.emf.java.editor/plugin.properties
@@ -59,5 +59,5 @@ _UI_TreeWithColumnsPage_label = Tree with Columns
_UI_CreateModelError_message = Problems encountered in file "{0}"
_UI_JavaEditorFilenameExtensions = java
- _WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
+_WARN_FilenameExtensions = The file name must have one of the following extensions: {0}
diff --git a/examples/org.eclipse.emf.java/about.html b/examples/org.eclipse.emf.java/about.html
index 968a06fd8..1b8f94080 100644
--- a/examples/org.eclipse.emf.java/about.html
+++ b/examples/org.eclipse.emf.java/about.html
@@ -1,28 +1,28 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
-indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was
-provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
</html> \ No newline at end of file

Back to the top