Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2018-10-17 08:44:18 -0400
committerPatrick Tessier2018-10-19 03:42:21 -0400
commitf349978421af93ea9f27071b92f28daf25753225 (patch)
treedc2d2d30aa6cd8e5b001bea4b5db8add974a59ce /plugins/infra/core
parent94e017428e887c22c9a3ff100cbb5dbc61cd50ad (diff)
downloadorg.eclipse.papyrus-f349978421af93ea9f27071b92f28daf25753225.tar.gz
org.eclipse.papyrus-f349978421af93ea9f27071b92f28daf25753225.tar.xz
org.eclipse.papyrus-f349978421af93ea9f27071b92f28daf25753225.zip
Bug 540218 : [PageManager] The page manager listener doesn't receive interesting informations
Change-Id: I8f34a8ab0fe58628d2aa4f4625a9bb703a1cbc81 Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
Diffstat (limited to 'plugins/infra/core')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangedEventProvider.java23
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/pom.xml5
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/NotificationContentEvent.java350
-rwxr-xr-x[-rw-r--r--]plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProvider.java0
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/singlefolder/SingleFolderModel.java6
-rwxr-xr-xplugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/usecases.md15
8 files changed, 391 insertions, 12 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
index 8fc286d3710..f3ca82161d8 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/META-INF/MANIFEST.MF
@@ -8,7 +8,7 @@ Bundle-ClassPath: .
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Require-Bundle: org.eclipse.papyrus.infra.core.sasheditor;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+Require-Bundle: org.eclipse.papyrus.infra.core.sasheditor;bundle-version="[2.1.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.transaction;bundle-version="[1.9.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.core.log;bundle-version="[1.2.0,2.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="[1.2.0,2.0.0)";visibility:=reexport
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangedEventProvider.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangedEventProvider.java
index d311f2d9dbd..bcddf746d97 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangedEventProvider.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor.di/custom-src/org/eclipse/papyrus/infra/core/sasheditor/di/contentprovider/internal/ContentChangedEventProvider.java
@@ -1,6 +1,18 @@
-/**
+/*****************************************************************************
+ * Copyright (c) 2011, 2018 CEA LIST, LIFL
*
- */
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
+ * Vincent Lorenzo - vincent.lorenzo@cea.fr - bug 540218
+ *
+ *****************************************************************************/
package org.eclipse.papyrus.infra.core.sasheditor.di.contentprovider.internal;
import java.util.ArrayList;
@@ -11,6 +23,7 @@ import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener.ContentEvent;
import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedProvider;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.NotificationContentEvent;
import org.eclipse.papyrus.infra.core.sashwindows.di.AbstractPanel;
import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
import org.eclipse.papyrus.infra.core.sashwindows.di.SashModel;
@@ -198,17 +211,17 @@ public class ContentChangedEventProvider implements IContentChangedProvider {
if (msg.getEventType() == Notification.RESOLVE) {
return;
}
-
+
// Filter out notification of type SET
// We don't need to be notified
- if(msg.getEventType() == Notification.SET) {
+ if (msg.getEventType() == Notification.SET) {
return;
}
// W
Object sender = msg.getNotifier();
if (sender instanceof AbstractPanel || sender instanceof Window || sender instanceof PageRef) {
- fireContentChanged(new ContentEvent(msg.getEventType(), sender, null));
+ fireContentChanged(new NotificationContentEvent(msg, msg.getEventType(), sender, null));
}
}
}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/META-INF/MANIFEST.MF b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/META-INF/MANIFEST.MF
index 8781bba334b..3a1f53acab2 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/META-INF/MANIFEST.MF
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/META-INF/MANIFEST.MF
@@ -19,7 +19,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.107.0,4.0.0)";visibility:=reex
org.eclipse.core.expressions;bundle-version="[3.5.0,4.0.0)",
org.eclipse.papyrus.infra.tools;bundle-version="[3.0.0,4.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 2.1.0.qualifier
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.infra.core.sasheditor.Activator
Bundle-SymbolicName: org.eclipse.papyrus.infra.core.sasheditor;singleton:=true
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/pom.xml b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/pom.xml
index 13f600a51b6..e6061cf1644 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/pom.xml
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/pom.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@@ -8,6 +9,6 @@
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>org.eclipse.papyrus.infra.core.sasheditor</artifactId>
- <version>2.0.0-SNAPSHOT</version>
+ <version>2.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project> \ No newline at end of file
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/NotificationContentEvent.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/NotificationContentEvent.java
new file mode 100755
index 00000000000..dd2bfd02429
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/NotificationContentEvent.java
@@ -0,0 +1,350 @@
+/*****************************************************************************
+ * Copyright (c) 2018 CEA LIST and others.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Vincent Lorenzo - CEA LIST (vincent.lorenzo@cea.fr) - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.core.sasheditor.contentprovider;
+
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IContentChangedListener.ContentEvent;
+
+/**
+ * @author VL222926
+ * @since 2.1
+ *
+ * This class has been created to a part of the troubles described in the bug 540218. Now we are able to receive the full EMF notification.
+ *
+ */
+public class NotificationContentEvent extends ContentEvent implements Notification {
+
+ /**
+ * the initial EMF notification
+ */
+ private Notification notification;
+
+
+ /**
+ * Constructor.
+ *
+ * @param type
+ * @param model
+ * @param object
+ */
+ public NotificationContentEvent(Notification notification, int type, Object model, Object object) {
+ super(type, model, object);
+ this.notification = notification;
+ }
+
+ /**
+ *
+ * @return
+ * the initial EMF notification
+ */
+ public Notification getNotification() {
+ return this.notification;
+ }
+
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNotifier()
+ *
+ * @return
+ */
+ @Override
+ public Object getNotifier() {
+ return notification.getNotifier();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getEventType()
+ *
+ * @return
+ */
+ @Override
+ public int getEventType() {
+ return notification.getEventType();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getFeatureID(java.lang.Class)
+ *
+ * @param expectedClass
+ * @return
+ */
+ @Override
+ public int getFeatureID(Class<?> expectedClass) {
+ return notification.getFeatureID(expectedClass);
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getFeature()
+ *
+ * @return
+ */
+ @Override
+ public Object getFeature() {
+ return notification.getFeature();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldValue()
+ *
+ * @return
+ */
+ @Override
+ public Object getOldValue() {
+ return notification.getOldValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewValue()
+ *
+ * @return
+ */
+ @Override
+ public Object getNewValue() {
+ return notification.getNewValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#wasSet()
+ *
+ * @return
+ */
+ @Override
+ public boolean wasSet() {
+ return notification.wasSet();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#isTouch()
+ *
+ * @return
+ */
+ @Override
+ public boolean isTouch() {
+ return notification.isTouch();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#isReset()
+ *
+ * @return
+ */
+ @Override
+ public boolean isReset() {
+ return notification.isReset();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getPosition()
+ *
+ * @return
+ */
+ @Override
+ public int getPosition() {
+ return notification.getPosition();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#merge(org.eclipse.emf.common.notify.Notification)
+ *
+ * @param notification
+ * @return
+ */
+ @Override
+ public boolean merge(Notification notification) {
+ return notification.merge(notification);
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldBooleanValue()
+ *
+ * @return
+ */
+ @Override
+ public boolean getOldBooleanValue() {
+ return notification.getOldBooleanValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewBooleanValue()
+ *
+ * @return
+ */
+ @Override
+ public boolean getNewBooleanValue() {
+ return notification.getNewBooleanValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldByteValue()
+ *
+ * @return
+ */
+ @Override
+ public byte getOldByteValue() {
+ return notification.getOldByteValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewByteValue()
+ *
+ * @return
+ */
+ @Override
+ public byte getNewByteValue() {
+ return notification.getNewByteValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldCharValue()
+ *
+ * @return
+ */
+ @Override
+ public char getOldCharValue() {
+ return notification.getOldCharValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewCharValue()
+ *
+ * @return
+ */
+ @Override
+ public char getNewCharValue() {
+ return notification.getNewCharValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldDoubleValue()
+ *
+ * @return
+ */
+ @Override
+ public double getOldDoubleValue() {
+ return notification.getOldDoubleValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewDoubleValue()
+ *
+ * @return
+ */
+ @Override
+ public double getNewDoubleValue() {
+ return notification.getNewDoubleValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldFloatValue()
+ *
+ * @return
+ */
+ @Override
+ public float getOldFloatValue() {
+ return notification.getOldFloatValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewFloatValue()
+ *
+ * @return
+ */
+ @Override
+ public float getNewFloatValue() {
+ return notification.getNewFloatValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldIntValue()
+ *
+ * @return
+ */
+ @Override
+ public int getOldIntValue() {
+ return notification.getOldIntValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewIntValue()
+ *
+ * @return
+ */
+ @Override
+ public int getNewIntValue() {
+ return notification.getNewIntValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldLongValue()
+ *
+ * @return
+ */
+ @Override
+ public long getOldLongValue() {
+ return notification.getOldLongValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewLongValue()
+ *
+ * @return
+ */
+ @Override
+ public long getNewLongValue() {
+ return notification.getNewLongValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldShortValue()
+ *
+ * @return
+ */
+ @Override
+ public short getOldShortValue() {
+ return notification.getOldShortValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewShortValue()
+ *
+ * @return
+ */
+ @Override
+ public short getNewShortValue() {
+ return notification.getNewShortValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getOldStringValue()
+ *
+ * @return
+ */
+ @Override
+ public String getOldStringValue() {
+ return notification.getOldStringValue();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Notification#getNewStringValue()
+ *
+ * @return
+ */
+ @Override
+ public String getNewStringValue() {
+ return notification.getNewStringValue();
+ }
+
+}
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProvider.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProvider.java
index 77dbf80de26..77dbf80de26 100644..100755
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProvider.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/simple/SimpleSashWindowsContentProvider.java
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/singlefolder/SingleFolderModel.java b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/singlefolder/SingleFolderModel.java
index 6ae1dfdee10..37a87936992 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/singlefolder/SingleFolderModel.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/src/org/eclipse/papyrus/infra/core/sasheditor/contentprovider/singlefolder/SingleFolderModel.java
@@ -11,7 +11,7 @@
*
* Contributors:
* Cedric Dumoulin Cedric.dumoulin@lifl.fr - Initial API and implementation
- *
+ * Vincent Lorenzo - vincent.lorenzo@cea.fr - bug 540218
*****************************************************************************/
package org.eclipse.papyrus.infra.core.sasheditor.contentprovider.singlefolder;
@@ -93,7 +93,7 @@ public class SingleFolderModel implements ITabFolderModel {
*/
public IPageModel removeTab(int index) {
IPageModel removed = itemModels.remove(index);
- contentProvider.firePropertyChanged(new ContentEvent(ContentEvent.ADDED, this, removed));
+ contentProvider.firePropertyChanged(new ContentEvent(ContentEvent.REMOVED, this, removed));
return removed;
}
@@ -105,7 +105,7 @@ public class SingleFolderModel implements ITabFolderModel {
*/
public void removeTab(IPageModel tabItem) {
itemModels.remove(tabItem);
- contentProvider.firePropertyChanged(new ContentEvent(ContentEvent.ADDED, this, tabItem));
+ contentProvider.firePropertyChanged(new ContentEvent(ContentEvent.REMOVED, this, tabItem));
}
/**
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/usecases.md b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/usecases.md
new file mode 100755
index 00000000000..ec4a6673abf
--- /dev/null
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.core.sasheditor/usecases.md
@@ -0,0 +1,15 @@
+
+#usecase1
+We must be able to override the open/close actions. By Override, I mean add additional action before/after the standart behavior, or replace it.
+
+Currently, we are able to add additional action after a open, registring a listener (IContentChangeListener) on the IContentChangeProvider. This one uses the ContentEvent to notify the changes or (since bug 540218), the NotificationContentEvent class.
+
+The notification must provides the previous value, the new value, the notifier, and the type of notification (as implemented by the EMF Notification).
+
+
+#usecase2
+(not done by this plugin)
+the user must be able to change the page name and the page label (internationlization)
+
+#usecase3
+the user must be able to how the Papyrus editors must be displayed: as tab in the Papyrus Editor or as self editor in Eclipse IDE. \ No newline at end of file

Back to the top