diff options
| author | Esteban Dugueperoux | 2016-04-06 07:39:00 +0000 |
|---|---|---|
| committer | Pierre-Charles David | 2016-04-11 13:06:59 +0000 |
| commit | 8023bbc4832f9bec64d94e91d0e583676ed91cf2 (patch) | |
| tree | f0c99d9678549d131f629bd5d3fffb35972fd631 | |
| parent | 710612b10934cf413aed0102259af143f268826f (diff) | |
| download | org.eclipse.sirius-8023bbc4832f9bec64d94e91d0e583676ed91cf2.tar.gz org.eclipse.sirius-8023bbc4832f9bec64d94e91d0e583676ed91cf2.tar.xz org.eclipse.sirius-8023bbc4832f9bec64d94e91d0e583676ed91cf2.zip | |
[486330] Update RefreshRepresentationsCommand.canExecute()
- Update RefreshRepresentationsCommand.canExecute() to call
DialectManager.canRefresh().
- Release notes updated about this API behavior change.
Bug: 486330
Change-Id: I51bb370d498092ada1701f48a837fef4ee7ddbcb
Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
3 files changed, 16 insertions, 1 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html index d1ee13c1fe..69ba6943ba 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.html @@ -176,6 +176,11 @@ <li><span class="label label-info">Modified</span> <code>org.eclipse.sirius.business.api.modelingproject.ModelingProject.getMainRepresentationsFileURI()</code> methods no more update workspace resource about markers, now this must be done in caller on IllegalArgumentException catch in a workspace aware operation. </li> + <li><span class="label label-info">Modified</span> + <code>org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.canExecute()</code> now returns false if a + <code>DRepresentation</code> cannot be refreshed, by calling + <code>DialectManager.canRefresh(DRepresentation)</code>. + </li> <li><span class="label label-danger">Removed</span> The class <code>org.eclipse.sirius.business.api.extender.MetamodelDescriptorProvider2</code> has been deleted and is now <code>MetamodelDescriptorProvider</code>. diff --git a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile index 8fa5771b2f..b72204bc48 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release_Notes.textile @@ -43,6 +43,7 @@ h4. Changes in @org.eclipse.sirius@ * <span class="label label-info">Modified</span> @org.eclipse.sirius.viewpoint.description.tool.AbstractVariable@ has been moved to @org.eclipse.sirius.viewpoint.description.AbstractVariable@. * <span class="label label-info">Modified</span> @org.eclipse.sirius.viewpoint.description.tool.SubVariable@ has been moved to @org.eclipse.sirius.viewpoint.description.SubVariable@. * <span class="label label-info">Modified</span> @org.eclipse.sirius.business.api.modelingproject.ModelingProject.getMainRepresentationsFileURI()@ methods no more update workspace resource about markers, now this must be done in caller on IllegalArgumentException catch in a workspace aware operation. +* <span class="label label-info">Modified</span> @org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.canExecute()@ now returns false if a @DRepresentation@ cannot be refreshed, by calling @DialectManager.canRefresh(DRepresentation)@. * <span class="label label-danger">Removed</span> The class @org.eclipse.sirius.business.api.extender.MetamodelDescriptorProvider2@ has been deleted and is now @MetamodelDescriptorProvider@. h4. Changes in @org.eclipse.sirius.common@ diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java index 859a9946d4..75d9f2224d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/command/RefreshRepresentationsCommand.java @@ -134,7 +134,16 @@ public class RefreshRepresentationsCommand extends RecordingCommand { @Override public boolean canExecute() { - return representations.size() != 0; + boolean canExecute = !representations.isEmpty(); + if (canExecute) { + for (DRepresentation dRepresentation : representations) { + if (!DialectManager.INSTANCE.canRefresh(dRepresentation)) { + canExecute = false; + break; + } + } + } + return canExecute; } } |
