From 7ccfc7ee91d72f15872b18dc1e79fea4b4a2b632 Mon Sep 17 00:00:00 2001 From: Fabian Brosig <fabian.brosig@uni-wuerzburg.de> Date: Mon, 18 Nov 2013 15:39:40 +0000 Subject: [PATCH] changing RandomVariable->ProbabilityFunction in genmodel git-svn-id: https://se1.informatik.uni-wuerzburg.de/usvn/svn/code/code/DMM/trunk@13676 9e42b895-fcda-4063-8a3b-11be15eb1bbd --- ...omVariable_probFunction_BooleanLiteral.gif | Bin 0 -> 223 bytes ...teRandomVariable_probFunction_BoxedPDF.gif | Bin 0 -> 223 bytes ...domVariable_probFunction_DoubleLiteral.gif | Bin 0 -> 223 bytes ...e_probFunction_ExponentialDistribution.gif | Bin 0 -> 223 bytes ...RandomVariable_probFunction_IntLiteral.gif | Bin 0 -> 223 bytes ...riable_probFunction_NormalDistribution.gif | Bin 0 -> 223 bytes ...e_probFunction_ProbabilityMassFunction.gif | Bin 0 -> 223 bytes .../provider/RandomVariableItemProvider.java | 79 +++++++++--- .../plugin.xml | 122 ------------------ .../presentation/FunctionsEditor.java | 79 ++++++------ .../ParameterdependenciesEditor.java | 81 ++++++------ .../presentation/RepositoryEditor.java | 79 ++++++------ .../presentation/ServicebehaviorEditor.java | 81 ++++++------ .../system/presentation/SystemEditor.java | 79 ++++++------ 14 files changed, 252 insertions(+), 348 deletions(-) create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BooleanLiteral.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BoxedPDF.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_DoubleLiteral.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ExponentialDistribution.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_IntLiteral.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_NormalDistribution.gif create mode 100644 edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ProbabilityMassFunction.gif diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BooleanLiteral.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BooleanLiteral.gif new file mode 100644 index 0000000000000000000000000000000000000000..28d7cba309af0031fd81430272f6a986c93062b8 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU@ymQ^}9IQ;(~KR@37|9$(0 zh6adu<+4ja@m<r^fN1L^<#k>1OPi$TRf^3l5&rl0JrMo<d>)AYJYW3#ZZps{2vGdV z!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb4%C>v z`~<s5pVpjHC*7<Vbky#9yI2SWHOzjI@L|!(cBX|1Zt^!;YHsIhoqm~~&yZ8ol-k&o Jt*Xdi4FEZgVF&;K literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BoxedPDF.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_BoxedPDF.gif new file mode 100644 index 0000000000000000000000000000000000000000..81bed353002b5878eb2af720dbd012ddc6101d2f GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6{Qmv*&6}h5@6W$<sq+8-`1$en|L@y3 zG&CGIaA3}yIhD&UIXF1%nyv;!TPG>6>ylsEBsH&6Y-Wk@zrXK+=<nzAK=kMN;@@|h zfu=!#;!hSv5K9L{fb3*ojZskOONq2oW0-mN@RSQ%C-pb?O)Bv;{%q27Eqjutn0mid za;9^j#_Z)M*hTuZ=A1g|X2qbRcHi5@LLjJN_KSoMi%zyPElhBeztK{2J6G%U%k+GP PoSLT8#-?mlMFwjCrs8Bp literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_DoubleLiteral.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_DoubleLiteral.gif new file mode 100644 index 0000000000000000000000000000000000000000..dbd19ede270d3cac0415be640c33b63e4b122331 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b|NQ$64Gj(s4*&nh&yTnNf8QR+ z1&Ys^GpBOdC7}4O>1sf<b&~SBF8QTRQu8XsW|j#5`}-b<{(e3WM1P(y{(ZL@Xc`14 z{$ybUv2;KL$W8{<7zKsClt?=@hM8v%Pr0ylQh#&bq!Lf#&n7+BvL|VZsrO4IXF3OJ z%wB$iU8GNI&Z(1bRt!37_q|;#1cDl7zexD7=wv(7!UQ+@8!a`rbG1&tOwVV?scA}W LY|2(uWUvMRG+1E( literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ExponentialDistribution.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ExponentialDistribution.gif new file mode 100644 index 0000000000000000000000000000000000000000..83824fbf1ff96492d11694251fc70b689c1e120a GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b|NZ$54Gj(s4*&nh&yTnNf8QR+ z1&Ys^GpBOdC7}4O>1sf<b&~SBF8QTRQu8XsW|j#5`}-b<{(e3WM1P(y{(ZL@Xc`14 z{$ybUv2;KL$W8{<7zKsClt?=@hM8v%Pr0ylQh#&bq!Lf#&n7+BvL|VZsrO4IXF3OJ z%wB$iU8GNI&Z(1bRt!37_q|;#1cDl7zexD7=wv(7!UQ+@8!a`rbG1&tOwVV?scA}W LY|2(uWUvMRG?-xk literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_IntLiteral.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_IntLiteral.gif new file mode 100644 index 0000000000000000000000000000000000000000..758dafb7cd607cb64fb329445c0d76e298381756 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6{Qmm;&Cxga=ik3ndFlWE`1$en|L@y3 zG&CGIaA3}yIhD&UIXF1%nyv;!TPG>6>ylsEBsH&6Y-Wk@zrXK+=<nzAK=kMN;@@|h zfu=!#;!hSv5K9L{fb3*ojZskOONq2oW0-mN@RSQ%C-pb?O)Bv;{%q27Eqjutn0mid za;9^j#_Z)M*hTuZ=A1g|X2qbRcHi5@LLjJN_KSoMi%zyPElhBeztK{2J6G%U%k+GP PoSLT8#-?mlMFwjCrW|BN literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_NormalDistribution.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_NormalDistribution.gif new file mode 100644 index 0000000000000000000000000000000000000000..4e47629dccd1a3ceb230a3cbff1ef729b8ecbe01 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU?84F?<?9RB~0pC51k|Gs@g zLjy#-a@i%I_^#<{K(uv|^13ehrA<=vD#d1&2><*09*F*aJ`Y5Ho-h7=w;5;}1StMw zVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI2Wre- zeu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5(N^NY) JR#jxM1_0z&V3z;@ literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ProbabilityMassFunction.gif b/edu.kit.ipd.descartes.mm.applicationlevel.edit/icons/full/ctool16/CreateRandomVariable_probFunction_ProbabilityMassFunction.gif new file mode 100644 index 0000000000000000000000000000000000000000..9f85940ddf591c7f87372bfa13e6bee574e86224 GIT binary patch literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK2(N4$PS|r*hdP2M32;)75}z>m=oMUGhttq~=wM%`6fA_xC*z{r!9%i2giZ{QGV* z&@>28{K>)yV(EYgkev*yF$xNODUo(+3^UIjo^oO9r2gi<NhO}fpG|tMWlz!+Q}35b z&U6mcn7#Z2yGWnboKq*=tQd6E?t8mf2n03Eev$BD(aCnEg$Zu*H(F|L=W3mPnV!#( PQ`3~%*p#iR$Y2cs2JT`T literal 0 HcmV?d00001 diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.edit/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/provider/RandomVariableItemProvider.java b/edu.kit.ipd.descartes.mm.applicationlevel.edit/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/provider/RandomVariableItemProvider.java index d78095a4..df49e25e 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.edit/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/provider/RandomVariableItemProvider.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.edit/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/provider/RandomVariableItemProvider.java @@ -4,6 +4,7 @@ package edu.kit.ipd.descartes.mm.applicationlevel.functions.provider; +import edu.kit.ipd.descartes.mm.applicationlevel.functions.FunctionsFactory; import edu.kit.ipd.descartes.mm.applicationlevel.functions.FunctionsPackage; import edu.kit.ipd.descartes.mm.applicationlevel.functions.RandomVariable; @@ -17,6 +18,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; @@ -64,7 +66,6 @@ public class RandomVariableItemProvider super.getPropertyDescriptors(object); addSpecificationPropertyDescriptor(object); - addProbFunctionPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -92,25 +93,33 @@ public class RandomVariableItemProvider } /** - * This adds a property descriptor for the Prob Function feature. + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ - protected void addProbFunctionPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_RandomVariable_probFunction_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_RandomVariable_probFunction_feature", "_UI_RandomVariable_type"), - FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, - true, - false, - true, - null, - null, - null)); + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); } /** @@ -153,6 +162,9 @@ public class RandomVariableItemProvider case FunctionsPackage.RANDOM_VARIABLE__SPECIFICATION: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; + case FunctionsPackage.RANDOM_VARIABLE__PROB_FUNCTION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; } super.notifyChanged(notification); } @@ -167,6 +179,41 @@ public class RandomVariableItemProvider @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createBooleanLiteral())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createIntLiteral())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createDoubleLiteral())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createProbabilityMassFunction())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createBoxedPDF())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createNormalDistribution())); + + newChildDescriptors.add + (createChildParameter + (FunctionsPackage.Literals.RANDOM_VARIABLE__PROB_FUNCTION, + FunctionsFactory.eINSTANCE.createExponentialDistribution())); } /** diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/plugin.xml b/edu.kit.ipd.descartes.mm.applicationlevel.editor/plugin.xml index 86aab5c4..09fc7870 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/plugin.xml +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/plugin.xml @@ -33,36 +33,6 @@ </editor> </extension> - <extension point="org.eclipse.ui.newWizards"> - <!-- @generated applicationlevel --> - <category - id="org.eclipse.emf.ecore.Wizard.category.ID" - name="%_UI_Wizard_category"/> - <wizard - id="edu.kit.ipd.descartes.mm.applicationlevel.parameterdependencies.presentation.ParameterdependenciesModelWizardID" - name="%_UI_ParameterdependenciesModelWizard_label" - class="edu.kit.ipd.descartes.mm.applicationlevel.parameterdependencies.presentation.ParameterdependenciesModelWizard" - category="org.eclipse.emf.ecore.Wizard.category.ID" - icon="icons/full/obj16/ParameterdependenciesModelFile.gif"> - <description>%_UI_ParameterdependenciesModelWizard_description</description> - <selection class="org.eclipse.core.resources.IResource"/> - </wizard> - </extension> - -null -null -null -null -null -null -null -null -null -null -null -null -null -null <extension point="org.eclipse.ui.newWizards"> <category id="org.eclipse.emf.ecore.Wizard.category.ID" @@ -89,36 +59,6 @@ null </editor> </extension> - <extension point="org.eclipse.ui.newWizards"> - <!-- @generated applicationlevel --> - <category - id="org.eclipse.emf.ecore.Wizard.category.ID" - name="%_UI_Wizard_category"/> - <wizard - id="edu.kit.ipd.descartes.mm.applicationlevel.repository.presentation.RepositoryModelWizardID" - name="%_UI_RepositoryModelWizard_label" - class="edu.kit.ipd.descartes.mm.applicationlevel.repository.presentation.RepositoryModelWizard" - category="org.eclipse.emf.ecore.Wizard.category.ID" - icon="icons/full/obj16/RepositoryModelFile.gif"> - <description>%_UI_RepositoryModelWizard_description</description> - <selection class="org.eclipse.core.resources.IResource"/> - </wizard> - </extension> - -null -null -null -null -null -null -null -null -null -null -null -null -null -null <extension point="org.eclipse.ui.newWizards"> <category id="org.eclipse.emf.ecore.Wizard.category.ID" @@ -145,36 +85,6 @@ null </editor> </extension> - <extension point="org.eclipse.ui.newWizards"> - <!-- @generated applicationlevel --> - <category - id="org.eclipse.emf.ecore.Wizard.category.ID" - name="%_UI_Wizard_category"/> - <wizard - id="edu.kit.ipd.descartes.mm.applicationlevel.servicebehavior.presentation.ServicebehaviorModelWizardID" - name="%_UI_ServicebehaviorModelWizard_label" - class="edu.kit.ipd.descartes.mm.applicationlevel.servicebehavior.presentation.ServicebehaviorModelWizard" - category="org.eclipse.emf.ecore.Wizard.category.ID" - icon="icons/full/obj16/ServicebehaviorModelFile.gif"> - <description>%_UI_ServicebehaviorModelWizard_description</description> - <selection class="org.eclipse.core.resources.IResource"/> - </wizard> - </extension> - -null -null -null -null -null -null -null -null -null -null -null -null -null -null <extension point="org.eclipse.ui.newWizards"> <category id="org.eclipse.emf.ecore.Wizard.category.ID" @@ -201,36 +111,6 @@ null </editor> </extension> - <extension point="org.eclipse.ui.newWizards"> - <!-- @generated applicationlevel --> - <category - id="org.eclipse.emf.ecore.Wizard.category.ID" - name="%_UI_Wizard_category"/> - <wizard - id="edu.kit.ipd.descartes.mm.applicationlevel.system.presentation.SystemModelWizardID" - name="%_UI_SystemModelWizard_label" - class="edu.kit.ipd.descartes.mm.applicationlevel.system.presentation.SystemModelWizard" - category="org.eclipse.emf.ecore.Wizard.category.ID" - icon="icons/full/obj16/SystemModelFile.gif"> - <description>%_UI_SystemModelWizard_description</description> - <selection class="org.eclipse.core.resources.IResource"/> - </wizard> - </extension> - -null -null -null -null -null -null -null -null -null -null -null -null -null -null <extension point="org.eclipse.ui.newWizards"> <category id="org.eclipse.emf.ecore.Wizard.category.ID" @@ -257,6 +137,4 @@ null </editor> </extension> -null -null </plugin> diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/presentation/FunctionsEditor.java b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/presentation/FunctionsEditor.java index 4d92bac6..40008816 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/presentation/FunctionsEditor.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/functions/presentation/FunctionsEditor.java @@ -231,7 +231,7 @@ public class FunctionsEditor * <!-- end-user-doc --> * @generated */ - protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>(); + protected PropertySheetPage propertySheetPage; /** * This is the viewer that shadows the selection in the content outline. @@ -350,7 +350,7 @@ public class FunctionsEditor } } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + if (((PropertySheet)p).getCurrentPage() == propertySheetPage) { getActionBarContributor().setActiveEditor(FunctionsEditor.this); handleActivate(); } @@ -462,15 +462,6 @@ public class FunctionsEditor @Override protected void unsetTarget(Resource target) { basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } } }; @@ -504,7 +495,6 @@ public class FunctionsEditor } } } - return false; } return true; @@ -748,14 +738,8 @@ public class FunctionsEditor if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } - for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); } } }); @@ -961,7 +945,7 @@ public class FunctionsEditor getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } @@ -1419,22 +1403,23 @@ public class FunctionsEditor * @generated */ public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List<?> selection) { - FunctionsEditor.this.setSelectionToViewer(selection); - FunctionsEditor.this.setFocus(); - } + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List<?> selection) { + FunctionsEditor.this.setSelectionToViewer(selection); + FunctionsEditor.this.setFocus(); + } - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } return propertySheetPage; } @@ -1501,7 +1486,6 @@ public class FunctionsEditor // final Map<Object, Object> saveOptions = new HashMap<Object, Object>(); saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); // Do the work within an operation because this is a long running activity that modifies the workbench. // @@ -1554,7 +1538,7 @@ public class FunctionsEditor /** * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1626,9 +1610,20 @@ public class FunctionsEditor * @generated */ public void gotoMarker(IMarker marker) { - List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } + catch (CoreException exception) { + ApplicationlevelEditorPlugin.INSTANCE.log(exception); } } @@ -1819,7 +1814,7 @@ public class FunctionsEditor getActionBarContributor().setActiveEditor(null); } - for (PropertySheetPage propertySheetPage : propertySheetPages) { + if (propertySheetPage != null) { propertySheetPage.dispose(); } diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/parameterdependencies/presentation/ParameterdependenciesEditor.java b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/parameterdependencies/presentation/ParameterdependenciesEditor.java index 871566ba..eb9aa95b 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/parameterdependencies/presentation/ParameterdependenciesEditor.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/parameterdependencies/presentation/ParameterdependenciesEditor.java @@ -122,6 +122,8 @@ import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EValidator; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; @@ -231,7 +233,7 @@ public class ParameterdependenciesEditor * <!-- end-user-doc --> * @generated */ - protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>(); + protected PropertySheetPage propertySheetPage; /** * This is the viewer that shadows the selection in the content outline. @@ -350,7 +352,7 @@ public class ParameterdependenciesEditor } } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + if (((PropertySheet)p).getCurrentPage() == propertySheetPage) { getActionBarContributor().setActiveEditor(ParameterdependenciesEditor.this); handleActivate(); } @@ -462,15 +464,6 @@ public class ParameterdependenciesEditor @Override protected void unsetTarget(Resource target) { basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } } }; @@ -504,7 +497,6 @@ public class ParameterdependenciesEditor } } } - return false; } return true; @@ -748,14 +740,8 @@ public class ParameterdependenciesEditor if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } - for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); } } }); @@ -961,7 +947,7 @@ public class ParameterdependenciesEditor getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } @@ -1419,22 +1405,23 @@ public class ParameterdependenciesEditor * @generated */ public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List<?> selection) { - ParameterdependenciesEditor.this.setSelectionToViewer(selection); - ParameterdependenciesEditor.this.setFocus(); - } + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List<?> selection) { + ParameterdependenciesEditor.this.setSelectionToViewer(selection); + ParameterdependenciesEditor.this.setFocus(); + } - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } return propertySheetPage; } @@ -1501,7 +1488,6 @@ public class ParameterdependenciesEditor // final Map<Object, Object> saveOptions = new HashMap<Object, Object>(); saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); // Do the work within an operation because this is a long running activity that modifies the workbench. // @@ -1554,7 +1540,7 @@ public class ParameterdependenciesEditor /** * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1626,9 +1612,20 @@ public class ParameterdependenciesEditor * @generated */ public void gotoMarker(IMarker marker) { - List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } + catch (CoreException exception) { + ApplicationlevelEditorPlugin.INSTANCE.log(exception); } } @@ -1819,7 +1816,7 @@ public class ParameterdependenciesEditor getActionBarContributor().setActiveEditor(null); } - for (PropertySheetPage propertySheetPage : propertySheetPages) { + if (propertySheetPage != null) { propertySheetPage.dispose(); } diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/presentation/RepositoryEditor.java b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/presentation/RepositoryEditor.java index 9a21af09..f109f3f4 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/presentation/RepositoryEditor.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/repository/presentation/RepositoryEditor.java @@ -231,7 +231,7 @@ public class RepositoryEditor * <!-- end-user-doc --> * @generated */ - protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>(); + protected PropertySheetPage propertySheetPage; /** * This is the viewer that shadows the selection in the content outline. @@ -350,7 +350,7 @@ public class RepositoryEditor } } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + if (((PropertySheet)p).getCurrentPage() == propertySheetPage) { getActionBarContributor().setActiveEditor(RepositoryEditor.this); handleActivate(); } @@ -462,15 +462,6 @@ public class RepositoryEditor @Override protected void unsetTarget(Resource target) { basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } } }; @@ -504,7 +495,6 @@ public class RepositoryEditor } } } - return false; } return true; @@ -748,14 +738,8 @@ public class RepositoryEditor if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } - for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); } } }); @@ -961,7 +945,7 @@ public class RepositoryEditor getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } @@ -1419,22 +1403,23 @@ public class RepositoryEditor * @generated */ public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List<?> selection) { - RepositoryEditor.this.setSelectionToViewer(selection); - RepositoryEditor.this.setFocus(); - } + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List<?> selection) { + RepositoryEditor.this.setSelectionToViewer(selection); + RepositoryEditor.this.setFocus(); + } - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } return propertySheetPage; } @@ -1501,7 +1486,6 @@ public class RepositoryEditor // final Map<Object, Object> saveOptions = new HashMap<Object, Object>(); saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); // Do the work within an operation because this is a long running activity that modifies the workbench. // @@ -1554,7 +1538,7 @@ public class RepositoryEditor /** * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1626,9 +1610,20 @@ public class RepositoryEditor * @generated */ public void gotoMarker(IMarker marker) { - List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } + catch (CoreException exception) { + ApplicationlevelEditorPlugin.INSTANCE.log(exception); } } @@ -1819,7 +1814,7 @@ public class RepositoryEditor getActionBarContributor().setActiveEditor(null); } - for (PropertySheetPage propertySheetPage : propertySheetPages) { + if (propertySheetPage != null) { propertySheetPage.dispose(); } diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/servicebehavior/presentation/ServicebehaviorEditor.java b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/servicebehavior/presentation/ServicebehaviorEditor.java index 546902fd..d4ee54db 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/servicebehavior/presentation/ServicebehaviorEditor.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/servicebehavior/presentation/ServicebehaviorEditor.java @@ -122,6 +122,8 @@ import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EValidator; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; @@ -231,7 +233,7 @@ public class ServicebehaviorEditor * <!-- end-user-doc --> * @generated */ - protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>(); + protected PropertySheetPage propertySheetPage; /** * This is the viewer that shadows the selection in the content outline. @@ -350,7 +352,7 @@ public class ServicebehaviorEditor } } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + if (((PropertySheet)p).getCurrentPage() == propertySheetPage) { getActionBarContributor().setActiveEditor(ServicebehaviorEditor.this); handleActivate(); } @@ -462,15 +464,6 @@ public class ServicebehaviorEditor @Override protected void unsetTarget(Resource target) { basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } } }; @@ -504,7 +497,6 @@ public class ServicebehaviorEditor } } } - return false; } return true; @@ -748,14 +740,8 @@ public class ServicebehaviorEditor if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } - for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); } } }); @@ -961,7 +947,7 @@ public class ServicebehaviorEditor getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } @@ -1419,22 +1405,23 @@ public class ServicebehaviorEditor * @generated */ public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List<?> selection) { - ServicebehaviorEditor.this.setSelectionToViewer(selection); - ServicebehaviorEditor.this.setFocus(); - } + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List<?> selection) { + ServicebehaviorEditor.this.setSelectionToViewer(selection); + ServicebehaviorEditor.this.setFocus(); + } - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } return propertySheetPage; } @@ -1501,7 +1488,6 @@ public class ServicebehaviorEditor // final Map<Object, Object> saveOptions = new HashMap<Object, Object>(); saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); // Do the work within an operation because this is a long running activity that modifies the workbench. // @@ -1554,7 +1540,7 @@ public class ServicebehaviorEditor /** * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1626,9 +1612,20 @@ public class ServicebehaviorEditor * @generated */ public void gotoMarker(IMarker marker) { - List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } + catch (CoreException exception) { + ApplicationlevelEditorPlugin.INSTANCE.log(exception); } } @@ -1819,7 +1816,7 @@ public class ServicebehaviorEditor getActionBarContributor().setActiveEditor(null); } - for (PropertySheetPage propertySheetPage : propertySheetPages) { + if (propertySheetPage != null) { propertySheetPage.dispose(); } diff --git a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/system/presentation/SystemEditor.java b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/system/presentation/SystemEditor.java index bc76b631..40f5166b 100644 --- a/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/system/presentation/SystemEditor.java +++ b/edu.kit.ipd.descartes.mm.applicationlevel.editor/src/edu/kit/ipd/descartes/mm/applicationlevel/system/presentation/SystemEditor.java @@ -231,7 +231,7 @@ public class SystemEditor * <!-- end-user-doc --> * @generated */ - protected List<PropertySheetPage> propertySheetPages = new ArrayList<PropertySheetPage>(); + protected PropertySheetPage propertySheetPage; /** * This is the viewer that shadows the selection in the content outline. @@ -350,7 +350,7 @@ public class SystemEditor } } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { + if (((PropertySheet)p).getCurrentPage() == propertySheetPage) { getActionBarContributor().setActiveEditor(SystemEditor.this); handleActivate(); } @@ -462,15 +462,6 @@ public class SystemEditor @Override protected void unsetTarget(Resource target) { basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } } }; @@ -504,7 +495,6 @@ public class SystemEditor } } } - return false; } return true; @@ -748,14 +738,8 @@ public class SystemEditor if (mostRecentCommand != null) { setSelectionToViewer(mostRecentCommand.getAffectedObjects()); } - for (Iterator<PropertySheetPage> i = propertySheetPages.iterator(); i.hasNext(); ) { - PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { - i.remove(); - } - else { - propertySheetPage.refresh(); - } + if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { + propertySheetPage.refresh(); } } }); @@ -961,7 +945,7 @@ public class SystemEditor getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() }; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance() }; viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); } @@ -1419,22 +1403,23 @@ public class SystemEditor * @generated */ public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { - @Override - public void setSelectionToViewer(List<?> selection) { - SystemEditor.this.setSelectionToViewer(selection); - SystemEditor.this.setFocus(); - } + if (propertySheetPage == null) { + propertySheetPage = + new ExtendedPropertySheetPage(editingDomain) { + @Override + public void setSelectionToViewer(List<?> selection) { + SystemEditor.this.setSelectionToViewer(selection); + SystemEditor.this.setFocus(); + } - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + } return propertySheetPage; } @@ -1501,7 +1486,6 @@ public class SystemEditor // final Map<Object, Object> saveOptions = new HashMap<Object, Object>(); saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); // Do the work within an operation because this is a long running activity that modifies the workbench. // @@ -1554,7 +1538,7 @@ public class SystemEditor /** * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1626,9 +1610,20 @@ public class SystemEditor * @generated */ public void gotoMarker(IMarker marker) { - List<?> targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); + try { + if (marker.getType().equals(EValidator.MARKER)) { + String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); + if (uriAttribute != null) { + URI uri = URI.createURI(uriAttribute); + EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); + if (eObject != null) { + setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); + } + } + } + } + catch (CoreException exception) { + ApplicationlevelEditorPlugin.INSTANCE.log(exception); } } @@ -1819,7 +1814,7 @@ public class SystemEditor getActionBarContributor().setActiveEditor(null); } - for (PropertySheetPage propertySheetPage : propertySheetPages) { + if (propertySheetPage != null) { propertySheetPage.dispose(); } -- GitLab