Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpguilet2017-02-09 15:35:00 +0000
committerPierre-Charles David2017-03-07 16:30:08 +0000
commit4bdc7ed264e50b0675d5e4d8262fcd32b803e08f (patch)
treea1146ac26caebccbf9d989e87f92acf3b13cf1f1
parentfd245bca596467cc32227c4e12fe4ceeff21c728 (diff)
downloadorg.eclipse.sirius-4bdc7ed264e50b0675d5e4d8262fcd32b803e08f.tar.gz
org.eclipse.sirius-4bdc7ed264e50b0675d5e4d8262fcd32b803e08f.tar.xz
org.eclipse.sirius-4bdc7ed264e50b0675d5e4d8262fcd32b803e08f.zip
[497653] Merge IRefreshExtension and IRefreshOverride
- Merge IRefreshOverride method into IRefreshExtension. - Update release note accordingly. Bug: 497653 Change-Id: I306c09365fe89c38f397264e69fe3e0220b2b891 Signed-off-by: pguilet <pierre.guilet@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshExtension.java34
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshOverride.java40
-rw-r--r--plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/RefreshExtensionService.java14
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.html26
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile8
5 files changed, 62 insertions, 60 deletions
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshExtension.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshExtension.java
index a02dd4a02e..acac36ced4 100644
--- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshExtension.java
+++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2017 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,11 +20,9 @@ import org.eclipse.sirius.diagram.DDiagram;
public interface IRefreshExtension {
/**
- * This operation is invoked before the refresh mechanism. Only needed
- * changes must be done in this operation. The refresh mechanism is complex
- * and this operation can have unintended consequences if you don't control
- * all elements handled through the refresh. It should therefore be used
- * with caution.
+ * This operation is invoked before the refresh mechanism. Only needed changes must be done in this operation. The
+ * refresh mechanism is complex and this operation can have unintended consequences if you don't control all
+ * elements handled through the refresh. It should therefore be used with caution.
*
* @param dDiagram
* the diagram to refresh.
@@ -32,15 +30,29 @@ public interface IRefreshExtension {
void beforeRefresh(DDiagram dDiagram);
/**
- * This operation is invoked after the refresh mechanism. Only needed
- * changes must be done in this operation. The refresh mechanism is complex
- * and this operation can have unintended consequences if you don't control
- * all elements handled through the refresh. It should therefore be used
- * with caution.
+ * This operation is invoked after the refresh mechanism. Only needed changes must be done in this operation. The
+ * refresh mechanism is complex and this operation can have unintended consequences if you don't control all
+ * elements handled through the refresh. It should therefore be used with caution.
*
* @param dDiagram
* the diagram to refresh.
*/
void postRefresh(DDiagram dDiagram);
+ /**
+ * This operation is invoked before the refresh to give a chance to external code to override completely the default
+ * refresh implementation. If true is returned by the implementer then the default implementation will not be
+ * triggered at all.
+ *
+ * The refresh mechanism is complex and this operation can have unintended consequences if you don't control all
+ * elements handled through the refresh. It should therefore be used with caution.
+ *
+ * @param dDiagram
+ * the diagram to refresh.
+ * @return true if the refresh should not be done, false otherwise.
+ */
+ default boolean aroundRefresh(DDiagram dDiagram) {
+ return false;
+ }
+
}
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshOverride.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshOverride.java
deleted file mode 100644
index 3c3e174fd2..0000000000
--- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/IRefreshOverride.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2016 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.sirius.diagram.business.api.refresh;
-
-import org.eclipse.sirius.diagram.DDiagram;
-
-/**
- * An interface which might be implemented by a {@link IRefreshExtension}
- * instance to bypass the default refresh implementation.
- *
- * @author Cedric Brun <cedric.brun@obeo.fr>
- *
- */
-public interface IRefreshOverride {
-
- /**
- * This operation is invoked before the refresh to give a chance to external
- * code to override completely the default refresh implementation. If true
- * is returned by the implementer then the default implementation will not
- * be triggered at all.
- *
- * The refresh mechanism is complex and this operation can have unintended
- * consequences if you don't control all elements handled through the
- * refresh. It should therefore be used with caution.
- *
- * @param dDiagram
- * the diagram to refresh.
- * @return true if the refresh should not be done, false otherwise.
- */
- boolean aroundRefresh(DDiagram dDiagram);
-
-}
diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/RefreshExtensionService.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/RefreshExtensionService.java
index b280a08fab..041fd0c451 100644
--- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/RefreshExtensionService.java
+++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/refresh/RefreshExtensionService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES.
+ * Copyright (c) 2007, 2017 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ import org.eclipse.sirius.diagram.business.internal.helper.refresh.RefreshExtens
*
* @author ymortier
*/
-public final class RefreshExtensionService implements IRefreshExtension, IRefreshOverride {
+public final class RefreshExtensionService implements IRefreshExtension {
/** Name of the extension point to parse for refresh extension providers. */
private static final String REFRESH_EXTENSION_PROVIDER_EXTENSION_POINT = "org.eclipse.sirius.refreshExtensionProvider"; //$NON-NLS-1$
@@ -40,7 +40,9 @@ public final class RefreshExtensionService implements IRefreshExtension, IRefres
/** The instance of the service. */
private static RefreshExtensionService instance = new RefreshExtensionService();
- /** All providers (instance of {@link RefreshExtensionProviderDescriptor}. */
+ /**
+ * All providers (instance of {@link RefreshExtensionProviderDescriptor}.
+ */
private List<RefreshExtensionProviderDescriptor> providers;
/** <code>true</code> if providers are loaded. */
@@ -110,6 +112,7 @@ public final class RefreshExtensionService implements IRefreshExtension, IRefres
* {@inheritDoc}
*
*/
+ @Override
public void beforeRefresh(final DDiagram viewPoint) {
final ListIterator<RefreshExtensionProviderDescriptor> iterProviders = this.getProviders().listIterator();
@@ -128,6 +131,7 @@ public final class RefreshExtensionService implements IRefreshExtension, IRefres
* {@inheritDoc}
*
*/
+ @Override
public void postRefresh(final DDiagram viewPoint) {
final ListIterator<RefreshExtensionProviderDescriptor> iterProviders = this.getProviders().listIterator();
@@ -158,9 +162,7 @@ public final class RefreshExtensionService implements IRefreshExtension, IRefres
if (RefreshExtensionService.safeProvides(refreshExtensionProvider, dDiagram)) {
final IRefreshExtension refreshExtension = RefreshExtensionService.safeGetRefreshExtension(refreshExtensionProvider, dDiagram);
- if (refreshExtension instanceof IRefreshOverride) {
- oneOverride = ((IRefreshOverride) refreshExtension).aroundRefresh(dDiagram) || oneOverride;
- }
+ oneOverride = refreshExtension.aroundRefresh(dDiagram) || oneOverride;
}
}
return oneOverride;
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
index 96e107e326..764c3846e9 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html
@@ -136,6 +136,26 @@
<code>org.eclipse.sirius.ui.tools.api.wizards.page.ViewpointsSelectionWizardPage.setColumnWidthEquality(boolean)</code> has been added to allow modification of column width equality (with default value &#8220;false&#8221;) of the root composite of the viewpoint selection wizard.
</li>
</ul>
+ <h4 id="Changesinorg.eclipse.sirius.diagram">Changes in
+ <code>org.eclipse.sirius.diagram</code>
+ </h4>
+ <ul>
+ <li><span class="label label-info">Moved</span> The method
+ <code>org.eclipse.sirius.diagram.business.api.refresh.IRefreshOverride.aroundRefresh(DDiagram)</code> has been moved to
+ <code>org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension</code> to unify methods handling refresh extension under one interface.
+ </li>
+ </ul>
+ <ul>
+ <li><span class="label label-info">Modified</span> The method
+ <code>org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension.aroundRefresh(DDiagram)</code> has been modified with a default behavior that is the one before introduction of the method to avoid breaking compatibility.
+ </li>
+ </ul>
+ <ul>
+ <li><span class="label label-danger">Removed</span> The interface
+ <code>org.eclipse.sirius.diagram.business.api.refresh.IRefreshOverride</code> has been removed because its only method has been moved into
+ <code>org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension</code> interface
+ </li>
+ </ul>
<h4 id="Changesinorg.eclipse.sirius">Changes in
<code>org.eclipse.sirius</code>
</h4>
@@ -627,7 +647,7 @@ SWTBotUtils.waitAllUiEvents();
<code>HierarchyLabelProvider</code>.
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram2">Changes in
<code>org.eclipse.sirius.diagram</code>
</h4>
<ul>
@@ -1053,7 +1073,7 @@ SWTBotUtils.waitAllUiEvents();
<code>org.eclipse.sirius.common.tools.api.interpreter.IInterpreterStatus</code> to reflect all kind of language validation severity (of AQL for example).
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram2">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram3">Changes in
<code>org.eclipse.sirius.diagram</code>
</h4>
<ul>
@@ -2356,7 +2376,7 @@ SWTBotUtils.waitAllUiEvents();
<code>org.eclipse.sirius.editor.tools.api.assist.TypeContentProposalProvider.bindCompletionProcessor(AbstractPropertySection, Text)</code>, the difference is that it binds the completion processors available in plugins to the text.
</li>
</ul>
- <h4 id="Changesinorg.eclipse.sirius.diagram3">Changes in
+ <h4 id="Changesinorg.eclipse.sirius.diagram4">Changes in
<code>org.eclipse.sirius.diagram</code>
</h4>
<ul>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
index 03c63bbe7c..af62a4dcca 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile
@@ -23,6 +23,14 @@ h4. Changes in @org.eclipse.sirius.ui@
* <span class="label label-success">Added</span> The method @org.eclipse.sirius.ui.tools.api.wizards.page.ViewpointsSelectionWizardPage.setColumnWidthEquality(boolean)@ has been added to allow modification of column width equality (with default value "false") of the root composite of the viewpoint selection wizard.
+h4. Changes in @org.eclipse.sirius.diagram@
+
+* <span class="label label-info">Moved</span> The method @org.eclipse.sirius.diagram.business.api.refresh.IRefreshOverride.aroundRefresh(DDiagram)@ has been moved to @org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension@ to unify methods handling refresh extension under one interface.
+
+* <span class="label label-info">Modified</span> The method @org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension.aroundRefresh(DDiagram)@ has been modified with a default behavior that is the one before introduction of the method to avoid breaking compatibility.
+
+* <span class="label label-danger">Removed</span> The interface @org.eclipse.sirius.diagram.business.api.refresh.IRefreshOverride@ has been removed because its only method has been moved into @org.eclipse.sirius.diagram.business.api.refresh.IRefreshExtension@ interface
+
h4. Changes in @org.eclipse.sirius@
* <span class="label label-info">Modified</span> The extension point @org.eclipse.sirius.ui.modelingprojectresourcelistener@ is no longer expected to be used. It is an internal extension point. Clients using this extension point to ignore some files as potential semantic models must now use the extension point @org.eclipse.sirius.resourceStrategy@. This extension point existed before Sirius 5.0.0 but was not API. It becomes API with Sirius 5.0.0, see the "developer documentation":developer/extensions-provide_resource_strategy.html for more details.

Back to the top