From ce112aeea7820db5f6a63b654b0c058bd3d1f534 Mon Sep 17 00:00:00 2001 From: Florian Hoelzl <hoelzl@fortiss.org> Date: Mon, 6 Jun 2016 12:39:26 +0000 Subject: [PATCH] Replaced *Service.INSTANCE with *Service.getInstance(). refs 2597 --- .../AnnotationEditingSupportBase.java | 2 +- .../MultiSelectionEditingSupport.java | 2 +- .../view/AnnotationViewPartBase.java | 4 +- .../CreateAnnotationInstanceColumn.java | 4 +- .../view/generic/GenericAnnotationView.java | 2 +- .../ModelElementTreeContentProvider.java | 2 +- .../ViewerElementCompositionDropAdapter.java | 6 +-- .../editor/AllocationDiagramEditorBase.java | 2 +- .../ui/editor/CommonDiagramEditorBase.java | 8 ++-- .../base/ui/editor/DiagramEditorBase.java | 2 +- .../base/ui/editor/DiagramKeyHandler.java | 2 +- .../tooling/base/ui/editor/GEFEditorBase.java | 2 +- .../ui/editpart/ConnectionEditPartBase.java | 8 ++-- .../base/ui/editpart/ElementEditPartBase.java | 6 +-- .../ui/editpart/GraphicalEditPartBase.java | 2 +- .../ui/editpart/PositionedEditPartBase.java | 10 ++--- .../AllocationElementEditPartBase.java | 2 +- .../AllocationSubDiagramEditPartBase.java | 14 +++--- .../IAllocationPositionService.java | 6 +++ .../command/AllocationConnectCommand.java | 4 +- .../ui/editpart/command/ConnectCommand.java | 4 +- .../ui/editpart/command/ReconnectCommand.java | 4 +- .../ui/editpart/command/RemoveCommand.java | 4 +- .../RelayCreateCommandEditPolicyBase.java | 8 ++-- .../ui/editpart/policy/RemoveEditPolicy.java | 2 +- .../GEF2ToolingKernelCommandStack.java | 2 +- .../ui/library/AddElementToLibraryBase.java | 2 +- .../ui/library/LibrarySelectionDialog.java | 2 +- .../ui/tablecell/IconNameLabelProvider.java | 4 +- .../base/ui/utils/DecorationIconUtils.java | 8 ++-- .../tooling/base/ToolingBaseActivator.java | 2 +- .../annotation/AnnotationValueService.java | 4 +- .../annotation/IAnnotationValueService.java | 6 +++ .../compose/ConnectionCompositorBase.java | 4 +- .../ConnectorConnectionCompositorBase.java | 2 +- ...archicElementConnectionCompositorBase.java | 2 +- .../HierarchicElementCompositorBase.java | 12 ++--- ...archicElementConnectionCompositorBase.java | 2 +- ...mentConnectorConnectionCompositorBase.java | 2 +- .../compose/ModelElementCompositorBase.java | 6 +-- .../library/ModelElementLibraryService.java | 28 +++++++----- .../tooling/base/utils/AnnotationUtils.java | 6 +-- .../kernel/ui/ToolingKernelUIActivator.java | 18 ++++---- ...onnectionCompositionDropTargetAdapter.java | 4 +- .../ElementCompositionDropTargetAdapter.java | 4 +- .../base/ConstraintVerifierUIBases.java | 8 ++-- .../base/EReferencePropertySectionBase.java | 2 +- .../kernel/ui/extension/base/EditorBase.java | 8 ++-- .../extension/base/PropertySectionBase.java | 2 +- .../kernel/ui/internal/ActionService.java | 8 ++-- .../AllocationEditPartFactoryService.java | 2 +- .../ui/internal/ConstraintLabelDecorator.java | 2 +- .../ConstraintVerificationUIService.java | 4 +- ...VerificationUIServicePostLoadProvider.java | 2 +- .../ui/internal/ContextMenuService.java | 14 +++--- .../ui/internal/EditPartFactoryService.java | 2 +- .../kernel/ui/internal/MarkerService.java | 10 ++--- .../internal/MarkerServiceLabelDecorator.java | 2 +- .../internal/ModelEditorBindingService.java | 16 +++---- .../internal/ModelElementHandlerService.java | 2 +- .../kernel/ui/internal/NavigatorService.java | 12 ++--- .../ui/internal/ToolingKernelUIInternal.java | 40 ++++++++--------- .../kernel/ui/internal/TutorialUIService.java | 6 +-- .../kernel/ui/internal/actions/CutAction.java | 4 +- .../ui/internal/actions/DeleteAction.java | 24 +++++----- .../ui/internal/actions/PasteAction.java | 2 +- .../ui/internal/actions/RedoAction.java | 4 +- .../ui/internal/actions/UndoAction.java | 4 +- .../databinding/EObjectObservableValue.java | 2 +- .../internal/editor/ActionBarContributor.java | 2 +- .../editor/ExtendableMultiPageEditor.java | 14 +++--- .../editor/ModelElementEditorInput.java | 2 +- .../KISSViewerContentProvider.java | 6 +-- ...yServiceIntrospectionDetailsUIHandler.java | 2 +- ...eServiceIntrospectionDetailsUIHandler.java | 8 ++-- .../NamedCommentedPropertySection.java | 2 +- .../properties/PropertiesAdapterFactory.java | 2 +- .../ui/internal/views/ConstraintMenu.java | 28 ++++++------ .../kernel/ui/internal/views/DoubleClick.java | 6 +-- .../kernel/ui/internal/views/LibraryView.java | 8 ++-- .../views/LinkWithEditorPartListener.java | 2 +- .../views/MarkerViewContentProvider.java | 2 +- .../ui/internal/views/MarkerViewPart.java | 14 +++--- .../ui/internal/views/NavigatorNewMenu.java | 20 ++++----- .../views/NavigatorTreeContentProvider.java | 20 ++++----- .../views/NavigatorTreeContentSorter.java | 6 +-- .../ui/internal/views/NavigatorViewPart.java | 24 +++++----- ...traintViolationAwareLabelProviderBase.java | 2 +- .../ModelElementLabelProvider.java | 4 +- ...alDefinitionModelElementLabelProvider.java | 2 +- .../kernel/ui/service/IActionService.java | 14 +++++- .../IAllocationEditPartFactoryService.java | 14 +++++- .../IConstraintVerificationUIService.java | 14 +++++- .../ui/service/IContextMenuService.java | 14 +++++- .../ui/service/IEditPartFactoryService.java | 14 +++++- .../kernel/ui/service/IMarkerService.java | 14 +++++- .../service/IModelEditorBindingService.java | 14 +++++- .../service/IModelElementHandlerService.java | 14 +++++- .../kernel/ui/service/INavigatorService.java | 13 +++++- .../kernel/ui/service/ITutorialUIService.java | 13 +++++- .../tooling/kernel/ui/util/ActionUtils.java | 12 ++--- .../kernel/ui/util/ConstraintsUIUtils.java | 4 +- .../kernel/ui/util/CopyPasteUtils.java | 4 +- .../ui/util/TutorialUIServiceUtils.java | 10 ++--- .../kernel/ToolingKernelActivator.java | 26 +++++------ .../constraint/IdConsistencyChecker.java | 2 +- .../kernel/internal/CommandStackService.java | 16 +++---- .../internal/ConnectionCompositorService.java | 2 +- .../internal/ConstraintCheckerService.java | 2 +- .../ConstraintVerificationService.java | 4 +- .../internal/ElementCompositorService.java | 4 +- .../internal/LibraryPrototypeProvider.java | 4 +- .../kernel/internal/LibraryService.java | 12 ++--- .../kernel/internal/LoggingService.java | 2 +- .../kernel/internal/MigrationService.java | 2 +- .../kernel/internal/PersistencyService.java | 8 ++-- .../kernel/internal/PrototypeService.java | 12 ++--- .../internal/ToolingKernelInternal.java | 44 +++++++++---------- .../internal/TransformationService.java | 2 +- .../kernel/internal/TutorialService.java | 10 ++--- .../EclipseResourceStorageProvider.java | 10 ++--- .../storage/eclipse/ModelContext.java | 4 +- .../KernelIntrospectionSystemService.java | 6 +++ .../kernel/service/ICommandStackService.java | 14 +++++- .../service/IConnectionCompositorService.java | 13 +++++- .../service/IConstraintCheckerService.java | 13 +++++- .../IConstraintVerificationService.java | 13 +++++- .../service/IElementCompositorService.java | 13 +++++- .../kernel/service/ILibraryService.java | 13 +++++- .../kernel/service/ILoggingService.java | 13 +++++- .../kernel/service/IMigrationService.java | 14 +++++- .../kernel/service/IPersistencyService.java | 14 +++++- .../kernel/service/IPrototypeService.java | 14 +++++- .../service/ITransformationService.java | 14 +++++- .../kernel/service/ITutorialService.java | 13 +++++- .../kernel/utils/KernelModelElementUtils.java | 6 +-- .../tooling/kernel/utils/PrototypesUtils.java | 2 +- .../tooling/kernel/utils/ResourceUtils.java | 4 +- .../tooling/kernel/utils/ServicesUtils.java | 2 +- .../kernel/utils/TransformationUtils.java | 4 +- .../tooling/kernel/utils/UniqueIDUtils.java | 2 +- 141 files changed, 682 insertions(+), 429 deletions(-) diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/AnnotationEditingSupportBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/AnnotationEditingSupportBase.java index 12e18ee76..510723fd1 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/AnnotationEditingSupportBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/AnnotationEditingSupportBase.java @@ -98,7 +98,7 @@ public abstract class AnnotationEditingSupportBase extends EditingSupport { final AnnotationEntry annotationEntry = (AnnotationEntry)element; ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(annotationEntry + IPersistencyService.getInstance().getTopLevelElementFor(annotationEntry .getModelElement()); modelContext.runAsCommand(new Runnable() { diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionEditingSupport.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionEditingSupport.java index 5b2a753dc..1fa012a2d 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionEditingSupport.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/editingsupport/MultiSelectionEditingSupport.java @@ -138,7 +138,7 @@ public class MultiSelectionEditingSupport extends AnnotationEditingSupportBase { final AnnotationEntry entry = (AnnotationEntry)element; ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(entry.getModelElement()); + IPersistencyService.getInstance().getTopLevelElementFor(entry.getModelElement()); modelContext.runAsCommand(new Runnable() { @Override diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/AnnotationViewPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/AnnotationViewPartBase.java index daf6fbc3d..af8ef0465 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/AnnotationViewPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/AnnotationViewPartBase.java @@ -127,7 +127,7 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect Object notifier = notification.getNotifier(); if((notifier instanceof EObject) && - (IPersistencyService.INSTANCE.getTopLevelElementFor((EObject)notifier) != null)) { + (IPersistencyService.getInstance().getTopLevelElementFor((EObject)notifier) != null)) { // Ignore update requests for elements that are not hooked to a top-level // element, e.g. SET events that are fired when a component is removed (before // the actual REMOVE event). Otherwise, the AnnotationValueService would create @@ -198,7 +198,7 @@ public abstract class AnnotationViewPartBase extends ViewPart implements ISelect */ private void addAnnotationEntry(Collection<AnnotationEntry> annotationEntries, IModelElement modelElement) { - AnnotationEntry entry = IAnnotationValueService.INSTANCE.getAnnotationEntry(modelElement); + AnnotationEntry entry = IAnnotationValueService.getInstance().getAnnotationEntry(modelElement); if(!entry.isEmpty()) { annotationEntries.add(entry); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java index b9bb177b1..7ee5f2d0e 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/CreateAnnotationInstanceColumn.java @@ -226,7 +226,7 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn { // for the input key provided by the user. A write transaction / a switch to the // model context is required to modify the from the GUI context. ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(columnSpecAnnEntry + IPersistencyService.getInstance().getTopLevelElementFor(columnSpecAnnEntry .getModelElement()); modelContext.runAsCommand(new Runnable() { @@ -264,7 +264,7 @@ public class CreateAnnotationInstanceColumn extends ViewerColumn { } AnnotationEntry entry = - IAnnotationValueService.INSTANCE + IAnnotationValueService.getInstance() .getAnnotationEntry(columnSpecAnnEntry .getModelElement()); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/GenericAnnotationView.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/GenericAnnotationView.java index d4cc9d54a..09b5f978f 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/GenericAnnotationView.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/view/generic/GenericAnnotationView.java @@ -267,7 +267,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase { super.update(modelElement); // ensure that selected model element is visible in annotation view - AnnotationEntry entry = IAnnotationValueService.INSTANCE.getAnnotationEntry(modelElement); + AnnotationEntry entry = IAnnotationValueService.getInstance().getAnnotationEntry(modelElement); assert (entry.getModelElement() == modelElement); tableViewer.reveal(entry); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/ModelElementTreeContentProvider.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/ModelElementTreeContentProvider.java index d30d7797c..f655c99a1 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/ModelElementTreeContentProvider.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dialog/ModelElementTreeContentProvider.java @@ -75,7 +75,7 @@ public class ModelElementTreeContentProvider extends TreeContentProviderBase { */ public List<? extends EObject> getChildren(EObject parentElement) { IModelElementHandler<EObject> base = - IModelElementHandlerService.INSTANCE.getModelElementHandler(parentElement); + IModelElementHandlerService.getInstance().getModelElementHandler(parentElement); if(base != null) { return base.getSubnodes(parentElement); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java index e10b705aa..54b8dd05f 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/dnd/jface/ViewerElementCompositionDropAdapter.java @@ -71,7 +71,7 @@ public class ViewerElementCompositionDropAdapter extends ViewerDropAdapter { extractDroppedEObject(CompositionServiceLocalDNDTransfer.getInstance() .getObject()); - return IElementCompositorService.INSTANCE + return IElementCompositorService.getInstance() .canCompose((EObject)lastTarget, dropped, null); } return false; @@ -83,11 +83,11 @@ public class ViewerElementCompositionDropAdapter extends ViewerDropAdapter { if(lastTarget instanceof EObject) { final EObject target = (EObject)lastTarget; final EObject dropped = DragAndDropUtils.extractDroppedEObject(data); - if(IElementCompositorService.INSTANCE.canCompose(target, dropped, null)) { + if(IElementCompositorService.getInstance().canCompose(target, dropped, null)) { runAsCommand(target, new Runnable() { @Override public void run() { - IElementCompositorService.INSTANCE.compose(target, dropped, null); + IElementCompositorService.getInstance().compose(target, dropped, null); } }); return true; diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AllocationDiagramEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AllocationDiagramEditorBase.java index 67023c2cb..2c98d6219 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AllocationDiagramEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/AllocationDiagramEditorBase.java @@ -49,6 +49,6 @@ public class AllocationDiagramEditorBase<T extends EObject> extends CommonDiagra super.select(editpart); } } - }, IAllocationEditPartFactoryService.INSTANCE); + }, IAllocationEditPartFactoryService.getInstance()); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/CommonDiagramEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/CommonDiagramEditorBase.java index f3c91b728..7f0ae6241 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/CommonDiagramEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/CommonDiagramEditorBase.java @@ -267,7 +267,7 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase< /** Creates the context menu. */ private void createContextMenu() { - MenuManager menuManager = IContextMenuService.INSTANCE.createDefaultContextMenu(this); + MenuManager menuManager = IContextMenuService.getInstance().createDefaultContextMenu(this); Menu contextMenu = menuManager.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(contextMenu); @@ -321,7 +321,7 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase< } }); - if(ILibraryService.INSTANCE.isLibraryElementShadow(editedObject) || + if(ILibraryService.getInstance().isLibraryElementShadow(editedObject) || (editedObject instanceof ILibraryElementReference)) { ((ScalableRootEditPart)viewer.getRootEditPart()).deactivate(); } @@ -436,7 +436,7 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase< * TODO: remove */ protected EditPartFactory createEditPartFactory() { - return IEditPartFactoryService.INSTANCE; + return IEditPartFactoryService.getInstance(); } /** @@ -525,7 +525,7 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase< ((EObjectActionBase)action).refresh(element); } } - IActionService.INSTANCE.refresh(); + IActionService.getInstance().refresh(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramEditorBase.java index e7b4c98c1..faeb477ef 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramEditorBase.java @@ -40,6 +40,6 @@ public class DiagramEditorBase<T extends EObject> extends CommonDiagramEditorBas /** Constructor. */ public DiagramEditorBase() { - super(new ScrollingGraphicalViewer(), IEditPartFactoryService.INSTANCE); + super(new ScrollingGraphicalViewer(), IEditPartFactoryService.getInstance()); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramKeyHandler.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramKeyHandler.java index 700cb6391..9e4f4a0c3 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramKeyHandler.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/DiagramKeyHandler.java @@ -99,7 +99,7 @@ public class DiagramKeyHandler extends KeyHandler { return false; final ILayoutedModelElement model = (ILayoutedModelElement)viewer.getFocusEditPart().getModel(); - ITopLevelElement topLevel = IPersistencyService.INSTANCE.getTopLevelElementFor(model); + ITopLevelElement topLevel = IPersistencyService.getInstance().getTopLevelElementFor(model); final Point scrollCoeff = computeScrollCoeff(event); scrollCoeff.scale(DEFAULT_GRID_SIZE); topLevel.runAsCommand(new Runnable() { diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/GEFEditorBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/GEFEditorBase.java index 10bfa24ca..be1cc2d5c 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/GEFEditorBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editor/GEFEditorBase.java @@ -54,7 +54,7 @@ public abstract class GEFEditorBase<T extends EObject> extends // object is deleted if it does not have a parent and is not a // top-level element if(getEditedObject().eContainer() == null && - IPersistencyService.INSTANCE.getTopLevelElementFor(getEditedObject()) != null) { + IPersistencyService.getInstance().getTopLevelElementFor(getEditedObject()) != null) { getSite().getPage().closeEditor(GEFEditorBase.this, false); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectionEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectionEditPartBase.java index b0fa22542..394688203 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectionEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ConnectionEditPartBase.java @@ -127,7 +127,7 @@ public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase> ex this.layoutConfiguration = layoutConfiguration; setModel(modelElement); this.modelElementHandler = - (IModelElementHandler<T>)IModelElementHandlerService.INSTANCE + (IModelElementHandler<T>)IModelElementHandlerService.getInstance() .getModelElementHandler(modelElement); this.relationshipLabel = new Label(determineRelationshipLabelFigureText()) { /** {@inheritDoc} */ @@ -190,14 +190,14 @@ public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase> ex if(decorationFigure.getParent() != null && decorationBounds != null) { decorationFigure.getParent().setConstraint(decorationFigure, decorationBounds); - ESeverity severity = IMarkerService.INSTANCE.getHighestViolationSeverity(getModel()); + ESeverity severity = IMarkerService.getInstance().getHighestViolationSeverity(getModel()); Image icon = getMarkerServiceDecorationIcon(severity, useSmallDecorationImage()); decorationFigure.setIcon(icon); if(icon != null) { String message = ""; Collection<IConstraintViolation<? extends EObject>> violations = - IMarkerService.INSTANCE.getViolations(getModel()); + IMarkerService.getInstance().getViolations(getModel()); for(IConstraintViolation<? extends EObject> viol : violations) { if(viol.getSeverity() == severity) { message = viol.getExplanation(); @@ -249,7 +249,7 @@ public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase> ex /** {@inheritDoc} */ @Override protected void refreshVisuals() { - connection.setToolTip(new Label(IModelElementHandlerService.INSTANCE + connection.setToolTip(new Label(IModelElementHandlerService.getInstance() .getWrappedNameDescription(getModel()))); refreshBendpoints(); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java index e599db332..9d7310144 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/ElementEditPartBase.java @@ -81,7 +81,7 @@ public abstract class ElementEditPartBase<T extends ILayoutedModelElement & INam nameLabel.setFont(DEFAULT_TITLE_FONT); nameLabel.setTextAlignment(PositionConstants.LEFT | PositionConstants.TOP); nameLabel.setTextPlacement(PositionConstants.EAST); - nameLabel.setIcon(IModelElementHandlerService.INSTANCE.getModelElementHandler(getModel()) + nameLabel.setIcon(IModelElementHandlerService.getInstance().getModelElementHandler(getModel()) .getIcon(getModel())); return nameLabel; } @@ -135,11 +135,11 @@ public abstract class ElementEditPartBase<T extends ILayoutedModelElement & INam if(req.getType() == RequestConstants.REQ_OPEN) { EObject eo = getModel(); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(eo); + IModelElementHandlerService.getInstance().getModelElementHandler(eo); if(handler != null) { eo = handler.handleOpenModelElementRequest(eo); } - IModelEditorBindingService.INSTANCE.openInEditor(eo); + IModelEditorBindingService.getInstance().openInEditor(eo); } super.performRequest(req); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/GraphicalEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/GraphicalEditPartBase.java index aa8a420ab..7173bc396 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/GraphicalEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/GraphicalEditPartBase.java @@ -74,7 +74,7 @@ public abstract class GraphicalEditPartBase<T extends EObject> extends AbstractG protected GraphicalEditPartBase(T modelElement) { setModel(modelElement); this.modelElementHandler = - (IModelElementHandler<T>)IModelElementHandlerService.INSTANCE + (IModelElementHandler<T>)IModelElementHandlerService.getInstance() .getModelElementHandler(modelElement); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/PositionedEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/PositionedEditPartBase.java index b2d48ce80..9f37f413a 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/PositionedEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/PositionedEditPartBase.java @@ -192,7 +192,7 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex if(labelFigure != null && labelFigure.getParent() != null) { labelFigure.setText(determineLabelFigureText()); if(labelFigure.getIcon() != null) { - labelFigure.setIcon(IModelElementHandlerService.INSTANCE.getModelElementHandler( + labelFigure.setIcon(IModelElementHandlerService.getInstance().getModelElementHandler( getModel()).getIcon(getModel())); } Rectangle labelBounds = determineLabelFigureBounds(); @@ -207,8 +207,8 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex /** Returns the current tooltip description. */ protected String getBaseFigureTooltip() { - String message = IModelElementHandlerService.INSTANCE.getWrappedNameDescription(getModel()); - ESeverity sev = IMarkerService.INSTANCE.getHighestViolationSeverity(getModel()); + String message = IModelElementHandlerService.getInstance().getWrappedNameDescription(getModel()); + ESeverity sev = IMarkerService.getInstance().getHighestViolationSeverity(getModel()); switch(sev) { case ERROR: message = getViolationMessage(sev); @@ -228,7 +228,7 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex if(decorationFigure.getParent() != null && decorationBounds != null) { decorationFigure.getParent().setConstraint(decorationFigure, decorationBounds); - ESeverity severity = IMarkerService.INSTANCE.getHighestViolationSeverity(getModel()); + ESeverity severity = IMarkerService.getInstance().getHighestViolationSeverity(getModel()); decorationFigure.setIcon(getMarkerServiceDecorationIcon(severity, useSmallDecorationImage())); } @@ -238,7 +238,7 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex private String getViolationMessage(ESeverity sev) { String message = "Constraints violation in scope."; Collection<IConstraintViolation<? extends EObject>> violations = - IMarkerService.INSTANCE.getViolations(getModel()); + IMarkerService.getInstance().getViolations(getModel()); for(IConstraintViolation<? extends EObject> viol : violations) { if(viol.getSeverity() == sev) { message = viol.getExplanation(); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationElementEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationElementEditPartBase.java index 6aa272d0f..c92f85893 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationElementEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationElementEditPartBase.java @@ -113,7 +113,7 @@ public abstract class AllocationElementEditPartBase<T extends ILayoutedModelElem nameLabel.setFont(DEFAULT_TITLE_FONT); nameLabel.setTextAlignment(PositionConstants.LEFT | PositionConstants.TOP); nameLabel.setTextPlacement(PositionConstants.EAST); - nameLabel.setIcon(IModelElementHandlerService.INSTANCE.getModelElementHandler(getModel()) + nameLabel.setIcon(IModelElementHandlerService.getInstance().getModelElementHandler(getModel()) .getIcon(getModel())); return nameLabel; } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationSubDiagramEditPartBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationSubDiagramEditPartBase.java index 54841adbe..1484b1f5b 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationSubDiagramEditPartBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/AllocationSubDiagramEditPartBase.java @@ -128,7 +128,7 @@ public abstract class AllocationSubDiagramEditPartBase<T extends INamedCommented nameLabel.setFont(DEFAULT_TITLE_FONT); nameLabel.setTextAlignment(PositionConstants.LEFT | PositionConstants.TOP); nameLabel.setTextPlacement(PositionConstants.EAST); - nameLabel.setIcon(IModelElementHandlerService.INSTANCE.getModelElementHandler(getModel()) + nameLabel.setIcon(IModelElementHandlerService.getInstance().getModelElementHandler(getModel()) .getIcon(getModel())); return nameLabel; } @@ -233,18 +233,18 @@ public abstract class AllocationSubDiagramEditPartBase<T extends INamedCommented RootEditPart root = getRoot(); Rectangle rectangle = new Rectangle(reduce); if(isTargetDiagram()) { - IAllocationPositionService.INSTANCE.setMinTargetPos(root, new Point(minX, minY)); + IAllocationPositionService.getInstance().setMinTargetPos(root, new Point(minX, minY)); reduce.resize(DEFAULT_GRID_SIZE, DEFAULT_GRID_SIZE); - IAllocationPositionService.INSTANCE.setTargetAllocationBounds(root, rectangle); + IAllocationPositionService.getInstance().setTargetAllocationBounds(root, rectangle); Rectangle sourceBounds = - IAllocationPositionService.INSTANCE.getSourceAllocationBounds(root); + IAllocationPositionService.getInstance().getSourceAllocationBounds(root); return new Rectangle(reduce.x, sourceBounds.y + sourceBounds.height, reduce.width + minX, reduce.height + 20); } // if sub diagram is the source diagram - IAllocationPositionService.INSTANCE.setMinSourcePos(root, new Point(minX, minY)); + IAllocationPositionService.getInstance().setMinSourcePos(root, new Point(minX, minY)); reduce.resize(DEFAULT_GRID_SIZE, DEFAULT_GRID_SIZE); - IAllocationPositionService.INSTANCE.setSourceAllocationBounds(root, rectangle); + IAllocationPositionService.getInstance().setSourceAllocationBounds(root, rectangle); return reduce; } @@ -361,7 +361,7 @@ public abstract class AllocationSubDiagramEditPartBase<T extends INamedCommented if(decorationFigure.getParent() != null && decorationBounds != null) { decorationFigure.getParent().setConstraint(decorationFigure, decorationBounds); - ESeverity severity = IMarkerService.INSTANCE.getHighestViolationSeverity(getModel()); + ESeverity severity = IMarkerService.getInstance().getHighestViolationSeverity(getModel()); decorationFigure.setIcon(getMarkerServiceDecorationIcon(severity, useSmallDecorationImage())); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java index ca185742c..e9a9b0f5f 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/allocation/IAllocationPositionService.java @@ -32,8 +32,14 @@ import org.eclipse.gef.RootEditPart; public interface IAllocationPositionService { /** Singleton instance. */ + @Deprecated static IAllocationPositionService INSTANCE = new AllocationPositionService(); + /** Returns the service instance. */ + public static IAllocationPositionService getInstance() { + return INSTANCE; + } + /** Returns the top left most position of the source elements. */ Point getMinSourcePos(RootEditPart root); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/AllocationConnectCommand.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/AllocationConnectCommand.java index 45be42155..9237ce908 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/AllocationConnectCommand.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/AllocationConnectCommand.java @@ -42,7 +42,7 @@ public class AllocationConnectCommand extends ConnectCommand { @Override public boolean canExecute() { if(context instanceof AllocationConnectionDragContext) { - return IConnectionCompositorService.INSTANCE.canConnect(context.getSource(), + return IConnectionCompositorService.getInstance().canConnect(context.getSource(), context.getTarget(), ((AllocationConnectionDragContext)context).getAllocationRoot(), context); } @@ -54,7 +54,7 @@ public class AllocationConnectCommand extends ConnectCommand { public void execute() { if(context instanceof AllocationConnectionDragContext) { EObject commonParent = ((AllocationConnectionDragContext)context).getAllocationRoot(); - IConnectionCompositorService.INSTANCE.connect(context.getSource(), context.getTarget(), + IConnectionCompositorService.getInstance().connect(context.getSource(), context.getTarget(), commonParent, context); } else { super.execute(); diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ConnectCommand.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ConnectCommand.java index e713e90e2..50ef91ea2 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ConnectCommand.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ConnectCommand.java @@ -68,14 +68,14 @@ public class ConnectCommand extends Command { if(commonParent == null) { return false; } - return IConnectionCompositorService.INSTANCE.canConnect(context.getSource(), + return IConnectionCompositorService.getInstance().canConnect(context.getSource(), context.getTarget(), getCommonParent(), context); } /** {@inheritDoc} */ @Override public void execute() { - IConnectionCompositorService.INSTANCE.connect(context.getSource(), context.getTarget(), + IConnectionCompositorService.getInstance().connect(context.getSource(), context.getTarget(), getCommonParent(), context); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ReconnectCommand.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ReconnectCommand.java index cf4b1b902..10ffd333c 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ReconnectCommand.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ReconnectCommand.java @@ -49,14 +49,14 @@ public class ReconnectCommand extends ConnectCommand { if(context == null || context.getSource() == null || context.getTarget() == null) { return false; } - return IConnectionCompositorService.INSTANCE.canReconnect(connection, context.getSource(), + return IConnectionCompositorService.getInstance().canReconnect(connection, context.getSource(), context.getTarget(), context); } /** {@inheritDoc} */ @Override public void execute() { - IConnectionCompositorService.INSTANCE.reconnect(connection, context.getSource(), + IConnectionCompositorService.getInstance().reconnect(connection, context.getSource(), context.getTarget(), context); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/RemoveCommand.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/RemoveCommand.java index 775149f36..a0fe60fa1 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/RemoveCommand.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/RemoveCommand.java @@ -42,12 +42,12 @@ public class RemoveCommand extends Command { /** {@inheritDoc} */ @Override public void execute() { - IElementCompositorService.INSTANCE.decompose(toRemove); + IElementCompositorService.getInstance().decompose(toRemove); } /** {@inheritDoc} */ @Override public boolean canExecute() { - return IElementCompositorService.INSTANCE.canDecompose(toRemove); + return IElementCompositorService.getInstance().canDecompose(toRemove); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RelayCreateCommandEditPolicyBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RelayCreateCommandEditPolicyBase.java index c72db8b89..00193f55d 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RelayCreateCommandEditPolicyBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RelayCreateCommandEditPolicyBase.java @@ -119,13 +119,13 @@ public abstract class RelayCreateCommandEditPolicyBase extends LayoutEditPolicy return new Command() { @Override public boolean canExecute() { - return IConnectionCompositorService.INSTANCE.canConnect(droppedElement, + return IConnectionCompositorService.getInstance().canConnect(droppedElement, targetElement, parentElement, context); } @Override public void execute() { - IConnectionCompositorService.INSTANCE.connect(droppedElement, targetElement, + IConnectionCompositorService.getInstance().connect(droppedElement, targetElement, parentElement, context); } }; @@ -160,13 +160,13 @@ public abstract class RelayCreateCommandEditPolicyBase extends LayoutEditPolicy return new Command() { @Override public boolean canExecute() { - return IElementCompositorService.INSTANCE.canCompose(targetElement, droppedElement, + return IElementCompositorService.getInstance().canCompose(targetElement, droppedElement, context); } @Override public void execute() { - IElementCompositorService.INSTANCE.compose(targetElement, droppedElement, context); + IElementCompositorService.getInstance().compose(targetElement, droppedElement, context); } }; } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RemoveEditPolicy.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RemoveEditPolicy.java index 1e302fe37..f65bbcd0d 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RemoveEditPolicy.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/policy/RemoveEditPolicy.java @@ -47,7 +47,7 @@ public final class RemoveEditPolicy extends ComponentEditPolicy { CompoundCommand compound = new CompoundCommand(); for(EditPart ep : (List<EditPart>)request.getEditParts()) { EObject model = (EObject)ep.getModel(); - boolean canDelete = IElementCompositorService.INSTANCE.canDecompose(model); + boolean canDelete = IElementCompositorService.getInstance().canDecompose(model); if(canDelete) { compound.add(new RemoveCommand(model)); } else { diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/internal/command/GEF2ToolingKernelCommandStack.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/internal/command/GEF2ToolingKernelCommandStack.java index 00ebe6231..fbfdf1dac 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/internal/command/GEF2ToolingKernelCommandStack.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/internal/command/GEF2ToolingKernelCommandStack.java @@ -43,7 +43,7 @@ public class GEF2ToolingKernelCommandStack extends CommandStack implements Comma /** Constructor. */ public GEF2ToolingKernelCommandStack(EObject modelElement) { - context = IPersistencyService.INSTANCE.getTopLevelElementFor(modelElement); + context = IPersistencyService.getInstance().getTopLevelElementFor(modelElement); context.addCommandStackListener(this); } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/AddElementToLibraryBase.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/AddElementToLibraryBase.java index dff97f0e4..e9e88ebd4 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/AddElementToLibraryBase.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/AddElementToLibraryBase.java @@ -104,7 +104,7 @@ public abstract class AddElementToLibraryBase<T extends EObject> implements ICon final ILibraryPackage pack = openLibraryPackageDialog(getLibraryPackageClass()); if(pack != null) { - ModelElementLibraryService.INSTANCE.addElementToLibrary(pack, element); + ModelElementLibraryService.getInstance().addElementToLibrary(pack, element); } } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/LibrarySelectionDialog.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/LibrarySelectionDialog.java index 64354d0b9..c7a2d415d 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/LibrarySelectionDialog.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/library/LibrarySelectionDialog.java @@ -47,7 +47,7 @@ public class LibrarySelectionDialog { public static <T extends ILibraryPackage> T openLibraryPackageDialog( final Class<T> libraryPackageClass) { Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); - List<ILibrary> allLibs = ILibraryService.INSTANCE.getLibrariesFromWorkspace(); + List<ILibrary> allLibs = ILibraryService.getInstance().getLibrariesFromWorkspace(); ElementTreeSingleSelectDialog dialog = new ElementTreeSingleSelectDialog(shell, "Library package selection", diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/tablecell/IconNameLabelProvider.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/tablecell/IconNameLabelProvider.java index 3d6829d72..96de494ee 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/tablecell/IconNameLabelProvider.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/tablecell/IconNameLabelProvider.java @@ -66,7 +66,7 @@ public class IconNameLabelProvider implements IStyledLabelProvider { @Override public StyledString getStyledText(Object element) { if(element instanceof INamedElement) { - return new StyledString(IModelElementHandlerService.INSTANCE.getName((EObject)element)); + return new StyledString(IModelElementHandlerService.getInstance().getName((EObject)element)); } return new StyledString(""); } @@ -75,7 +75,7 @@ public class IconNameLabelProvider implements IStyledLabelProvider { @Override public Image getImage(Object element) { if(element instanceof EObject) { - return IModelElementHandlerService.INSTANCE.getIcon((EObject)element); + return IModelElementHandlerService.getInstance().getIcon((EObject)element); } return null; } diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/DecorationIconUtils.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/DecorationIconUtils.java index 05f267417..c09426fc7 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/DecorationIconUtils.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/utils/DecorationIconUtils.java @@ -32,19 +32,19 @@ import org.fortiss.tooling.kernel.ui.service.IMarkerService; public class DecorationIconUtils { /** Cached small error icon. */ - private static Image smallErrorIcon = IMarkerService.INSTANCE + private static Image smallErrorIcon = IMarkerService.getInstance() .getImageFor(ESeverity.ERROR, true).createImage(); /** Cached large error icon. */ - private static Image largeErrorIcon = IMarkerService.INSTANCE.getImageFor(ESeverity.ERROR, + private static Image largeErrorIcon = IMarkerService.getInstance().getImageFor(ESeverity.ERROR, false).createImage(); /** Cached small warning icon. */ - private static Image smallWarningIcon = IMarkerService.INSTANCE.getImageFor(ESeverity.WARNING, + private static Image smallWarningIcon = IMarkerService.getInstance().getImageFor(ESeverity.WARNING, true).createImage(); /** Cached large warning icon. */ - private static Image largeWarningIcon = IMarkerService.INSTANCE.getImageFor(ESeverity.WARNING, + private static Image largeWarningIcon = IMarkerService.getInstance().getImageFor(ESeverity.WARNING, false).createImage(); /** diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/ToolingBaseActivator.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/ToolingBaseActivator.java index 35d1804c4..561d5c3bb 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/ToolingBaseActivator.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/ToolingBaseActivator.java @@ -43,7 +43,7 @@ public class ToolingBaseActivator extends Plugin { plugin = this; System.out.println(PLUGIN_ID + " activated."); - // FIXME: IAnnotationValueService.INSTANCE.toString(); + // FIXME: IAnnotationValueService.getInstance().toString(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java index a0972b118..ac262c413 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java @@ -71,7 +71,7 @@ public class AnnotationValueService extends /** Constructs a new {@link AnnotationValueService}. */ public AnnotationValueService() { super(); - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -236,7 +236,7 @@ public class AnnotationValueService extends if(registeredHandlers != null && !registeredHandlers.isEmpty()) { final ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(element); + IPersistencyService.getInstance().getTopLevelElementFor(element); // Wrap instantiation of new annotation into command if this method is invoked from the // GUI context, i.e. from getAnnotationEntry(final IModelElement element), but only if diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/IAnnotationValueService.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/IAnnotationValueService.java index 9953e147d..9275c060a 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/IAnnotationValueService.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/IAnnotationValueService.java @@ -32,8 +32,14 @@ import org.fortiss.tooling.kernel.utils.KernelModelElementUtils; public interface IAnnotationValueService { /** Singleton instance of {@link IAnnotationValueService}. */ + @Deprecated public static final IAnnotationValueService INSTANCE = new AnnotationValueService(); + /** Returns the service instance. */ + public static IAnnotationValueService getInstance() { + return INSTANCE; + } + /** * <p> * Returns an {@link AnnotationEntry} that contains all {@link IAnnotatedSpecification}s that diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectionCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectionCompositorBase.java index 8d5a2ff20..7a5f00d36 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectionCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectionCompositorBase.java @@ -132,7 +132,7 @@ public abstract class ConnectionCompositorBase<HE extends IHierarchicElement, S boolean isDragCtx = context instanceof ConnectionDragContext; ElementDropContext drop = isDragCtx ? ((ConnectionDragContext)context).getSourceDropContext() : null; - IElementCompositorService.INSTANCE.compose(container, connected, drop); + IElementCompositorService.getInstance().compose(container, connected, drop); } /** Creates a new target drop context */ @@ -141,7 +141,7 @@ public abstract class ConnectionCompositorBase<HE extends IHierarchicElement, S boolean isDragCtx = context instanceof ConnectionDragContext; ElementDropContext drop = isDragCtx ? ((ConnectionDragContext)context).getTargetDropContext() : null; - IElementCompositorService.INSTANCE.compose(container, contained, drop); + IElementCompositorService.getInstance().compose(container, contained, drop); } /** diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorConnectionCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorConnectionCompositorBase.java index ad035b013..6837270c0 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorConnectionCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorConnectionCompositorBase.java @@ -139,7 +139,7 @@ public abstract class ConnectorConnectionCompositorBase<HE extends IHierarchicEl /** {@inheritDoc} */ @Override public boolean connect(S source, T target, HE parent, IConnectionCompositionContext context) { - ITopLevelElement modelContext = IPersistencyService.INSTANCE.getTopLevelElementFor(source); + ITopLevelElement modelContext = IPersistencyService.getInstance().getTopLevelElementFor(source); createConnection(source, target, parent, modelContext); return true; diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorHierarchicElementConnectionCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorHierarchicElementConnectionCompositorBase.java index 68603e263..99695c1a1 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorHierarchicElementConnectionCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ConnectorHierarchicElementConnectionCompositorBase.java @@ -57,7 +57,7 @@ public abstract class ConnectorHierarchicElementConnectionCompositorBase<HE exte /** {@inheritDoc} */ @Override public boolean connect(S source, T target, HE parent, IConnectionCompositionContext context) { - ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(parent); + ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(parent); boolean isSrcEntry = source instanceof EntryConnectorBase; isSrcEntry = sameParent(target, source) ? isSrcEntry : !isSrcEntry; IConnector conn = isSrcEntry ? createEntryConnector() : createExitConnector(); diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementCompositorBase.java index dfd22af3d..f948910e3 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementCompositorBase.java @@ -132,8 +132,8 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem * invokes {@link EcoreUtil#delete(EObject, boolean)} otherwise. Subclasses may override. */ protected boolean decomposeSubelement(IHierarchicElement element) { - if(IElementCompositorService.INSTANCE.canDecompose(element)) { - return IElementCompositorService.INSTANCE.decompose(element); + if(IElementCompositorService.getInstance().canDecompose(element)) { + return IElementCompositorService.getInstance().decompose(element); } delete(element, true); return true; @@ -147,13 +147,13 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem ArrayList<IConnection> list = new ArrayList<IConnection>(element.getIncoming()); list.addAll(element.getOutgoing()); for(IConnection conn : list) { - if(!IConnectionCompositorService.INSTANCE.disconnect(conn)) { + if(!IConnectionCompositorService.getInstance().disconnect(conn)) { return false; } } - if(IElementCompositorService.INSTANCE.canDecompose(element)) { - return IElementCompositorService.INSTANCE.decompose(element); + if(IElementCompositorService.getInstance().canDecompose(element)) { + return IElementCompositorService.getInstance().decompose(element); } EcoreUtil.delete(element, true); @@ -165,6 +165,6 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem * invokes {@link EcoreUtil#delete(EObject, boolean)} otherwise. Subclasses may override. */ protected boolean decomposeConnection(IConnection conn) { - return IConnectionCompositorService.INSTANCE.disconnect(conn); + return IConnectionCompositorService.getInstance().disconnect(conn); } } diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectionCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectionCompositorBase.java index 8b30a9a38..5ca147e03 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectionCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectionCompositorBase.java @@ -53,7 +53,7 @@ public abstract class HierarchicElementConnectionCompositorBase<HE extends IHier avoidDuplicateConnectorName(source, sourceConnector); IConnector targetConnector = createExitConnector(); avoidDuplicateConnectorName(target, targetConnector); - ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(parent); + ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(parent); if(topElement != null) { topElement.prepareIDs(sourceConnector); topElement.prepareIDs(targetConnector); diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectorConnectionCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectorConnectionCompositorBase.java index 3f031b168..59379bef7 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectorConnectionCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/HierarchicElementConnectorConnectionCompositorBase.java @@ -63,7 +63,7 @@ public abstract class HierarchicElementConnectorConnectionCompositorBase<HE exte /** {@inheritDoc} */ @Override public boolean connect(S source, T target, HE parent, IConnectionCompositionContext context) { - ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(parent); + ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(parent); boolean isTargetEntry = target instanceof EntryConnectorBase; isTargetEntry = sameParent(source, target) ? isTargetEntry : !isTargetEntry; IConnector conn = isTargetEntry ? createEntryConnector() : createExitConnector(); diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ModelElementCompositorBase.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ModelElementCompositorBase.java index 83215bf87..d0c59f583 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ModelElementCompositorBase.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/compose/ModelElementCompositorBase.java @@ -57,7 +57,7 @@ public abstract class ModelElementCompositorBase<C extends EObject> extends Obse // Instantiate annotations for new model element. Derived compositors must call this method // (see #2228 and #2208) if(contained instanceof IModelElement) { - IAnnotationValueService.INSTANCE.instantiateAnnotations((IModelElement)contained); + IAnnotationValueService.getInstance().instantiateAnnotations((IModelElement)contained); } makeNameDistinct(container, contained); return true; @@ -134,8 +134,8 @@ public abstract class ModelElementCompositorBase<C extends EObject> extends Obse * default and returns <code>true</code>. Subclasses may override. */ protected boolean decomposeSpecification(IModelElementSpecification element) { - if(IElementCompositorService.INSTANCE.canDecompose(element)) { - return IElementCompositorService.INSTANCE.decompose(element); + if(IElementCompositorService.getInstance().canDecompose(element)) { + return IElementCompositorService.getInstance().decompose(element); } // no delete here, since normally specs are destroyed with the element return true; diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java index 7b5185f51..2b14e807f 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java @@ -50,8 +50,14 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; public class ModelElementLibraryService implements ILibraryService { /** The instance of this service. */ + @Deprecated public static final ModelElementLibraryService INSTANCE = new ModelElementLibraryService(); + /** Returns the service instance. */ + public static ModelElementLibraryService getInstance() { + return INSTANCE; + } + /** The private constructor. */ private ModelElementLibraryService() { // do nothing @@ -60,61 +66,61 @@ public class ModelElementLibraryService implements ILibraryService { /** {@inheritDoc} */ @Override public boolean isLibraryElementShadow(EObject anObject) { - return ILibraryService.INSTANCE.isLibraryElementShadow(anObject); + return ILibraryService.getInstance().isLibraryElementShadow(anObject); } /** {@inheritDoc} */ @Override public boolean isDirty(ILibraryElementReference libRef) { - return ILibraryService.INSTANCE.isDirty(libRef); + return ILibraryService.getInstance().isDirty(libRef); } /** {@inheritDoc} */ @Override public void setDirty(ILibraryElementReference libRef, boolean flag) { - ILibraryService.INSTANCE.setDirty(libRef, flag); + ILibraryService.getInstance().setDirty(libRef, flag); } /** {@inheritDoc} */ @Override public ILibraryElement findLibraryElementByURI(String uri) { - return ILibraryService.INSTANCE.findLibraryElementByURI(uri); + return ILibraryService.getInstance().findLibraryElementByURI(uri); } /** {@inheritDoc} */ @Override public List<ILibraryElement> getLibraryElementsFromAllWorkspaceLibraries() { - return ILibraryService.INSTANCE.getLibraryElementsFromAllWorkspaceLibraries(); + return ILibraryService.getInstance().getLibraryElementsFromAllWorkspaceLibraries(); } /** {@inheritDoc} */ @Override public List<ILibrary> getLibrariesFromWorkspace() { - return ILibraryService.INSTANCE.getLibrariesFromWorkspace(); + return ILibraryService.getInstance().getLibrariesFromWorkspace(); } /** {@inheritDoc} */ @Override public List<ILibraryPackage> getAllLibraryPackages(ILibrary lib) { - return ILibraryService.INSTANCE.getAllLibraryPackages(lib); + return ILibraryService.getInstance().getAllLibraryPackages(lib); } /** {@inheritDoc} */ @Override public void ensureWrappedElementIsUpToDate(ILibraryElementReference ref) { - ILibraryService.INSTANCE.ensureWrappedElementIsUpToDate(ref); + ILibraryService.getInstance().ensureWrappedElementIsUpToDate(ref); } /** {@inheritDoc} */ @Override public void ensureChildrenLibraryReferenceAreUpToDate(EObject context) { - ILibraryService.INSTANCE.ensureChildrenLibraryReferenceAreUpToDate(context); + ILibraryService.getInstance().ensureChildrenLibraryReferenceAreUpToDate(context); } /** {@inheritDoc} */ @Override public void addElementToLibrary(ILibraryPackage pack, EObject obj) { - ILibraryService.INSTANCE.addElementToLibrary(pack, obj); + ILibraryService.getInstance().addElementToLibrary(pack, obj); } /** @@ -125,7 +131,7 @@ public class ModelElementLibraryService implements ILibraryService { final ILibraryElementReference elementRef) { final ITopLevelElement topLevel = - IPersistencyService.INSTANCE.getTopLevelElementFor(elementRef); + IPersistencyService.getInstance().getTopLevelElementFor(elementRef); topLevel.runAsCommand(new Runnable() { @Override public void run() { diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/AnnotationUtils.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/AnnotationUtils.java index 971fc5040..aaa980172 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/AnnotationUtils.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/utils/AnnotationUtils.java @@ -82,9 +82,9 @@ public class AnnotationUtils { * {@link IModelElement} for which annotations should be instantiated recursively. */ public static void instantiateAnnotationsRecursive(IModelElement element) { - IAnnotationValueService.INSTANCE.instantiateAnnotations(element); + IAnnotationValueService.getInstance().instantiateAnnotations(element); for(IModelElement child : getChildrenWithType(element, IModelElement.class)) { - IAnnotationValueService.INSTANCE.instantiateAnnotations(child); + IAnnotationValueService.getInstance().instantiateAnnotations(child); } } @@ -124,7 +124,7 @@ public class AnnotationUtils { if(wrapIntoCommand) { ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(modelElement); + IPersistencyService.getInstance().getTopLevelElementFor(modelElement); modelContext.runAsCommand(new Runnable() { @Override diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/ToolingKernelUIActivator.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/ToolingKernelUIActivator.java index b21840e2c..ca14b6252 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/ToolingKernelUIActivator.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/ToolingKernelUIActivator.java @@ -58,15 +58,15 @@ public class ToolingKernelUIActivator extends AbstractUIPlugin { /** Initializes UI services by calling its singleton reference {@code toString()}. */ private void initializeServices() { - IActionService.INSTANCE.toString(); - IAllocationEditPartFactoryService.INSTANCE.toString(); - IContextMenuService.INSTANCE.toString(); - // FIXME: IConstraintVerificationUIService.INSTANCE.toString(); - IEditPartFactoryService.INSTANCE.toString(); - IMarkerService.INSTANCE.toString(); - IModelEditorBindingService.INSTANCE.toString(); - IModelElementHandlerService.INSTANCE.toString(); - INavigatorService.INSTANCE.toString(); + IActionService.getInstance().toString(); + IAllocationEditPartFactoryService.getInstance().toString(); + IContextMenuService.getInstance().toString(); + // FIXME: IConstraintVerificationUIService.getInstance().toString(); + IEditPartFactoryService.getInstance().toString(); + IMarkerService.getInstance().toString(); + IModelEditorBindingService.getInstance().toString(); + IModelElementHandlerService.getInstance().toString(); + INavigatorService.getInstance().toString(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java index b3c557d7a..44be2c10d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ConnectionCompositionDropTargetAdapter.java @@ -43,7 +43,7 @@ public abstract class ConnectionCompositionDropTargetAdapter extends DropTargetA public void drop(DropTargetEvent event) { ConnectionCompositionSource dragSource = getDragSourceFromTransfer(); EObject target = getTargetModel(event.item); - IConnectionCompositorService.INSTANCE.connect(dragSource.getDesignatedElement(), target, + IConnectionCompositorService.getInstance().connect(dragSource.getDesignatedElement(), target, dragSource.getDesignatedParentElement(), null); } @@ -56,7 +56,7 @@ public abstract class ConnectionCompositionDropTargetAdapter extends DropTargetA event.detail = DND.DROP_NONE; return; } - if(IConnectionCompositorService.INSTANCE.canConnect(dragSource.getDesignatedElement(), + if(IConnectionCompositorService.getInstance().canConnect(dragSource.getDesignatedElement(), target, dragSource.getDesignatedParentElement(), null)) { event.detail = DND.DROP_LINK; return; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java index d914f8c56..f7ec7cbc3 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/dnd/ElementCompositionDropTargetAdapter.java @@ -43,7 +43,7 @@ public abstract class ElementCompositionDropTargetAdapter extends DropTargetAdap public void drop(DropTargetEvent event) { ElementCompositionSource dragSource = getDragSourceFromTransfer(); EObject target = getTargetModel(event.item); - IElementCompositorService.INSTANCE.compose(target, dragSource.getDesignatedElement(), null); + IElementCompositorService.getInstance().compose(target, dragSource.getDesignatedElement(), null); } /** {@inheritDoc} */ @@ -55,7 +55,7 @@ public abstract class ElementCompositionDropTargetAdapter extends DropTargetAdap event.detail = DND.DROP_NONE; return; } - if(IElementCompositorService.INSTANCE.canCompose(target, dragSource.getDesignatedElement(), + if(IElementCompositorService.getInstance().canCompose(target, dragSource.getDesignatedElement(), null)) { event.detail = DND.DROP_COPY; return; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ConstraintVerifierUIBases.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ConstraintVerifierUIBases.java index a429e86b5..e10f9672e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ConstraintVerifierUIBases.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/ConstraintVerifierUIBases.java @@ -70,7 +70,7 @@ public class ConstraintVerifierUIBases { } if(status instanceof OutdatedVerificationStatus) { IConstraint constraint = status.getConstraint(); - IConstraintVerificationService.INSTANCE.verify(constraint); + IConstraintVerificationService.getInstance().verify(constraint); IConstraintVerificationStatus currentStatus = constraint.getVerificationStatus(); if(currentStatus instanceof ErrorVerificationStatus & canOpen(currentStatus)) { openStatus(currentStatus); @@ -79,7 +79,7 @@ public class ConstraintVerifierUIBases { } if(status instanceof FailVerificationStatus || status instanceof ErrorVerificationStatus) { - List<IFix> fixes = IConstraintVerificationService.INSTANCE.fixes(status); + List<IFix> fixes = IConstraintVerificationService.getInstance().fixes(status); Shell shell = Display.getCurrent().getActiveShell(); int result = new FixDialog(shell, status, getMessage(status), fixes).open(); if(fixes.size() == 1 && result == 0) { @@ -178,7 +178,7 @@ public class ConstraintVerifierUIBases { @Override public String getMessage(IConstraintVerificationStatus s) { // Default message. Inheriting classes SHOULD specialize. - String name = IModelElementHandlerService.INSTANCE.getName(s.getConstraint()); + String name = IModelElementHandlerService.getInstance().getName(s.getConstraint()); String pre = s instanceof ErrorVerificationStatus ? "Error while checking" : "Unsatisfied"; return pre + " constraint" + (name == null ? "." : ": \"" + name + "\""); @@ -207,7 +207,7 @@ public class ConstraintVerifierUIBases { @Override protected IStatus run(IProgressMonitor monitor) { synchronized(constraint) { - IConstraintVerificationService.INSTANCE.verify(constraint); + IConstraintVerificationService.getInstance().verify(constraint); } display.asyncExec(() -> ConstraintsUIUtils.triggerMarkersRefresh(constraint)); return Status.OK_STATUS; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EReferencePropertySectionBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EReferencePropertySectionBase.java index caaaa3129..300e8ed67 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EReferencePropertySectionBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EReferencePropertySectionBase.java @@ -92,7 +92,7 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends if(userSelection) { ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(input); + IPersistencyService.getInstance().getTopLevelElementFor(input); modelContext.runAsCommand(new Runnable() { @SuppressWarnings("unchecked") @Override diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java index d58b71a06..7991d42d8 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/EditorBase.java @@ -125,19 +125,19 @@ public abstract class EditorBase<T extends EObject> extends EditorPart implement /** Runs the given {@link Runnable} in the emfStore editing domain. */ protected final void executeCommand(Runnable runner) { - ICommandStackService.INSTANCE.runAsCommand(editedObject, runner); + ICommandStackService.getInstance().runAsCommand(editedObject, runner); } /** {@inheritDoc} */ @Override public final boolean isDirty() { - return ICommandStackService.INSTANCE.isDirty(editedObject); + return ICommandStackService.getInstance().isDirty(editedObject); } /** {@inheritDoc} */ @Override public final void doSave(IProgressMonitor monitor) { - ICommandStackService.INSTANCE.doSave(editedObject, monitor); + ICommandStackService.getInstance().doSave(editedObject, monitor); } /** {@inheritDoc} */ @@ -195,7 +195,7 @@ public abstract class EditorBase<T extends EObject> extends EditorPart implement /** {@inheritDoc} */ @Override public boolean enableLibraryView() { - return !ILibraryService.INSTANCE.isLibraryElementShadow(editedObject) && + return !ILibraryService.getInstance().isLibraryElementShadow(editedObject) && !(editedObject instanceof ILibraryElementReference); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java index 02f22bdb2..a02c703e5 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/extension/base/PropertySectionBase.java @@ -127,7 +127,7 @@ public abstract class PropertySectionBase extends AbstractPropertySection { if(object instanceof EObject) { EObject eobj = (EObject)object; - if(ILibraryService.INSTANCE.isLibraryElementShadow(eobj) || + if(ILibraryService.getInstance().isLibraryElementShadow(eobj) || eobj instanceof ILibraryElementReference) { disableControls(); } else { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java index 6f692d504..07211fcb0 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java @@ -87,10 +87,10 @@ public class ActionService implements IActionService, IPersistencyServiceListene /** Starts the service. */ public void startService() { - for(ITopLevelElement context : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement context : IPersistencyService.getInstance().getTopLevelElements()) { topLevelElementAdded(context); } - IPersistencyService.INSTANCE.addTopLevelElementListener(this); + IPersistencyService.getInstance().addTopLevelElementListener(this); } /** {@inheritDoc} */ @@ -173,13 +173,13 @@ public class ActionService implements IActionService, IPersistencyServiceListene /** {@inheritDoc} */ @Override public void topLevelElementAdded(ITopLevelElement element) { - ICommandStackService.INSTANCE.addCommandStackListener(element, this); + ICommandStackService.getInstance().addCommandStackListener(element, this); } /** {@inheritDoc} */ @Override public void topLevelElementRemoved(ITopLevelElement element) { - ICommandStackService.INSTANCE.removeCommandStackListener(element, this); + ICommandStackService.getInstance().removeCommandStackListener(element, this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java index c3d5c130b..4dcb08505 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java @@ -59,7 +59,7 @@ public class AllocationEditPartFactoryService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintLabelDecorator.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintLabelDecorator.java index a15083222..1ddd5faad 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintLabelDecorator.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintLabelDecorator.java @@ -41,7 +41,7 @@ public final class ConstraintLabelDecorator extends BaseLabelProvider implements @Override public void decorate(Object element, IDecoration decoration) { if(element instanceof EObject) { - ESeverity sev = IMarkerService.INSTANCE.getHighestViolationSeverity((EObject)element); + ESeverity sev = IMarkerService.getInstance().getHighestViolationSeverity((EObject)element); sev = ConstraintsUIUtils.augmentSeverityWithConstraintSeverity(sev, (EObject)element); switch(sev) { case FATAL: diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java index 181056919..1b9c54918 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java @@ -44,7 +44,7 @@ public final class ConstraintVerificationUIService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -160,7 +160,7 @@ public final class ConstraintVerificationUIService extends if(skipStatusChangeNotification(constraint, notification)) { return false; } - if(!IConstraintVerificationService.INSTANCE.isUpToDate(constraint)) { + if(!IConstraintVerificationService.getInstance().isUpToDate(constraint)) { IConstraintVerifierUI<IConstraint> verifier = getFirstVerifier(constraint); verifier.onOutdate(constraint); return true; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIServicePostLoadProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIServicePostLoadProvider.java index ed8f4d677..e6d2f313d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIServicePostLoadProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIServicePostLoadProvider.java @@ -38,7 +38,7 @@ public final class ConstraintVerificationUIServicePostLoadProvider implements @Override public void postModelLoadRun(ITopLevelElement modelElement) { ConstraintVerificationUIService cvuis = - (ConstraintVerificationUIService)IConstraintVerificationUIService.INSTANCE; + (ConstraintVerificationUIService)IConstraintVerificationUIService.getInstance(); cvuis.postModelLoadRun(modelElement); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java index abb49e5e9..98dc2c537 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java @@ -80,7 +80,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe /** Starts the service. */ public void startService() { setupProviders(); - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -150,9 +150,9 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe addContributions(menu, contextProvider); - if(!ITutorialService.INSTANCE.isTutorialActive() || - ITutorialUIService.INSTANCE.globalDefaultActionsVisible()) { - IActionService.INSTANCE.addGlobalDefaultActionSectionToMenu(menu); + if(!ITutorialService.getInstance().isTutorialActive() || + ITutorialUIService.getInstance().globalDefaultActionsVisible()) { + IActionService.getInstance().addGlobalDefaultActionSectionToMenu(menu); } } } @@ -187,8 +187,8 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe } // active tutorial may filter contributions - if(ITutorialService.INSTANCE.isTutorialActive()) { - ITutorialUIService service = ITutorialUIService.INSTANCE; + if(ITutorialService.getInstance().isTutorialActive()) { + ITutorialUIService service = ITutorialUIService.getInstance(); items = items.stream() .filter(i -> service.contextMenuContributionVisible(selectionElem, @@ -225,7 +225,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe } // active tutorial does not support multiple selections - if(ITutorialService.INSTANCE.isTutorialActive()) { + if(ITutorialService.getInstance().isTutorialActive()) { continue; } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java index f96a39be6..3c100935b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java @@ -58,7 +58,7 @@ public class EditPartFactoryService extends EObjectAwareServiceBase<IEditPartFac /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java index 84ae460bf..663e039a3 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java @@ -123,11 +123,11 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene /** Starts the service. */ public void startService() { - for(ITopLevelElement element : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement element : IPersistencyService.getInstance().getTopLevelElements()) { invalidElements.add(element); } constraintCheckerJob.schedule(); - IPersistencyService.INSTANCE.addTopLevelElementListener(this); + IPersistencyService.getInstance().addTopLevelElementListener(this); } /** Sets the current marker view. */ @@ -138,7 +138,7 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene /** {@inheritDoc} */ @Override public Collection<IConstraintViolation<? extends EObject>> getViolations(EObject element) { - ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(element); + ITopLevelElement top = IPersistencyService.getInstance().getTopLevelElementFor(element); if(top == null) { return Collections.emptyList(); } @@ -153,7 +153,7 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene /** {@inheritDoc} */ @Override public ESeverity getHighestViolationSeverity(EObject element) { - ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(element); + ITopLevelElement top = IPersistencyService.getInstance().getTopLevelElementFor(element); if(top == null) { return ESeverity.lowest(); } @@ -368,7 +368,7 @@ public class MarkerService implements IMarkerService, IPersistencyServiceListene ESeverity severity) { List<IConstraintViolation<? extends EObject>> list = new ArrayList<IConstraintViolation<? extends EObject>>(); - for(ITopLevelElement top : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement top : IPersistencyService.getInstance().getTopLevelElements()) { list.addAll(getCacheEntry(top).getAllViolationsWithSeverity(severity)); } return list; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java index bca94579a..b794049d9 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerServiceLabelDecorator.java @@ -41,7 +41,7 @@ public final class MarkerServiceLabelDecorator extends BaseLabelProvider impleme public void decorate(Object element, IDecoration decoration) { if(element instanceof EObject) { EObject modelElement = (EObject)element; - ESeverity highest = IMarkerService.INSTANCE.getHighestViolationSeverity(modelElement); + ESeverity highest = IMarkerService.getInstance().getHighestViolationSeverity(modelElement); // TODO (FH): https://af3.fortiss.org/issues/388 // use preferences settings here switch(highest) { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java index 39ecb2058..4bd9f0f5f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java @@ -92,7 +92,7 @@ public class ModelEditorBindingService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -120,12 +120,12 @@ public class ModelEditorBindingService extends getParentElement(element, ILibraryElementReference.class, true); if(libRefParent != null) { String uri = libRefParent.getURI(); - ILibraryElement libElement = ILibraryService.INSTANCE.findLibraryElementByURI(uri); + ILibraryElement libElement = ILibraryService.getInstance().findLibraryElementByURI(uri); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(libElement); + IModelElementHandlerService.getInstance().getModelElementHandler(libElement); if(handler != null) { EObject displayedElement = handler.handleOpenModelElementRequest(libElement); - INavigatorService.INSTANCE.setLibraryViewActive(); + INavigatorService.getInstance().setLibraryViewActive(); openInEditor(displayedElement); } return; @@ -149,8 +149,8 @@ public class ModelEditorBindingService extends IPartService service = (IPartService)part.getSite().getService(IPartService.class); service.addPartListener(new EditorSitePartListener()); // ensure registration with command stack service - ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(element); - ICommandStackService.INSTANCE.addCommandStackListener(top, this); + ITopLevelElement top = IPersistencyService.getInstance().getTopLevelElementFor(element); + ICommandStackService.getInstance().addCommandStackListener(top, this); currentCommandStacks.put(element, top); } catch(final PartInitException e) { error(ToolingKernelActivator.getDefault(), "Could not open editor with ID " + @@ -248,7 +248,7 @@ public class ModelEditorBindingService extends } } // no other editor references the command stack of top anymore - ICommandStackService.INSTANCE.removeCommandStackListener(top, this); + ICommandStackService.getInstance().removeCommandStackListener(top, this); } } @@ -270,7 +270,7 @@ public class ModelEditorBindingService extends IEditorPart[] parts = new IEditorPart[0]; for(IEditorPart part : currentEditors.keySet().toArray(parts)) { ITopLevelElement top = - IPersistencyService.INSTANCE.getTopLevelElementFor(currentEditors.get(part)); + IPersistencyService.getInstance().getTopLevelElementFor(currentEditors.get(part)); if(top == null) { closeEditor(part); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java index 1e663fbce..0e320ae2d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java @@ -62,7 +62,7 @@ public class ModelElementHandlerService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java index b798909ea..72b4890f9 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java @@ -75,12 +75,12 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL /** Starts the service. */ public void startService() { - for(ITopLevelElement element : IPersistencyService.INSTANCE.getTopLevelElements()) { - ICommandStackService.INSTANCE.addCommandStackListener(element, this); + for(ITopLevelElement element : IPersistencyService.getInstance().getTopLevelElements()) { + ICommandStackService.getInstance().addCommandStackListener(element, this); saveables.put(element, new TopLevelElementSaveable(element)); } - IPersistencyService.INSTANCE.addTopLevelElementListener(this); - ITutorialService.INSTANCE.addTutorialServiceListener(this); + IPersistencyService.getInstance().addTopLevelElementListener(this); + ITutorialService.getInstance().addTutorialServiceListener(this); } /** Sets the navigator view. */ @@ -194,7 +194,7 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL EObject selection = navigatorViewPart.getSelectedModelElement(); if(selection != null) { ITopLevelElement context = - IPersistencyService.INSTANCE.getTopLevelElementFor(selection); + IPersistencyService.getInstance().getTopLevelElementFor(selection); if(saveables.get(context) != null) { return new Saveable[] {saveables.get(context)}; } @@ -317,7 +317,7 @@ public class NavigatorService implements INavigatorService, IPersistencyServiceL /** {@inheritDoc} */ @Override public void tutorialStarted(ITutorialProvider provider) { - refreshAndReveal(ITutorialService.INSTANCE.getActiveTutorial().getDefinition()); + refreshAndReveal(ITutorialService.getInstance().getActiveTutorial().getDefinition()); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ToolingKernelUIInternal.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ToolingKernelUIInternal.java index 74ea88e14..4b5c10267 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ToolingKernelUIInternal.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ToolingKernelUIInternal.java @@ -41,35 +41,35 @@ public final class ToolingKernelUIInternal { /** Initializes the UI services. */ public static void initializeKernelUI() { System.out.println("Tooling Kernel UI initializing ..."); - ((ActionService)IActionService.INSTANCE).initializeService(); - ((AllocationEditPartFactoryService)IAllocationEditPartFactoryService.INSTANCE) + ((ActionService)IActionService.getInstance()).initializeService(); + ((AllocationEditPartFactoryService)IAllocationEditPartFactoryService.getInstance()) .initializeService(); - ((ConstraintVerificationUIService)IConstraintVerificationUIService.INSTANCE) + ((ConstraintVerificationUIService)IConstraintVerificationUIService.getInstance()) .initializeService(); - ((ContextMenuService)IContextMenuService.INSTANCE).initializeService(); - ((EditPartFactoryService)IEditPartFactoryService.INSTANCE).initializeService(); - ((MarkerService)IMarkerService.INSTANCE).initializeService(); - ((ModelEditorBindingService)IModelEditorBindingService.INSTANCE).initializeService(); - ((ModelElementHandlerService)IModelElementHandlerService.INSTANCE).initializeService(); - ((NavigatorService)INavigatorService.INSTANCE).initializeService(); - ((TutorialUIService)ITutorialUIService.INSTANCE).initializeService(); + ((ContextMenuService)IContextMenuService.getInstance()).initializeService(); + ((EditPartFactoryService)IEditPartFactoryService.getInstance()).initializeService(); + ((MarkerService)IMarkerService.getInstance()).initializeService(); + ((ModelEditorBindingService)IModelEditorBindingService.getInstance()).initializeService(); + ((ModelElementHandlerService)IModelElementHandlerService.getInstance()).initializeService(); + ((NavigatorService)INavigatorService.getInstance()).initializeService(); + ((TutorialUIService)ITutorialUIService.getInstance()).initializeService(); System.out.println("Tooling Kernel UI initialized."); } /** Starts the UI services. */ public static void startKernelUI() { System.out.println("Tooling Kernel UI starting ..."); - ((ActionService)IActionService.INSTANCE).startService(); - ((AllocationEditPartFactoryService)IAllocationEditPartFactoryService.INSTANCE) + ((ActionService)IActionService.getInstance()).startService(); + ((AllocationEditPartFactoryService)IAllocationEditPartFactoryService.getInstance()) .startService(); - ((ConstraintVerificationUIService)IConstraintVerificationUIService.INSTANCE).startService(); - ((ContextMenuService)IContextMenuService.INSTANCE).startService(); - ((EditPartFactoryService)IEditPartFactoryService.INSTANCE).startService(); - ((MarkerService)IMarkerService.INSTANCE).startService(); - ((ModelEditorBindingService)IModelEditorBindingService.INSTANCE).startService(); - ((ModelElementHandlerService)IModelElementHandlerService.INSTANCE).startService(); - ((NavigatorService)INavigatorService.INSTANCE).startService(); - ((TutorialUIService)ITutorialUIService.INSTANCE).startService(); + ((ConstraintVerificationUIService)IConstraintVerificationUIService.getInstance()).startService(); + ((ContextMenuService)IContextMenuService.getInstance()).startService(); + ((EditPartFactoryService)IEditPartFactoryService.getInstance()).startService(); + ((MarkerService)IMarkerService.getInstance()).startService(); + ((ModelEditorBindingService)IModelEditorBindingService.getInstance()).startService(); + ((ModelElementHandlerService)IModelElementHandlerService.getInstance()).startService(); + ((NavigatorService)INavigatorService.getInstance()).startService(); + ((TutorialUIService)ITutorialUIService.getInstance()).startService(); System.out.println("Tooling Kernel UI started."); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java index e805d9f83..64407ce72 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java @@ -90,7 +90,7 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW /** {@inheritDoc} */ @Override public boolean elementVisibleInNavigator(EObject element) { - TutorialStepBase step = ITutorialService.INSTANCE.getActiveTutorialStep(); + TutorialStepBase step = ITutorialService.getInstance().getActiveTutorialStep(); while(step != null) { if(step instanceof ITutorialUIWhitelistProvider) { ITutorialUIWhitelistProvider p = (ITutorialUIWhitelistProvider)step; @@ -106,7 +106,7 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW /** {@inheritDoc} */ @Override public boolean globalDefaultActionsVisible() { - TutorialStepBase step = ITutorialService.INSTANCE.getActiveTutorialStep(); + TutorialStepBase step = ITutorialService.getInstance().getActiveTutorialStep(); while(step != null) { if(step instanceof ITutorialUIWhitelistProvider) { ITutorialUIWhitelistProvider p = (ITutorialUIWhitelistProvider)step; @@ -122,7 +122,7 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW /** {@inheritDoc} */ @Override public boolean contextMenuContributionVisible(EObject element, IContributionItem contribution) { - TutorialStepBase step = ITutorialService.INSTANCE.getActiveTutorialStep(); + TutorialStepBase step = ITutorialService.getInstance().getActiveTutorialStep(); while(step != null) { if(step instanceof ITutorialUIWhitelistProvider) { ITutorialUIWhitelistProvider p = (ITutorialUIWhitelistProvider)step; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/CutAction.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/CutAction.java index d6d7033ce..d2f5e73fc 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/CutAction.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/CutAction.java @@ -49,7 +49,7 @@ public class CutAction extends EObjectActionBase<EObject> { /** {@inheritDoc} */ @Override public void run() { - ICommandStackService.INSTANCE.runAsCommand(getTarget(), new Runnable() { + ICommandStackService.getInstance().runAsCommand(getTarget(), new Runnable() { @Override public void run() { doCopy(getTargets()); @@ -61,6 +61,6 @@ public class CutAction extends EObjectActionBase<EObject> { /** {@inheritDoc} */ @Override protected boolean computeEnabled() { - return IElementCompositorService.INSTANCE.canDecompose(getTarget()); + return IElementCompositorService.getInstance().canDecompose(getTarget()); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/DeleteAction.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/DeleteAction.java index 49ab4d3d1..4af257547 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/DeleteAction.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/DeleteAction.java @@ -80,13 +80,13 @@ public class DeleteAction extends EObjectActionBase<EObject> { final List<EObject> targets = topLevelTargetsMap.get(topLevel); boolean topLevelDeleted = false; for(EObject target : targets) { - if(IPersistencyService.INSTANCE.isTopLevelElement(target)) { + if(IPersistencyService.getInstance().isTopLevelElement(target)) { doTopLevelElementDelete(target); topLevelDeleted = true; } } if(!topLevelDeleted) { - ICommandStackService.INSTANCE.runAsCommand(topLevel.getRootModelElement(), + ICommandStackService.getInstance().runAsCommand(topLevel.getRootModelElement(), new Runnable() { @Override public void run() { @@ -121,13 +121,13 @@ public class DeleteAction extends EObjectActionBase<EObject> { return false; } - if(!IPersistencyService.INSTANCE.isTopLevelElement(target)) { + if(!IPersistencyService.getInstance().isTopLevelElement(target)) { // use composition services for deletion - return(IElementCompositorService.INSTANCE.canDecompose(target) || IConnectionCompositorService.INSTANCE + return(IElementCompositorService.getInstance().canDecompose(target) || IConnectionCompositorService.getInstance() .canDisconnect(target)); } // use top-level element deletion mechanism - ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(target); return topElement.canDelete(); } @@ -158,17 +158,17 @@ public class DeleteAction extends EObjectActionBase<EObject> { } for(EObject target : sortedTargets) { - if(IElementCompositorService.INSTANCE.canDecompose(target)) { - IElementCompositorService.INSTANCE.decompose(target); - } else if(IConnectionCompositorService.INSTANCE.canDisconnect(target)) { - IConnectionCompositorService.INSTANCE.disconnect(target); + if(IElementCompositorService.getInstance().canDecompose(target)) { + IElementCompositorService.getInstance().decompose(target); + } else if(IConnectionCompositorService.getInstance().canDisconnect(target)) { + IConnectionCompositorService.getInstance().disconnect(target); } } } /** User interaction before deleting a top-level element. */ private static void doTopLevelElementDelete(EObject target) { - ITopLevelElement topElement = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement topElement = IPersistencyService.getInstance().getTopLevelElementFor(target); Shell sh = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); String message = "Are you sure you want to delete '" + topElement.getSaveableName() + "'?"; @@ -200,7 +200,7 @@ public class DeleteAction extends EObjectActionBase<EObject> { if(dialog.getReturnCode() == 0) { topElement.delete(); // close also all opened views belonging to the deleted project - IModelEditorBindingService.INSTANCE.closeEditors(topElement.getRootModelElement()); + IModelEditorBindingService.getInstance().closeEditors(topElement.getRootModelElement()); } } @@ -213,7 +213,7 @@ public class DeleteAction extends EObjectActionBase<EObject> { HashMap<ITopLevelElement, List<EObject>> res = new HashMap<ITopLevelElement, List<EObject>>(); for(EObject eo : modelElements) { - ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(eo); + ITopLevelElement top = IPersistencyService.getInstance().getTopLevelElementFor(eo); List<EObject> elts = res.get(top); List<EObject> elts2; if(elts == null) { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/PasteAction.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/PasteAction.java index bc2867e3e..42b7d0a08 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/PasteAction.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/PasteAction.java @@ -46,7 +46,7 @@ public class PasteAction extends EObjectActionBase<EObject> { /** {@inheritDoc} */ @Override public void run() { - ICommandStackService.INSTANCE.runAsCommand(getTarget(), new Runnable() { + ICommandStackService.getInstance().runAsCommand(getTarget(), new Runnable() { @Override public void run() { CopyPasteUtils.pasteFromClipboard(getTarget(), null); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/RedoAction.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/RedoAction.java index df066b82b..2247d2a87 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/RedoAction.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/RedoAction.java @@ -45,14 +45,14 @@ public class RedoAction extends EObjectActionBase<EObject> { /** {@inheritDoc} */ @Override protected boolean computeEnabled() { - return ICommandStackService.INSTANCE.canRedo(getTarget()); + return ICommandStackService.getInstance().canRedo(getTarget()); } /** {@inheritDoc} */ @Override public void run() { if(getTarget() != null) { - ICommandStackService.INSTANCE.redo(getTarget()); + ICommandStackService.getInstance().redo(getTarget()); } } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/UndoAction.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/UndoAction.java index 6642df81a..958df0e23 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/UndoAction.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/actions/UndoAction.java @@ -45,14 +45,14 @@ public class UndoAction extends EObjectActionBase<EObject> { /** {@inheritDoc} */ @Override protected boolean computeEnabled() { - return ICommandStackService.INSTANCE.canUndo(getTarget()); + return ICommandStackService.getInstance().canUndo(getTarget()); } /** {@inheritDoc} */ @Override public void run() { if(getTarget() != null) { - ICommandStackService.INSTANCE.undo(getTarget()); + ICommandStackService.getInstance().undo(getTarget()); } } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/databinding/EObjectObservableValue.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/databinding/EObjectObservableValue.java index 9f0b4aedc..09d2bcfb8 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/databinding/EObjectObservableValue.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/databinding/EObjectObservableValue.java @@ -104,7 +104,7 @@ public class EObjectObservableValue extends AbstractObservableValue { } updating = true; - ICommandStackService.INSTANCE.runAsCommand(eObject, new Runnable() { + ICommandStackService.getInstance().runAsCommand(eObject, new Runnable() { @Override public void run() { eObject.eSet(structuralFeature, value); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ActionBarContributor.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ActionBarContributor.java index 177adbd06..d1f950138 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ActionBarContributor.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ActionBarContributor.java @@ -47,7 +47,7 @@ public final class ActionBarContributor extends MultiPageEditorActionBarContribu public void setActiveEditor(IEditorPart part) { Assert.isTrue(part instanceof ExtendableMultiPageEditor, "This contributor may only be used for ExtendableMultiPageEditors!"); - IActionService.INSTANCE.registerGlobalActions(getActionBars()); + IActionService.getInstance().registerGlobalActions(getActionBars()); super.setActiveEditor(part); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java index dbcdacd58..f8d611517 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ExtendableMultiPageEditor.java @@ -169,8 +169,8 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements editedObject.eAdapters().add(editedObjectChangeAdapter); - ITopLevelElement target = IPersistencyService.INSTANCE.getTopLevelElementFor(editedObject); - ICommandStackService.INSTANCE.addCommandStackListener(target, this); + ITopLevelElement target = IPersistencyService.getInstance().getTopLevelElementFor(editedObject); + ICommandStackService.getInstance().addCommandStackListener(target, this); } /** {@inheritDoc} */ @@ -178,7 +178,7 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements protected void createPages() { int pageIndex = 0; List<IModelEditorBinding<EObject>> bindings = - IModelEditorBindingService.INSTANCE.getBindings(editedObject); + IModelEditorBindingService.getInstance().getBindings(editedObject); sort(bindings, new Comparator<IModelEditorBinding<EObject>>() { @Override public int compare(IModelEditorBinding<EObject> o1, IModelEditorBinding<EObject> o2) { @@ -204,7 +204,7 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements @Override public void doSave(IProgressMonitor monitor) { ITopLevelElement topElement = - IPersistencyService.INSTANCE.getTopLevelElementFor(editedObject); + IPersistencyService.getInstance().getTopLevelElementFor(editedObject); try { topElement.doSave(monitor); } catch(Exception e) { @@ -222,8 +222,8 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements /** {@inheritDoc} */ @Override public void dispose() { - ITopLevelElement target = IPersistencyService.INSTANCE.getTopLevelElementFor(editedObject); - ICommandStackService.INSTANCE.removeCommandStackListener(target, this); + ITopLevelElement target = IPersistencyService.getInstance().getTopLevelElementFor(editedObject); + ICommandStackService.getInstance().removeCommandStackListener(target, this); editedObject.eAdapters().remove(editedObjectChangeAdapter); super.dispose(); } @@ -231,7 +231,7 @@ public class ExtendableMultiPageEditor extends MultiPageEditorPart implements /** {@inheritDoc} */ @Override public boolean isDirty() { - return ICommandStackService.INSTANCE.isDirty(editedObject); + return ICommandStackService.getInstance().isDirty(editedObject); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ModelElementEditorInput.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ModelElementEditorInput.java index 8363829dd..b161a3fbe 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ModelElementEditorInput.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/editor/ModelElementEditorInput.java @@ -43,7 +43,7 @@ public final class ModelElementEditorInput implements IEditorInput { /** Constructor. */ public ModelElementEditorInput(EObject modelElement) { this.modelElement = modelElement; - this.handler = IModelElementHandlerService.INSTANCE.getModelElementHandler(modelElement); + this.handler = IModelElementHandlerService.getInstance().getModelElementHandler(modelElement); } /** Returns the editor input's {@link EObject} model element. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java index 3402c151e..63b6f0687 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java @@ -57,11 +57,11 @@ public class KISSViewerContentProvider implements ITreeContentProvider { /** {@inheritDoc} */ @Override public Object getParent(Object element) { - if(element == KernelIntrospectionSystemService.INSTANCE) { + if(element == KernelIntrospectionSystemService.getInstance()) { return KernelIntrospectionSystemService.class; } if(element instanceof IIntrospectiveKernelService) { - return KernelIntrospectionSystemService.INSTANCE; + return KernelIntrospectionSystemService.getInstance(); } return null; } @@ -70,7 +70,7 @@ public class KISSViewerContentProvider implements ITreeContentProvider { @Override public Object[] getElements(Object inputElement) { if(inputElement == KernelIntrospectionSystemService.class) { - return new Object[] {KernelIntrospectionSystemService.INSTANCE}; + return new Object[] {KernelIntrospectionSystemService.getInstance()}; } return getChildren(inputElement); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PersistencyServiceIntrospectionDetailsUIHandler.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PersistencyServiceIntrospectionDetailsUIHandler.java index 96909b842..dcc0d738c 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PersistencyServiceIntrospectionDetailsUIHandler.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PersistencyServiceIntrospectionDetailsUIHandler.java @@ -121,7 +121,7 @@ public final class PersistencyServiceIntrospectionDetailsUIHandler extends ITopLevelElement top = (ITopLevelElement)parentElement; switch(columnIndex) { case 0: - return IModelElementHandlerService.INSTANCE.getName(top + return IModelElementHandlerService.getInstance().getName(top .getRootModelElement()); case 1: return top.getRootModelElement().getClass().getName(); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PrototypeServiceIntrospectionDetailsUIHandler.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PrototypeServiceIntrospectionDetailsUIHandler.java index 4872b4f7a..3e4492078 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PrototypeServiceIntrospectionDetailsUIHandler.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/details/handler/PrototypeServiceIntrospectionDetailsUIHandler.java @@ -50,15 +50,15 @@ public final class PrototypeServiceIntrospectionDetailsUIHandler extends String heading = "Type to search registered providers:"; String footer = "Number of currently registered prototypes: " + - IPrototypeService.INSTANCE.getAllPrototypes().size() + " (" + - IPrototypeService.INSTANCE.getPrimaryPrototypes().size() + + IPrototypeService.getInstance().getAllPrototypes().size() + " (" + + IPrototypeService.getInstance().getPrimaryPrototypes().size() + " primary prototypes)"; return createFilteredTreeInTabFolder(parent, heading, footer, "Registered Providers"); } /** Find the prototype provider for the given prototype. */ private Class<? extends IPrototypeProvider> findProtoypeProviderClass(Prototype proto) { - for(IPrototypeProvider provider : IPrototypeService.INSTANCE.getPrototypeProviders()) { + for(IPrototypeProvider provider : IPrototypeService.getInstance().getPrototypeProviders()) { if(provider.getPrototypes().contains(proto)) { return provider.getClass(); } @@ -158,6 +158,6 @@ public final class PrototypeServiceIntrospectionDetailsUIHandler extends /** {@inheritDoc} */ @Override protected Object getInputObject() { - return IPrototypeService.INSTANCE; + return IPrototypeService.getInstance(); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java index 4309f26dd..86885093b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/NamedCommentedPropertySection.java @@ -72,7 +72,7 @@ public class NamedCommentedPropertySection extends PropertySectionBase { // do section retargeting IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(namedCommented); + IModelElementHandlerService.getInstance().getModelElementHandler(namedCommented); if(handler != null) { EObject retarget = handler.getPropertySectionRetargetElement(namedCommented); if(retarget instanceof INamedCommentedElement) { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/PropertiesAdapterFactory.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/PropertiesAdapterFactory.java index 1616ba7a6..9b1984d5c 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/PropertiesAdapterFactory.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/properties/PropertiesAdapterFactory.java @@ -40,7 +40,7 @@ public final class PropertiesAdapterFactory implements IAdapterFactory { if(adapterType == ITabbedPropertySheetPageContributor.class && adaptableObject instanceof EObject) { EObject modelElement = (EObject)adaptableObject; - if(IPersistencyService.INSTANCE.getTopLevelElementFor(modelElement) != null) { + if(IPersistencyService.getInstance().getTopLevelElementFor(modelElement) != null) { return new ITabbedPropertySheetPageContributor() { @Override diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/ConstraintMenu.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/ConstraintMenu.java index 867339853..ef2c3ec67 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/ConstraintMenu.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/ConstraintMenu.java @@ -114,8 +114,8 @@ public class ConstraintMenu implements IContextMenuContributor { /** Constructor. */ public GoToConstrained(IConstrained c) { - super("Go to " + IModelElementHandlerService.INSTANCE.getName(c), - createFromImage(IModelElementHandlerService.INSTANCE.getIcon(c))); + super("Go to " + IModelElementHandlerService.getInstance().getName(c), + createFromImage(IModelElementHandlerService.getInstance().getIcon(c))); this.c = c; } @@ -123,21 +123,21 @@ public class ConstraintMenu implements IContextMenuContributor { @Override public void run() { IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(c); + IModelElementHandlerService.getInstance().getModelElementHandler(c); EObject eltToOpen = handler == null ? c : handler.handleOpenModelElementRequest(c); - IModelEditorBindingService.INSTANCE.openInEditor(eltToOpen); + IModelEditorBindingService.getInstance().openInEditor(eltToOpen); } } /** Get the icon of the prototype. */ public static String getName(IConstraint c, String prefix) { - String name = IModelElementHandlerService.INSTANCE.getName(c); + String name = IModelElementHandlerService.getInstance().getName(c); return prefix + (name == null ? "Constraint" : name); } /** Get the icon of the prototype. */ public static ImageDescriptor getIcon(IConstraint c, ImageDescriptor overlay) { - Image img = IModelElementHandlerService.INSTANCE.getIcon(c); + Image img = IModelElementHandlerService.getInstance().getIcon(c); if(img == null) { return null; } @@ -196,22 +196,22 @@ public class ConstraintMenu implements IContextMenuContributor { public void run() { IConstraintVerificationStatus status = c.getVerificationStatus(); if(c.getVerificationStatus() instanceof OutdatedVerificationStatus && - IConstraintVerificationUIService.INSTANCE.canOpen(status)) { - ICommandStackService.INSTANCE.runAsCommand(c, new Runnable() { + IConstraintVerificationUIService.getInstance().canOpen(status)) { + ICommandStackService.getInstance().runAsCommand(c, new Runnable() { @Override public void run() { - IConstraintVerificationUIService.INSTANCE.openStatus(status); + IConstraintVerificationUIService.getInstance().openStatus(status); } }); return; } - if(IConstraintVerificationUIService.INSTANCE.canOpen(status)) { - IConstraintVerificationUIService.INSTANCE.openStatus(status); + if(IConstraintVerificationUIService.getInstance().canOpen(status)) { + IConstraintVerificationUIService.getInstance().openStatus(status); } else { // In the very rare cases where the status cannot be open (if the defaults are // used, this should not happen), we provide some defaults. Shell sh = Display.getCurrent().getActiveShell(); - String name = IModelElementHandlerService.INSTANCE.getName(c); + String name = IModelElementHandlerService.getInstance().getName(c); String fullName = name == null ? "constraint" : name; if(status instanceof FailVerificationStatus) { String msg = (name == null ? "The " : fullName); @@ -252,7 +252,7 @@ public class ConstraintMenu implements IContextMenuContributor { String prefix) { super(c, selectedElt, prefix, ESharedImages.ERROR_OVERLAY.getImageDescriptor()); List<IFix> fixes = - IConstraintVerificationService.INSTANCE.fixes(c.getVerificationStatus()); + IConstraintVerificationService.getInstance().fixes(c.getVerificationStatus()); if(fixes != null) { for(IFix fix : fixes) { this.add(new ActionContributionItem(new FixAction(fix))); @@ -276,7 +276,7 @@ public class ConstraintMenu implements IContextMenuContributor { /** {@inheritDoc} */ @Override public void run() { - ICommandStackService.INSTANCE.runAsCommand(c, new Runnable() { + ICommandStackService.getInstance().runAsCommand(c, new Runnable() { @Override public void run() { diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/DoubleClick.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/DoubleClick.java index 04c141f84..dbf1d3c73 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/DoubleClick.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/DoubleClick.java @@ -60,16 +60,16 @@ class DoubleClick implements IDoubleClickListener { if(element != null) { if(!useRawEObject) { IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(element); + IModelElementHandlerService.getInstance().getModelElementHandler(element); if(handler != null) { element = handler.handleOpenModelElementRequest(element); } } - IModelEditorBindingService.INSTANCE.openInEditor(element); + IModelEditorBindingService.getInstance().openInEditor(element); } else { Object selected = ((IStructuredSelection)event.getSelection()).getFirstElement(); if(selected instanceof ITutorialStepUI) { - ITutorialUIService.INSTANCE.openInEditor((ITutorialStepUI)selected); + ITutorialUIService.getInstance().openInEditor((ITutorialStepUI)selected); } } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java index 40dc770dc..d6780f82b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LibraryView.java @@ -106,7 +106,7 @@ public class LibraryView extends ViewPart { viewer.addDragSupport(dndAdapter.getSupportedDNDOperations(), new Transfer[] {dndAdapter.getPreferredTransfer()}, dndAdapter); - viewer.setInput(IPrototypeService.INSTANCE.getAllTopLevelPrototypesCategories()); + viewer.setInput(IPrototypeService.getInstance().getAllTopLevelPrototypesCategories()); viewer.addFilter(new LibraryViewerFilter()); @@ -141,7 +141,7 @@ public class LibraryView extends ViewPart { for(Class<? extends EObject> clazz : editorBase.getVisibleEObjectTypes()) { List<Prototype> composablePrototypes = - IPrototypeService.INSTANCE.getComposablePrototypes(clazz); + IPrototypeService.getInstance().getComposablePrototypes(clazz); if(getParentElement(containerObject, ILibraryElement.class, true) == null) { supportedBaseClasses.addAll(composablePrototypes); } else { @@ -190,7 +190,7 @@ public class LibraryView extends ViewPart { // delegate to the model element handlers EObject prototype = ((Prototype)element).getPrototype(); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(prototype); + IModelElementHandlerService.getInstance().getModelElementHandler(prototype); if(handler != null) { return handler.getIcon(prototype); } @@ -269,7 +269,7 @@ public class LibraryView extends ViewPart { } IEditorPart part = (IEditorPart)workbenchPart; - viewer.setInput(IPrototypeService.INSTANCE.getAllTopLevelPrototypesCategories()); + viewer.setInput(IPrototypeService.getInstance().getAllTopLevelPrototypesCategories()); switchWorkbenchEditor(part); } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LinkWithEditorPartListener.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LinkWithEditorPartListener.java index 02cf8926a..405edea43 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LinkWithEditorPartListener.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/LinkWithEditorPartListener.java @@ -54,7 +54,7 @@ final class LinkWithEditorPartListener implements IPartListener2 { if(editor.getEditorInput() instanceof ModelElementEditorInput) { EObject editorInput = ((ModelElementEditorInput)editor.getEditorInput()).getModelElement(); - INavigatorService.INSTANCE.revealModelElement(editorInput); + INavigatorService.getInstance().revealModelElement(editorInput); } } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewContentProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewContentProvider.java index 6112b846f..d11fbcd00 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewContentProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewContentProvider.java @@ -87,7 +87,7 @@ public class MarkerViewContentProvider implements ITreeContentProvider { @Override public Object[] getChildren(Object parentElement) { if(parentElement instanceof ESeverity) { - return IMarkerService.INSTANCE.getAllViolationsWithSeverity((ESeverity)parentElement) + return IMarkerService.getInstance().getAllViolationsWithSeverity((ESeverity)parentElement) .toArray(); } return null; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewPart.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewPart.java index 43ebeac58..68f00f137 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewPart.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/MarkerViewPart.java @@ -68,7 +68,7 @@ public class MarkerViewPart extends ViewPart { /** Constructor. */ public MarkerViewPart() { - ((MarkerService)IMarkerService.INSTANCE).setMarkerViewPart(this); + ((MarkerService)IMarkerService.getInstance()).setMarkerViewPart(this); toggleState.put(DEBUG, false); toggleState.put(INFO, false); toggleState.put(WARNING, true); @@ -92,7 +92,7 @@ public class MarkerViewPart extends ViewPart { if(oldImage != null) { oldImage.dispose(); } - cell.setImage(IMarkerService.INSTANCE.getImageFor((ESeverity)cell.getElement(), + cell.setImage(IMarkerService.getInstance().getImageFor((ESeverity)cell.getElement(), false).createImage()); } else { cell.setText(""); @@ -107,7 +107,7 @@ public class MarkerViewPart extends ViewPart { IConstraintViolation<? extends EObject> violation = (IConstraintViolation<? extends EObject>)cell.getElement(); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(violation + IModelElementHandlerService.getInstance().getModelElementHandler(violation .getSource()); cell.setText(handler != null ? handler.getName(violation.getSource()) : ""); } else { @@ -135,10 +135,10 @@ public class MarkerViewPart extends ViewPart { IConstraintViolation<? extends EObject> violation = (IConstraintViolation<? extends EObject>)cell.getElement(); EObject rootElement = - IPersistencyService.INSTANCE.getTopLevelElementFor( + IPersistencyService.getInstance().getTopLevelElementFor( violation.getSource()).getRootModelElement(); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE + IModelElementHandlerService.getInstance() .getModelElementHandler(rootElement); cell.setText(handler != null ? handler.getName(rootElement) : ""); } else { @@ -162,7 +162,7 @@ public class MarkerViewPart extends ViewPart { return super.getDoubleClickedElement(selection); } }); - gui.getTreeViewer().setInput(IMarkerService.INSTANCE); + gui.getTreeViewer().setInput(IMarkerService.getInstance()); createToggleActions(); } @@ -217,7 +217,7 @@ public class MarkerViewPart extends ViewPart { this.severity = severity; setToolTipText(tooltip); setChecked(toggleState.get(severity)); - setImageDescriptor(IMarkerService.INSTANCE.getImageFor(severity, false)); + setImageDescriptor(IMarkerService.getInstance().getImageFor(severity, false)); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorNewMenu.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorNewMenu.java index ff832453a..76f59260e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorNewMenu.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorNewMenu.java @@ -54,7 +54,7 @@ public class NavigatorNewMenu implements IContextMenuContributor { /** Constructor. */ public NavigatorNewMenu() { - for(Prototype prototype : IPrototypeService.INSTANCE.getPrimaryPrototypes()) { + for(Prototype prototype : IPrototypeService.getInstance().getPrimaryPrototypes()) { try { actions.add(new AddPrototypeAction(prototype)); } catch(Exception e) { @@ -68,7 +68,7 @@ public class NavigatorNewMenu implements IContextMenuContributor { @Override public List<IContributionItem> getContributedItems(EObject selectedObject, ContextMenuContextProvider contextProvider) { - if(!INavigatorService.INSTANCE.isNavigatorView(contextProvider) || selectedObject == null) { + if(!INavigatorService.getInstance().isNavigatorView(contextProvider) || selectedObject == null) { return Collections.emptyList(); } boolean expert = ((NavigatorViewPart)contextProvider).isExpertViewActive(); @@ -107,7 +107,7 @@ public class NavigatorNewMenu implements IContextMenuContributor { public static ImageDescriptor getIcon(Prototype prototype) { EObject element = prototype.getPrototype(); IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(element); + IModelElementHandlerService.getInstance().getModelElementHandler(element); if(handler == null) return null; @@ -118,13 +118,13 @@ public class NavigatorNewMenu implements IContextMenuContributor { /** {@inheritDoc} */ @Override public void run() { - ICommandStackService.INSTANCE.runAsCommand(container, new Runnable() { + ICommandStackService.getInstance().runAsCommand(container, new Runnable() { @Override public void run() { EObject newObject = prototype.getPrototypeCopy(); - if(IElementCompositorService.INSTANCE.compose(container, newObject, null)) { - IModelEditorBindingService.INSTANCE.openInEditor(newObject); + if(IElementCompositorService.getInstance().compose(container, newObject, null)) { + IModelEditorBindingService.getInstance().openInEditor(newObject); } } }); @@ -135,21 +135,21 @@ public class NavigatorNewMenu implements IContextMenuContributor { * prototype can be added to it. */ public boolean prepare(EObject container, boolean expert) { - if(ITutorialService.INSTANCE.isTutorialActive()) { - if(!ITutorialService.INSTANCE.prototypeActive(prototype)) { + if(ITutorialService.getInstance().isTutorialActive()) { + if(!ITutorialService.getInstance().prototypeActive(prototype)) { this.container = null; return false; } } IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(prototype + IModelElementHandlerService.getInstance().getModelElementHandler(prototype .getPrototype()); if(!expert && handler != null && handler.hiddenInNonExpertView()) { this.container = null; return false; } this.container = container; - return IElementCompositorService.INSTANCE.canCompose(container, + return IElementCompositorService.getInstance().canCompose(container, prototype.getPrototype(), null); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java index adcdd6e69..cb6bd9825 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentProvider.java @@ -58,7 +58,7 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { // delegate to the top-level element contexts of the persistency service List<Object> result = new LinkedList<Object>(); - for(ITopLevelElement context : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement context : IPersistencyService.getInstance().getTopLevelElements()) { EObject root = context.getRootModelElement(); if(libraryViewActive && root instanceof ILibrary) { result.add(root); @@ -67,8 +67,8 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { result.add(root); } } - if(ITutorialService.INSTANCE.isTutorialActive()) { - result.add(ITutorialService.INSTANCE.getActiveTutorial().getDefinition()); + if(ITutorialService.getInstance().isTutorialActive()) { + result.add(ITutorialService.getInstance().getActiveTutorial().getDefinition()); } return result.toArray(); } @@ -83,7 +83,7 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { return new Object[0]; } IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(parentElement); + IModelElementHandlerService.getInstance().getModelElementHandler(parentElement); if(handler != null) { List<EObject> children = new ArrayList<EObject>(); children.addAll(filterTutorialElements(filterExpertElements(handler @@ -104,8 +104,8 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { * which are not whitelisted. */ private Collection<? extends EObject> filterTutorialElements(List<EObject> elements) { - if(ITutorialService.INSTANCE.isTutorialActive()) { - ITutorialUIService uiService = ITutorialUIService.INSTANCE; + if(ITutorialService.getInstance().isTutorialActive()) { + ITutorialUIService uiService = ITutorialUIService.getInstance(); return elements.stream().filter(e -> uiService.elementVisibleInNavigator(e)) .collect(Collectors.toList()); } @@ -121,7 +121,7 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { List<EObject> filtered = new ArrayList<EObject>(); for(EObject current : elements) { IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler(current); + IModelElementHandlerService.getInstance().getModelElementHandler(current); if(!handler.hiddenInNonExpertView()) filtered.add(current); } @@ -135,16 +135,16 @@ public class NavigatorTreeContentProvider extends TreeContentProviderBase { public Object getParent(Object element) { if(element instanceof EObject) { EObject me = (EObject)element; - if(IPersistencyService.INSTANCE.isTopLevelElement(me)) { + if(IPersistencyService.getInstance().isTopLevelElement(me)) { // delegate to persistency service - return IPersistencyService.INSTANCE; + return IPersistencyService.getInstance(); } return me.eContainer(); } if(element instanceof TutorialStepBase) { TutorialStepBase step = (TutorialStepBase)element; if(step.getParent() == null) { - return IPersistencyService.INSTANCE; + return IPersistencyService.getInstance(); } return step.getParent(); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentSorter.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentSorter.java index 1123ad084..799b2746f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentSorter.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorTreeContentSorter.java @@ -47,9 +47,9 @@ public class NavigatorTreeContentSorter extends ViewerSorter { } if(e1 instanceof EObject && e2 instanceof EObject) { IModelElementHandler<EObject> handler1 = - IModelElementHandlerService.INSTANCE.getModelElementHandler((EObject)e1); + IModelElementHandlerService.getInstance().getModelElementHandler((EObject)e1); IModelElementHandler<EObject> handler2 = - IModelElementHandlerService.INSTANCE.getModelElementHandler((EObject)e2); + IModelElementHandlerService.getInstance().getModelElementHandler((EObject)e2); int w1 = 100000000; if(handler1 != null) { w1 = handler1.getNavigatorViewWeight((EObject)e1); @@ -72,7 +72,7 @@ public class NavigatorTreeContentSorter extends ViewerSorter { public int category(Object element) { if(element instanceof TutorialStepBase) { // FIXME: not correct - return ITutorialService.INSTANCE.getActiveTutorial().getDefinition().getSteps() + return ITutorialService.getInstance().getActiveTutorial().getDefinition().getSteps() .indexOf(element); } return super.category(element); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorViewPart.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorViewPart.java index 6f96e61a7..ce533ef20 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorViewPart.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/views/NavigatorViewPart.java @@ -121,7 +121,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe if(viewer.getControl().isDisposed()) { return Status.OK_STATUS; } - IActionService.INSTANCE.refresh(); + IActionService.getInstance().refresh(); viewer.refresh(); NavigatorViewPart.this.refreshPartTitleAndImage(); @@ -158,7 +158,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** Constructor. */ public NavigatorViewPart() { - ((NavigatorService)INavigatorService.INSTANCE).setNavigatorViewPart(this); + ((NavigatorService)INavigatorService.getInstance()).setNavigatorViewPart(this); } /** {@inheritDoc} */ @@ -179,11 +179,11 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe createContextMenu(); viewer.addSelectionChangedListener(this); - viewer.setInput(IPersistencyService.INSTANCE); + viewer.setInput(IPersistencyService.getInstance()); viewer.addDoubleClickListener(new DoubleClick()); - IActionService.INSTANCE.registerGlobalActions(getViewSite().getActionBars()); + IActionService.getInstance().registerGlobalActions(getViewSite().getActionBars()); createLinkWithEditorAction(); getSelectionService().addSelectionListener(this); @@ -267,7 +267,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** Creates the context menu. */ private void createContextMenu() { - menuManager = IContextMenuService.INSTANCE.createDefaultContextMenu(this); + menuManager = IContextMenuService.getInstance().createDefaultContextMenu(this); Menu contextMenu = menuManager.createContextMenu(viewer.getControl()); viewer.getControl().setMenu(contextMenu); @@ -295,7 +295,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** {@inheritDoc} */ @Override public void selectionChanged(IWorkbenchPart part, ISelection selection) { - IActionService.INSTANCE.refresh(); + IActionService.getInstance().refresh(); // do not fire property change here, since it was not the viewers // selection that changed but the workbench-wide selection } @@ -303,7 +303,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** {@inheritDoc} */ @Override public void selectionChanged(SelectionChangedEvent event) { - IActionService.INSTANCE.refresh(); + IActionService.getInstance().refresh(); // fire upon viewer selection change firePropertyChange(IWorkbenchPartConstants.PROP_DIRTY); } @@ -311,7 +311,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** {@inheritDoc} */ @Override public void dispose() { - ((NavigatorService)INavigatorService.INSTANCE).setNavigatorViewPart(null); + ((NavigatorService)INavigatorService.getInstance()).setNavigatorViewPart(null); getSelectionService().removeSelectionListener(this); getSite().setSelectionProvider(null); @@ -346,7 +346,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe private void refreshPartTitleAndImage() { String partName = "Model Navigator"; Image partImage = ESharedImages.NAVIGATOR.getImage(); - if(ITutorialService.INSTANCE.isTutorialActive()) { + if(ITutorialService.getInstance().isTutorialActive()) { partName = "Tutorial Navigator"; partImage = ESharedImages.TUTORIAL_TODO.getImage(); } @@ -357,13 +357,13 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** {@inheritDoc} */ @Override public Saveable[] getSaveables() { - return INavigatorService.INSTANCE.getSaveables(); + return INavigatorService.getInstance().getSaveables(); } /** {@inheritDoc} */ @Override public Saveable[] getActiveSaveables() { - return INavigatorService.INSTANCE.getActiveSaveables(); + return INavigatorService.getInstance().getActiveSaveables(); } /** {@inheritDoc} */ @@ -381,7 +381,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe /** {@inheritDoc} */ @Override public boolean isDirty() { - return IPersistencyService.INSTANCE.isDirty(); + return IPersistencyService.getInstance().isDirty(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ConstraintViolationAwareLabelProviderBase.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ConstraintViolationAwareLabelProviderBase.java index 9e07554a2..a6dbc5d17 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ConstraintViolationAwareLabelProviderBase.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ConstraintViolationAwareLabelProviderBase.java @@ -68,7 +68,7 @@ public class ConstraintViolationAwareLabelProviderBase extends ModelElementLabel */ protected Collection<IConstraintViolation<?>> getViolationsForObject(Object object) { Collection<IConstraintViolation<?>> violations = - IMarkerService.INSTANCE.getViolations((EObject)object); + IMarkerService.getInstance().getViolations((EObject)object); return filterViolations(violations, object); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ModelElementLabelProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ModelElementLabelProvider.java index 02e29a105..449663fbd 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ModelElementLabelProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/ModelElementLabelProvider.java @@ -46,7 +46,7 @@ public class ModelElementLabelProvider extends ColumnLabelProvider { public String getText(Object element) { if(element instanceof EObject) { IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler((EObject)element); + IModelElementHandlerService.getInstance().getModelElementHandler((EObject)element); if(handler != null) return handler.getName((EObject)element); @@ -68,7 +68,7 @@ public class ModelElementLabelProvider extends ColumnLabelProvider { public Image getImage(Object element) { if(element instanceof EObject) { IModelElementHandler<EObject> handler = - IModelElementHandlerService.INSTANCE.getModelElementHandler((EObject)element); + IModelElementHandlerService.getInstance().getModelElementHandler((EObject)element); if(handler != null) { Image res = handler.getIcon((EObject)element); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/TutorialDefinitionModelElementLabelProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/TutorialDefinitionModelElementLabelProvider.java index 0041773d2..e2dcbcb3f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/TutorialDefinitionModelElementLabelProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/presentation/TutorialDefinitionModelElementLabelProvider.java @@ -54,7 +54,7 @@ public class TutorialDefinitionModelElementLabelProvider extends ModelElementLab /** Returns the image for the tutorial step. */ private Image getTutorialStepImage(TutorialStepBase element) { - ITutorialService s = ITutorialService.INSTANCE; + ITutorialService s = ITutorialService.getInstance(); if(s.isCompletedStep(element)) { return ESharedImages.OK.getImage(); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IActionService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IActionService.java index ce1d72eb2..f4e7b902b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IActionService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IActionService.java @@ -33,10 +33,20 @@ import org.fortiss.tooling.kernel.ui.internal.ActionService; * @ConQAT.Rating GREEN Hash: 16B780A161BE0C45929ECEE8B9839D37 */ public interface IActionService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IActionService INSTANCE = new ActionService(); + /** Returns the service instance. */ + public static IActionService getInstance() { + return INSTANCE; + } + /** Runs the global copy action. */ public void runGlobalCopyAction(); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IAllocationEditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IAllocationEditPartFactoryService.java index f1ed16d6e..59bd5be30 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IAllocationEditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IAllocationEditPartFactoryService.java @@ -32,8 +32,18 @@ import org.fortiss.tooling.kernel.ui.internal.AllocationEditPartFactoryService; * @ConQAT.Rating GREEN Hash: D6FC81F6521698E9A15E3F73B26A010B */ public interface IAllocationEditPartFactoryService extends EditPartFactory { - - /** Singleton instance of the allocation factory service */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IAllocationEditPartFactoryService INSTANCE = new AllocationEditPartFactoryService(); + + /** Returns the service instance. */ + public static IAllocationEditPartFactoryService getInstance() { + return INSTANCE; + } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IConstraintVerificationUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IConstraintVerificationUIService.java index cb6caeac9..48e5ed3cd 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IConstraintVerificationUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IConstraintVerificationUIService.java @@ -14,11 +14,21 @@ import org.fortiss.tooling.kernel.ui.internal.ConstraintVerificationUIService; * @ConQAT.Rating YELLOW Hash: 07DB0EA202D19FE3C1407B53B01F974F */ public interface IConstraintVerificationUIService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IConstraintVerificationUIService INSTANCE = new ConstraintVerificationUIService(); + /** Returns the service instance. */ + public static IConstraintVerificationUIService getInstance() { + return INSTANCE; + } + /** Action to take when trying to open the given status. */ public void openStatus(IConstraintVerificationStatus status); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IContextMenuService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IContextMenuService.java index ccfc02d60..8655b1f3e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IContextMenuService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IContextMenuService.java @@ -68,10 +68,20 @@ public interface IContextMenuService { public static final String[] MENU_SECTION_IDS = {TOP_MOST_MENU_SECTION_ID, BEFORE_GLOBAL_MENU_SECTION_ID, AFTER_GLOBAL_MENU_SECTION_ID, REPOSITORY_MENU_SECTION_ID, BOTTOM_MOST_MENU_SECTION_ID}; - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IContextMenuService INSTANCE = new ContextMenuService(); + /** Returns the service instance. */ + public static IContextMenuService getInstance() { + return INSTANCE; + } + /** Creates the default context menu for the given context object. */ MenuManager createDefaultContextMenu(ContextMenuContextProvider contextProvider); } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IEditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IEditPartFactoryService.java index 47deb24a0..2eb18bf1f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IEditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IEditPartFactoryService.java @@ -34,7 +34,17 @@ import org.fortiss.tooling.kernel.ui.internal.EditPartFactoryService; * @ConQAT.Rating GREEN Hash: B5F36989D0DE4028F971DD1F8CA326BC */ public interface IEditPartFactoryService extends EditPartFactory { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IEditPartFactoryService INSTANCE = new EditPartFactoryService(); + + /** Returns the service instance. */ + public static IEditPartFactoryService getInstance() { + return INSTANCE; + } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IMarkerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IMarkerService.java index 7c3293faf..ffb8932e8 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IMarkerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IMarkerService.java @@ -41,10 +41,20 @@ public interface IMarkerService { /** Returns view id of the marker view. */ public static final String MARKER_VIEW = "org.fortiss.tooling.kernel.model.marker"; - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IMarkerService INSTANCE = new MarkerService(); + /** Returns the service instance. */ + public static IMarkerService getInstance() { + return INSTANCE; + } + /** Returns the constraint violations for the given element. */ Collection<IConstraintViolation<? extends EObject>> getViolations(EObject element); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelEditorBindingService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelEditorBindingService.java index 1476f1f3c..953823472 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelEditorBindingService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelEditorBindingService.java @@ -36,10 +36,20 @@ import org.fortiss.tooling.kernel.ui.internal.ModelEditorBindingService; * @ConQAT.Rating GREEN Hash: DB0D8B5DE0054841E373D7306A108434 */ public interface IModelEditorBindingService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IModelEditorBindingService INSTANCE = new ModelEditorBindingService(); + /** Returns the service instance. */ + public static IModelEditorBindingService getInstance() { + return INSTANCE; + } + /** Opens an editor for the given element. */ void openInEditor(EObject element); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelElementHandlerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelElementHandlerService.java index e4ce4d076..31fee834f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelElementHandlerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/IModelElementHandlerService.java @@ -38,10 +38,20 @@ public interface IModelElementHandlerService { /** The view ID of the model element library view. */ public static final String MODEL_ELEMENT_LIBRARY_VIEW = "org.fortiss.tooling.kernel.model.element.library"; - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IModelElementHandlerService INSTANCE = new ModelElementHandlerService(); + /** Returns the service instance. */ + public static IModelElementHandlerService getInstance() { + return INSTANCE; + } + /** * Returns the model element handler for the given model element or <code>null</code> if no such * handler exists. diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/INavigatorService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/INavigatorService.java index 337679e65..ee5ff6cdb 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/INavigatorService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/INavigatorService.java @@ -43,9 +43,20 @@ import org.fortiss.tooling.kernel.ui.internal.NavigatorService; * @ConQAT.Rating GREEN Hash: 0A7183036670B523E18DB266D242653A */ public interface INavigatorService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final INavigatorService INSTANCE = new NavigatorService(); + /** Returns the service instance. */ + public static INavigatorService getInstance() { + return INSTANCE; + } + /** Returns view id of the navigator view. */ public static final String NAVIGATOR_VIEW = "org.fortiss.tooling.kernel.model.navigator"; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/ITutorialUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/ITutorialUIService.java index 4abdf546a..84dc33589 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/ITutorialUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/service/ITutorialUIService.java @@ -33,9 +33,20 @@ import org.fortiss.tooling.kernel.ui.internal.TutorialUIService; * @ConQAT.Rating RED Hash: */ public interface ITutorialUIService extends ITutorialUIWhitelistProvider { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ITutorialUIService INSTANCE = new TutorialUIService(); + /** Returns the service instance. */ + public static ITutorialUIService getInstance() { + return INSTANCE; + } + /** Programmatically register a tutorial provider. */ public void registerTutorialUIProvider(Class<? extends ITutorialProvider> nonUIprovider, Class<? extends ITutorialUIProvider> uiProvider); diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ActionUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ActionUtils.java index e26c578e5..7aa7f67fc 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ActionUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ActionUtils.java @@ -42,17 +42,17 @@ public class ActionUtils { @Override public void keyReleased(KeyEvent e) { if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x63) { - IActionService.INSTANCE.runGlobalCopyAction(); + IActionService.getInstance().runGlobalCopyAction(); } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x76) { - IActionService.INSTANCE.runGlobalPasteAction(); + IActionService.getInstance().runGlobalPasteAction(); } else if(e.keyCode == SWT.DEL) { - IActionService.INSTANCE.runGlobalDeleteAction(); + IActionService.getInstance().runGlobalDeleteAction(); } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x78) { - IActionService.INSTANCE.runGlobalCutAction(); + IActionService.getInstance().runGlobalCutAction(); } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x7A) { - IActionService.INSTANCE.runGlobalUndoAction(); + IActionService.getInstance().runGlobalUndoAction(); } else if((e.stateMask & SWT.CTRL) != 0 && e.keyCode == 0x79) { - IActionService.INSTANCE.runGlobalRedoAction(); + IActionService.getInstance().runGlobalRedoAction(); } } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java index 8c392a9e3..5c3366a02 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java @@ -200,7 +200,7 @@ public class ConstraintsUIUtils { IConstraintVerificationStatus status = c.getVerificationStatus(); if(status instanceof OutdatedVerificationStatus) { return "(double-click to update)"; - } else if(IConstraintVerificationUIService.INSTANCE.canOpen(status)) { + } else if(IConstraintVerificationUIService.getInstance().canOpen(status)) { return "(double-click for more details)"; } return ""; @@ -282,7 +282,7 @@ public class ConstraintsUIUtils { @Override protected IStatus run(IProgressMonitor monitor) { synchronized(c) { - IConstraintVerificationService.INSTANCE.verify(c); + IConstraintVerificationService.getInstance().verify(c); } display.asyncExec(() -> ConstraintsUIUtils.triggerMarkersRefresh(c)); return Status.OK_STATUS; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java index a6124ac75..eeb1e4e16 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java @@ -120,7 +120,7 @@ public class CopyPasteUtils { EObject copy = copier.copy(obj); adaptCopyNames(copy, target); copier.copyReferences(); - IElementCompositorService.INSTANCE.compose(target, copy, context); + IElementCompositorService.getInstance().compose(target, copy, context); copiedObjects.add(copy); } for(EObject obj : getClipBoardContent()) { @@ -165,7 +165,7 @@ public class CopyPasteUtils { return false; } } - if(IElementCompositorService.INSTANCE.canCompose(target, insertObj, context)) { + if(IElementCompositorService.getInstance().canCompose(target, insertObj, context)) { return true; } } diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/TutorialUIServiceUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/TutorialUIServiceUtils.java index 5737245bc..13a1be02d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/TutorialUIServiceUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/TutorialUIServiceUtils.java @@ -44,7 +44,7 @@ public class TutorialUIServiceUtils { /** Returns whether the given contribution is a new menu prototype instance of the given class. */ public static boolean isNewMenuContributionPrototype(IContributionItem contribution, Class<? extends EObject> clazz) { - Prototype proto = IActionService.INSTANCE.getNewMenuContributionPrototype(contribution); + Prototype proto = IActionService.getInstance().getNewMenuContributionPrototype(contribution); return proto != null && clazz.isInstance(proto.getPrototype()); } @@ -60,7 +60,7 @@ public class TutorialUIServiceUtils { @Override public void menuAboutToShow(IMenuManager manager) { - boolean tutorialRunning = ITutorialService.INSTANCE.isTutorialActive(); + boolean tutorialRunning = ITutorialService.getInstance().isTutorialActive(); if(tutorialRunning) { createStopTutorialItem(manager); } else { @@ -70,7 +70,7 @@ public class TutorialUIServiceUtils { /** Creates menu items for registered tutorials. */ private void createTutorialItems(final ImageDescriptor imgDescr, IMenuManager manager) { - ITutorialService service = ITutorialService.INSTANCE; + ITutorialService service = ITutorialService.getInstance(); for(String cat : service.getProviderCategories()) { MenuManager catManager = new MenuManager(cat); Map<String, Class<? extends ITutorialProvider>> pMap = @@ -80,7 +80,7 @@ public class TutorialUIServiceUtils { catManager.add(new Action(title, imgDescr) { @Override public void run() { - ITutorialService.INSTANCE.startTutorial(pClass); + ITutorialService.getInstance().startTutorial(pClass); } }); } @@ -94,7 +94,7 @@ public class TutorialUIServiceUtils { /** {@inheritDoc} */ @Override public void run() { - ITutorialService.INSTANCE.stopTutorial(); + ITutorialService.getInstance().stopTutorial(); } }); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java index d9be31f38..bf65c7a2b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java @@ -58,20 +58,20 @@ public class ToolingKernelActivator extends Plugin { /** Initializes the kernel services by calling its singleton {@code toString()} method. */ private void initializeServices() { - KernelIntrospectionSystemService.INSTANCE.toString(); + KernelIntrospectionSystemService.getInstance().toString(); - ICommandStackService.INSTANCE.toString(); - IConnectionCompositorService.INSTANCE.toString(); - IConstraintCheckerService.INSTANCE.toString(); - // FIXME: IConstraintVerificationService.INSTANCE.toString(); - IElementCompositorService.INSTANCE.toString(); - ILibraryService.INSTANCE.toString(); - // FIXME: ILoggingService.INSTANCE.toString(); - IMigrationService.INSTANCE.toString(); - IPersistencyService.INSTANCE.toString(); - IPrototypeService.INSTANCE.toString(); - ITransformationService.INSTANCE.toString(); - // ITutorialService.INSTANCE.toString(); + ICommandStackService.getInstance().toString(); + IConnectionCompositorService.getInstance().toString(); + IConstraintCheckerService.getInstance().toString(); + // FIXME: IConstraintVerificationService.getInstance().toString(); + IElementCompositorService.getInstance().toString(); + ILibraryService.getInstance().toString(); + // FIXME: ILoggingService.getInstance().toString(); + IMigrationService.getInstance().toString(); + IPersistencyService.getInstance().toString(); + IPrototypeService.getInstance().toString(); + ITransformationService.getInstance().toString(); + // ITutorialService.getInstance().toString(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java index b958f20fa..763c0c245 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java @@ -60,7 +60,7 @@ public class IdConsistencyChecker extends ConstraintCheckerBase<EObject> { new ArrayList<IdConsistencyConstraintViolation<IIdLabeled>>(); ITopLevelElement topLevelElement = - IPersistencyService.INSTANCE.getTopLevelElementFor(rootObject); + IPersistencyService.getInstance().getTopLevelElementFor(rootObject); if(topLevelElement != null) { for(IIdLabeled current : getChildrenWithType(rootObject, IIdLabeled.class)) { String persistedId = topLevelElement.getId(current); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java index 965989176..2dbaa73dd 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java @@ -52,7 +52,7 @@ public class CommandStackService implements ICommandStackService { if(target != null) { target.removeCommandStackListener(listener); } else { - for(ITopLevelElement top : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement top : IPersistencyService.getInstance().getTopLevelElements()) { top.removeCommandStackListener(listener); } } @@ -61,47 +61,47 @@ public class CommandStackService implements ICommandStackService { /** {@inheritDoc} */ @Override public void runAsCommand(EObject target, Runnable runner) { - ITopLevelElement context = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement context = IPersistencyService.getInstance().getTopLevelElementFor(target); context.runAsCommand(runner); } /** {@inheritDoc} */ @Override public boolean canUndo(EObject target) { - ITopLevelElement context = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement context = IPersistencyService.getInstance().getTopLevelElementFor(target); return context != null && context.canUndo(); } /** {@inheritDoc} */ @Override public boolean canRedo(EObject target) { - ITopLevelElement context = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement context = IPersistencyService.getInstance().getTopLevelElementFor(target); return context != null && context.canRedo(); } /** {@inheritDoc} */ @Override public void undo(EObject target) { - IPersistencyService.INSTANCE.getTopLevelElementFor(target).undo(); + IPersistencyService.getInstance().getTopLevelElementFor(target).undo(); } /** {@inheritDoc} */ @Override public void redo(EObject target) { - IPersistencyService.INSTANCE.getTopLevelElementFor(target).redo(); + IPersistencyService.getInstance().getTopLevelElementFor(target).redo(); } /** {@inheritDoc} */ @Override public boolean isDirty(EObject target) { - ITopLevelElement context = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement context = IPersistencyService.getInstance().getTopLevelElementFor(target); return context != null && context.isDirty(); } /** {@inheritDoc} */ @Override public void doSave(EObject target, IProgressMonitor monitor) { - ITopLevelElement context = IPersistencyService.INSTANCE.getTopLevelElementFor(target); + ITopLevelElement context = IPersistencyService.getInstance().getTopLevelElementFor(target); if(context != null && context.isDirty()) { try { context.doSave(monitor); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java index 82e340237..0992fa816 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java @@ -58,7 +58,7 @@ public class ConnectionCompositorService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java index 32e646d88..24db13702 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java @@ -61,7 +61,7 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java index 41064f982..85829320f 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java @@ -52,7 +52,7 @@ public final class ConstraintVerificationService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -86,7 +86,7 @@ public final class ConstraintVerificationService extends IConstraintVerifier<IConstraint> verifier = getFirstVerifier(constraint); if(verifier != null) { ITopLevelElement modelContext = - IPersistencyService.INSTANCE.getTopLevelElementFor(constraint); + IPersistencyService.getInstance().getTopLevelElementFor(constraint); // It can happen that <code>modelContext</code> is null, e.g., if the verification is // triggered while the constraint is actually being removed. if(modelContext == null) { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java index 1aa49c37c..df58f1758 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java @@ -62,7 +62,7 @@ public final class ElementCompositorService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -102,7 +102,7 @@ public final class ElementCompositorService extends boolean rval = compositor.compose(container, element, context); // Generate IDs (including potentially instantiated annotations) - IPersistencyService.INSTANCE.getTopLevelElementFor(container).prepareIDs(element); + IPersistencyService.getInstance().getTopLevelElementFor(container).prepareIDs(element); return rval; } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java index 14e65e421..037a52605 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java @@ -57,10 +57,10 @@ public class LibraryPrototypeProvider extends PrototypeProviderBase { Map<String, PrototypeCategory> registeredCategoriesMap = new HashMap<String, PrototypeCategory>(); - for(ILibraryElement libElem : ILibraryService.INSTANCE + for(ILibraryElement libElem : ILibraryService.getInstance() .getLibraryElementsFromAllWorkspaceLibraries()) { List<ILibraryElementHandler<EObject>> handlers = - ((LibraryService)ILibraryService.INSTANCE).getRegisteredHandlers(libElem + ((LibraryService)ILibraryService.getInstance()).getRegisteredHandlers(libElem .getWrappedElement().getClass()); ILibraryElementHandler<EObject> firstHandler = handlers.get(0); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java index 0a5363a2e..909a5b335 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java @@ -76,7 +76,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -167,7 +167,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl List<ILibrary> libs = new LinkedList<ILibrary>(); List<ITopLevelElement> topLevelElements = - IPersistencyService.INSTANCE.getTopLevelElements(); + IPersistencyService.getInstance().getTopLevelElements(); for(ITopLevelElement current : topLevelElements) { EObject root = current.getRootModelElement(); if(root instanceof ILibrary) { @@ -228,7 +228,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl Runnable cmd = new Runnable() { @Override public void run() { - ILibraryService.INSTANCE.setDirty(ref, false); + ILibraryService.getInstance().setDirty(ref, false); EObject copy = copy(lc.getWrappedElement()); ref.setLibraryElementShadow(copy); @@ -237,7 +237,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl } }; - ITopLevelElement topLevel = IPersistencyService.INSTANCE.getTopLevelElementFor(ref); + ITopLevelElement topLevel = IPersistencyService.getInstance().getTopLevelElementFor(ref); if(topLevel != null) { topLevel.runAsNonDirtyingCommand(cmd); } else { @@ -263,7 +263,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl /** {@inheritDoc} */ @Override public void addElementToLibrary(final ILibraryPackage pack, final EObject namedElement) { - ITopLevelElement topLevel = IPersistencyService.INSTANCE.getTopLevelElementFor(pack); + ITopLevelElement topLevel = IPersistencyService.getInstance().getTopLevelElementFor(pack); topLevel.runAsCommand(new Runnable() { @Override public void run() { @@ -277,7 +277,7 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl ILibraryElement libElem = handler.createLibraryElement(copy); pack.getLibraryElements().add(libElem); - for(IPrototypeProvider pp : IPrototypeService.INSTANCE.getPrototypeProviders()) { + for(IPrototypeProvider pp : IPrototypeService.getInstance().getPrototypeProviders()) { if(pp instanceof LibraryPrototypeProvider) { ((LibraryPrototypeProvider)pp).refreshPrototypes(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java index f24c5bc88..31d634139 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java @@ -51,7 +51,7 @@ public class LoggingService extends ObjectAwareServiceBase<LogMessageHandler> im /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java index b02791613..62a7dc181 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java @@ -62,7 +62,7 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java index 172b900ec..d40e7613e 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java @@ -108,7 +108,7 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); for(IStorageProvider p : storageProviderList) { if(p instanceof EclipseResourceStorageProvider) { EclipseResourceStorageProvider ersp = (EclipseResourceStorageProvider)p; @@ -132,9 +132,9 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe /** {@inheritDoc} */ @Override public synchronized UnmodifiableList<ITopLevelElement> getTopLevelElements() { - if(ITutorialService.INSTANCE.isTutorialActive()) { + if(ITutorialService.getInstance().isTutorialActive()) { EObject activeRootElement = - ITutorialService.INSTANCE.getActiveTutorial().getRootElement(); + ITutorialService.getInstance().getActiveTutorial().getRootElement(); return asUnmodifiable(elementCache.stream() .filter(t -> t.getRootModelElement() == activeRootElement) .collect(Collectors.toList())); @@ -173,7 +173,7 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe if(context.isDirty()) { try { EObject rootElement = context.getRootModelElement(); - ILibraryService.INSTANCE.ensureChildrenLibraryReferenceAreUpToDate(rootElement); + ILibraryService.getInstance().ensureChildrenLibraryReferenceAreUpToDate(rootElement); context.doSave(monitor); } catch(CoreException e) { error(ToolingKernelActivator.getDefault(), "Error during save operation.", e); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java index 81a6040c4..e6c11ffad 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java @@ -75,7 +75,7 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -113,8 +113,8 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel /** {@inheritDoc} */ @Override public UnmodifiableList<Prototype> getAllPrototypes() { - if(ITutorialService.INSTANCE.isTutorialActive()) { - ITutorialService service = ITutorialService.INSTANCE; + if(ITutorialService.getInstance().isTutorialActive()) { + ITutorialService service = ITutorialService.getInstance(); return asUnmodifiable(getPrototypes(false).stream() .filter(proto -> service.prototypeActive(proto)).collect(Collectors.toList())); } @@ -124,8 +124,8 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel /** {@inheritDoc} */ @Override public UnmodifiableList<Prototype> getPrimaryPrototypes() { - if(ITutorialService.INSTANCE.isTutorialActive()) { - ITutorialService service = ITutorialService.INSTANCE; + if(ITutorialService.getInstance().isTutorialActive()) { + ITutorialService service = ITutorialService.getInstance(); return asUnmodifiable(getPrototypes(true).stream() .filter(proto -> service.prototypeActive(proto)).collect(Collectors.toList())); } @@ -150,7 +150,7 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel public List<Prototype> getComposablePrototypes(Class<? extends EObject> modelElementType) { List<Prototype> result = new LinkedList<Prototype>(); for(Prototype prototype : getAllPrototypes()) { - if(IElementCompositorService.INSTANCE.canComposePrototype(modelElementType, prototype)) { + if(IElementCompositorService.getInstance().canComposePrototype(modelElementType, prototype)) { result.add(prototype); } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java index bb88109a6..057c5c616 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java @@ -41,35 +41,35 @@ public final class ToolingKernelInternal { /** Initialize the kernel services. */ public static void initializeKernel() { System.out.println("Tooling Kernel initializing ..."); - ((ConnectionCompositorService)IConnectionCompositorService.INSTANCE).initializeService(); - ((ConstraintCheckerService)IConstraintCheckerService.INSTANCE).initializeService(); - ((ConstraintVerificationService)IConstraintVerificationService.INSTANCE) + ((ConnectionCompositorService)IConnectionCompositorService.getInstance()).initializeService(); + ((ConstraintCheckerService)IConstraintCheckerService.getInstance()).initializeService(); + ((ConstraintVerificationService)IConstraintVerificationService.getInstance()) .initializeService(); - ((ElementCompositorService)IElementCompositorService.INSTANCE).initializeService(); - ((LibraryService)ILibraryService.INSTANCE).initializeService(); - ((LoggingService)ILoggingService.INSTANCE).initializeService(); - ((MigrationService)IMigrationService.INSTANCE).initializeService(); - ((PersistencyService)IPersistencyService.INSTANCE).initializeService(); - ((PrototypeService)IPrototypeService.INSTANCE).initializeService(); - ((TransformationService)ITransformationService.INSTANCE).initializeService(); - ((TutorialService)ITutorialService.INSTANCE).initializeService(); + ((ElementCompositorService)IElementCompositorService.getInstance()).initializeService(); + ((LibraryService)ILibraryService.getInstance()).initializeService(); + ((LoggingService)ILoggingService.getInstance()).initializeService(); + ((MigrationService)IMigrationService.getInstance()).initializeService(); + ((PersistencyService)IPersistencyService.getInstance()).initializeService(); + ((PrototypeService)IPrototypeService.getInstance()).initializeService(); + ((TransformationService)ITransformationService.getInstance()).initializeService(); + ((TutorialService)ITutorialService.getInstance()).initializeService(); System.out.println("Tooling Kernel initialized."); } /** Starts the kernel services. */ public static void startKernel() { System.out.println("Tooling Kernel starting ..."); - ((ConnectionCompositorService)IConnectionCompositorService.INSTANCE).startService(); - ((ConstraintCheckerService)IConstraintCheckerService.INSTANCE).startService(); - ((ConstraintVerificationService)IConstraintVerificationService.INSTANCE).startService(); - ((ElementCompositorService)IElementCompositorService.INSTANCE).startService(); - ((LibraryService)ILibraryService.INSTANCE).startService(); - ((LoggingService)ILoggingService.INSTANCE).startService(); - ((MigrationService)IMigrationService.INSTANCE).startService(); - ((PersistencyService)IPersistencyService.INSTANCE).startService(); - ((PrototypeService)IPrototypeService.INSTANCE).startService(); - ((TransformationService)ITransformationService.INSTANCE).startService(); - ((TutorialService)ITutorialService.INSTANCE).startService(); + ((ConnectionCompositorService)IConnectionCompositorService.getInstance()).startService(); + ((ConstraintCheckerService)IConstraintCheckerService.getInstance()).startService(); + ((ConstraintVerificationService)IConstraintVerificationService.getInstance()).startService(); + ((ElementCompositorService)IElementCompositorService.getInstance()).startService(); + ((LibraryService)ILibraryService.getInstance()).startService(); + ((LoggingService)ILoggingService.getInstance()).startService(); + ((MigrationService)IMigrationService.getInstance()).startService(); + ((PersistencyService)IPersistencyService.getInstance()).startService(); + ((PrototypeService)IPrototypeService.getInstance()).startService(); + ((TransformationService)ITransformationService.getInstance()).startService(); + ((TutorialService)ITutorialService.getInstance()).startService(); System.out.println("Tooling Kernel started."); } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java index d772d4b1f..db708122c 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java @@ -62,7 +62,7 @@ public class TransformationService extends ObjectAware2ServiceBase<ITransformati /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java index 63de89d01..9fb97b7b6 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java @@ -78,7 +78,7 @@ public final class TutorialService implements ITutorialService, CommandStackList /** Starts the service. */ public void startService() { - // FIXME (FH): KernelIntrospectionSystemService.INSTANCE.registerService(this); + // FIXME (FH): KernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ @@ -141,8 +141,8 @@ public final class TutorialService implements ITutorialService, CommandStackList activeStep = atomicStepList.get(0); finalAtomicStep = atomicStepList.get(atomicStepList.size() - 1); EObject root = activeTutorial.getRootElement(); - activeTopElement = IPersistencyService.INSTANCE.addDummyEObjectAsTopLevelElement(root); - ICommandStackService.INSTANCE.addCommandStackListener(activeTopElement, this); + activeTopElement = IPersistencyService.getInstance().addDummyEObjectAsTopLevelElement(root); + ICommandStackService.getInstance().addCommandStackListener(activeTopElement, this); fireTutorialStarted(); } catch(InstantiationException e) { error(ToolingKernelActivator.getDefault(), e.getMessage(), e); @@ -167,8 +167,8 @@ public final class TutorialService implements ITutorialService, CommandStackList @Override public void stopTutorial() { fireTutorialStopped(); - ICommandStackService.INSTANCE.removeCommandStackListener(activeTopElement, this); - IPersistencyService.INSTANCE.removeDummyTopLevelElement(activeTutorial.getRootElement()); + ICommandStackService.getInstance().removeCommandStackListener(activeTopElement, this); + IPersistencyService.getInstance().removeDummyTopLevelElement(activeTutorial.getRootElement()); activeTopElement = null; atomicStepList.clear(); activeStep = null; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java index dae9fcd0e..e226b03fc 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java @@ -131,7 +131,7 @@ public class EclipseResourceStorageProvider implements IEclipseResourceStorageSe // are discovered during workspace search, thus introducing a possible // cyclic call during provider initialization ResourcesPlugin.getWorkspace().addResourceChangeListener(this); - KernelIntrospectionSystemService.INSTANCE.registerService(this); + KernelIntrospectionSystemService.getInstance().registerService(this); } /** Searches existing models in Eclipse project roots. */ @@ -225,12 +225,12 @@ public class EclipseResourceStorageProvider implements IEclipseResourceStorageSe } } // Refresh the top-level elements - IPersistencyService.INSTANCE + IPersistencyService.getInstance() .refreshTopLevelElements(EclipseResourceStorageProvider.this); } else if(changeKind == REMOVED) { // A file has been removed. Remove it from one of the ResourceSets owned by // the kernel. - for(ITopLevelElement topLevelElement : IPersistencyService.INSTANCE + for(ITopLevelElement topLevelElement : IPersistencyService.getInstance() .getTopLevelElements()) { final ResourceSet resourceSet = topLevelElement.getResourceSet(); final List<Resource> toRemove = new ArrayList<Resource>(); @@ -299,8 +299,8 @@ public class EclipseResourceStorageProvider implements IEclipseResourceStorageSe public void postLoadContext(ModelContext mc) { // Note: migration could be treated as a "post load" provider, but it is important that it // runs before the other providers so it is handled separately. - if(IMigrationService.INSTANCE.needMigration(mc, mc.getUnknownFeatures())) { - IMigrationService.INSTANCE.migrate(mc, mc.getUnknownFeatures()); + if(IMigrationService.getInstance().needMigration(mc, mc.getUnknownFeatures())) { + IMigrationService.getInstance().migrate(mc, mc.getUnknownFeatures()); } for(IEclipseResourcePostLoadProvider provider : postLoadProviderList) { provider.postModelLoadRun(mc); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java index 82b36fe79..a88c25dda 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java @@ -339,8 +339,8 @@ class ModelContext implements ITopLevelElement, CommandStackListener { ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone(); performNotifyListeners(editingDomain.getCommandStack()); - if(IPersistencyService.INSTANCE != null) { - IPersistencyService.INSTANCE.notifyTopLevelElementChanged(ModelContext.this); + if(IPersistencyService.getInstance() != null) { + IPersistencyService.getInstance().notifyTopLevelElementChanged(ModelContext.this); } } else { // Throw first caught IOException or CoreException diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java index fe7b7424d..4e03f9f6a 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java @@ -33,9 +33,15 @@ import java.util.Set; public final class KernelIntrospectionSystemService implements IIntrospectiveKernelService { /** Returns the singleton instance of the service. */ + @Deprecated public static final KernelIntrospectionSystemService INSTANCE = new KernelIntrospectionSystemService(); + /** Returns the service instance. */ + public static KernelIntrospectionSystemService getInstance() { + return INSTANCE; + } + /** The introspective services of the kernel. */ private final HashSet<IIntrospectiveKernelService> services = new HashSet<IIntrospectiveKernelService>(); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java index 60bbb6301..2999c640e 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java @@ -37,10 +37,20 @@ import org.fortiss.tooling.kernel.internal.CommandStackService; * @ConQAT.Rating GREEN Hash: 4C95EE2A596AF30B31457E6C6FC6CFED */ public interface ICommandStackService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ICommandStackService INSTANCE = new CommandStackService(); + /** Returns the service instance. */ + public static ICommandStackService getInstance() { + return INSTANCE; + } + /** Adds a command stack listener to the stack of the given target element. */ void addCommandStackListener(ITopLevelElement target, CommandStackListener listener); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java index 6e02647f2..6d4b8cd31 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java @@ -39,9 +39,20 @@ import org.fortiss.tooling.kernel.internal.ConnectionCompositorService; */ public interface IConnectionCompositorService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IConnectionCompositorService INSTANCE = new ConnectionCompositorService(); + /** Returns the service instance. */ + public static IConnectionCompositorService getInstance() { + return INSTANCE; + } + /** * Returns whether a connection between the source and the target is * possible for the given parent. Additional information can be included in diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java index 4ce68691a..fccd15c00 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java @@ -38,9 +38,20 @@ import org.fortiss.tooling.kernel.internal.ConstraintCheckerService; */ public interface IConstraintCheckerService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IConstraintCheckerService INSTANCE = new ConstraintCheckerService(); + /** Returns the service instance. */ + public static IConstraintCheckerService getInstance() { + return INSTANCE; + } + /** * Performs all constraint checks on the given model element and recursively * its content and returns the check results. Note, that this method can be diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java index 67af1df43..f1b9924ea 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java @@ -19,10 +19,21 @@ import org.fortiss.tooling.kernel.model.constraints.IConstraintVerificationStatu */ public interface IConstraintVerificationService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IConstraintVerificationService INSTANCE = new ConstraintVerificationService(); + /** Returns the service instance. */ + public static IConstraintVerificationService getInstance() { + return INSTANCE; + } + /** * @param constraint * Verifies <code>constraint</code>. The framework always runs the verification in a diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java index 07a53c65e..41237bcf5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java @@ -39,9 +39,20 @@ import org.fortiss.tooling.kernel.internal.ElementCompositorService; */ public interface IElementCompositorService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IElementCompositorService INSTANCE = new ElementCompositorService(); + /** Returns the service instance. */ + public static IElementCompositorService getInstance() { + return INSTANCE; + } + /** * Determines if there is a compositor that allows the composition of the * container and the prototype {@link EObject}. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java index 116fe85a9..1e6221771 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java @@ -36,9 +36,20 @@ import org.fortiss.tooling.kernel.model.ILibraryPackage; */ public interface ILibraryService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ILibraryService INSTANCE = new LibraryService(); + /** Returns the service instance. */ + public static ILibraryService getInstance() { + return INSTANCE; + } + /** * Returns true if the parameter is a shadow of a library element. * A shadow is a temporary copy of an element, contained inside an diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java index df60c557f..514bd9ec8 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java @@ -38,9 +38,20 @@ import org.fortiss.tooling.kernel.internal.LoggingService; * @ConQAT.Rating GREEN Hash: 256DEBB479F0B05DFA2C2329DDCFE276 */ public interface ILoggingService { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ILoggingService INSTANCE = new LoggingService(); + /** Returns the service instance. */ + public static ILoggingService getInstance() { + return INSTANCE; + } + /** * Triggers the processing method of the given {@link LogMessage} for all * {@link LogMessageHandler}s that accept the {@link LogMessage} from the given diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java index 5175cdb6e..0c4766c15 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java @@ -33,10 +33,20 @@ import org.fortiss.tooling.kernel.internal.MigrationService; * @ConQAT.Rating GREEN Hash: 872F825EEDD44952AD6012AFC47B07C6 */ public interface IMigrationService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IMigrationService INSTANCE = new MigrationService(); + /** Returns the service instance. */ + public static IMigrationService getInstance() { + return INSTANCE; + } + /** Checks whether the migration is needed. */ public boolean needMigration(ITopLevelElement input, Map<EObject, AnyType> unknownFeatures); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java index f30c2d1c3..3d060711e 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java @@ -45,10 +45,20 @@ import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; * @ConQAT.Rating GREEN Hash: 74906795F7A3AA1D94476D9B0538052C */ public interface IPersistencyService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IPersistencyService INSTANCE = new PersistencyService(); + /** Returns the service instance. */ + public static IPersistencyService getInstance() { + return INSTANCE; + } + /** * Returns the list of top level {@link ITopLevelElement}s provided by {@link IStorageProvider} * s. All storage providers are requested to load diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java index 398927564..cd9ce0692 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java @@ -42,10 +42,20 @@ import org.fortiss.tooling.kernel.internal.PrototypeService; * @ConQAT.Rating GREEN Hash: 1C9772CADE247390A9D85336F0747D74 */ public interface IPrototypeService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final IPrototypeService INSTANCE = new PrototypeService(); + /** Returns the service instance. */ + public static IPrototypeService getInstance() { + return INSTANCE; + } + /** Returns the list of all registered prototype providers. */ UnmodifiableList<IPrototypeProvider> getPrototypeProviders(); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java index 48f0fdc71..e620528eb 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java @@ -39,10 +39,20 @@ import org.fortiss.tooling.kernel.internal.TransformationService; * @ConQAT.Rating GREEN Hash: 1A3F5C9BB18ACEB99A11FDC5321D3CA7 */ public interface ITransformationService { - - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ITransformationService INSTANCE = new TransformationService(); + /** Returns the service instance. */ + public static ITransformationService getInstance() { + return INSTANCE; + } + /** * Determines if there is a transformation provider, which can perform the * transformation of the given source element into the given target element. diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java index 238ed688a..94b2adcd7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java @@ -44,9 +44,20 @@ import org.fortiss.tooling.kernel.service.listener.ITutorialServiceListener; * @ConQAT.Rating RED Hash: */ public interface ITutorialService extends ITutorialWhitelistProvider { - /** Returns the singleton instance of the service. */ + /** + * Returns the singleton instance of the service. + * + * @deprecated + * use {@link #getInstance()} instead + */ + @Deprecated public static final ITutorialService INSTANCE = new TutorialService(); + /** Returns the service instance. */ + public static ITutorialService getInstance() { + return INSTANCE; + } + /** Returns whether any tutorial is currently enabled. */ public boolean isTutorialActive(); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java index 56a5518cc..c29ad98b9 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/KernelModelElementUtils.java @@ -88,7 +88,7 @@ public final class KernelModelElementUtils { * @return root of the given element. */ private static <T extends IProjectRootElement> EObject getRootElementContainer(EObject element) { - ITopLevelElement topelement = IPersistencyService.INSTANCE.getTopLevelElementFor(element); + ITopLevelElement topelement = IPersistencyService.getInstance().getTopLevelElementFor(element); EObject root; if(topelement == null) { @@ -169,7 +169,7 @@ public final class KernelModelElementUtils { * @return the referenced element or <code>null</code>. */ public static EObject findReferencedElement(IIdLabeledReference reference) { - return findElementById(reference.getIdReference(), IPersistencyService.INSTANCE + return findElementById(reference.getIdReference(), IPersistencyService.getInstance() .getTopLevelElementFor(reference).getRootModelElement()); } @@ -379,7 +379,7 @@ public final class KernelModelElementUtils { * the command to be executed. */ public static void runAsCommand(EObject element, Runnable command) { - ICommandStackService.INSTANCE.runAsCommand(element, command); + ICommandStackService.getInstance().runAsCommand(element, command); } /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/PrototypesUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/PrototypesUtils.java index 6d467f569..1ebe59fb0 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/PrototypesUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/PrototypesUtils.java @@ -37,7 +37,7 @@ public class PrototypesUtils { public static Prototype findPrototypeComposableWith(Class<? extends EObject> modelElementType, String prototypeName) { List<Prototype> prototypes = - IPrototypeService.INSTANCE.getComposablePrototypes(modelElementType); + IPrototypeService.getInstance().getComposablePrototypes(modelElementType); for(Prototype prot : prototypes) { if(prot.getName().equals(prototypeName)) { return prot; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ResourceUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ResourceUtils.java index 1b8e230ea..0ea6ba8f7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ResourceUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ResourceUtils.java @@ -197,7 +197,7 @@ public final class ResourceUtils { * {@link Resource} with the specified {@link URI} ({@code null} if there is none). */ public static ITopLevelElement getTopLevelElement(URI uri) { - for(ITopLevelElement topLevelElement : IPersistencyService.INSTANCE.getTopLevelElements()) { + for(ITopLevelElement topLevelElement : IPersistencyService.getInstance().getTopLevelElements()) { for(Resource resource : topLevelElement.getResourceSet().getResources()) { if(resource.getURI().equals(uri)) { return topLevelElement; @@ -291,7 +291,7 @@ public final class ResourceUtils { Resource resource = resourceSet.createResource(uri); final T newModel = (T)factory.create(EcoreUtils.getEClassForClass(clazz)); - ITopLevelElement modelContext = IPersistencyService.INSTANCE.getTopLevelElementFor(obj); + ITopLevelElement modelContext = IPersistencyService.getInstance().getTopLevelElementFor(obj); modelContext.runAsCommand(new Runnable() { @Override public void run() { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ServicesUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ServicesUtils.java index f03e83cfa..5ab0e8c55 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ServicesUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/ServicesUtils.java @@ -36,7 +36,7 @@ public class ServicesUtils { /** Proxy for {@link IConstraintCheckerService#performAllConstraintChecksRecursively(EObject)} */ public static List<IConstraintViolation<? extends EObject>> performAllConstraintChecksRecursively(EObject modelElement) { - return IConstraintCheckerService.INSTANCE + return IConstraintCheckerService.getInstance() .performAllConstraintChecksRecursively(modelElement); } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java index ca6c8d900..214d40603 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/TransformationUtils.java @@ -55,7 +55,7 @@ public final class TransformationUtils { final Class<T> targetClass, ITransformationContext context) throws ChainTransformationFailedException { List<TransformationProviderChain> chainList = - ITransformationService.INSTANCE.getTransformationProviderChain( + ITransformationService.getInstance().getTransformationProviderChain( sourceElement.getClass(), targetClass, context); ChainTransformationFailedException e = null; if(!chainList.isEmpty()) { @@ -154,7 +154,7 @@ public final class TransformationUtils { */ public static boolean canTransform(EObject sourceElement, Class<?> targetClass, ITransformationContext context) { - return ITransformationService.INSTANCE.canTransform(sourceElement, targetClass, context); + return ITransformationService.getInstance().canTransform(sourceElement, targetClass, context); } /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/UniqueIDUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/UniqueIDUtils.java index abdfba378..d3dcb0970 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/UniqueIDUtils.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/utils/UniqueIDUtils.java @@ -213,7 +213,7 @@ public class UniqueIDUtils { */ public static void prepareUniqueID(EObject element, EObject context) { if(element instanceof IIdLabeled) { - ITopLevelElement top = IPersistencyService.INSTANCE.getTopLevelElementFor(context); + ITopLevelElement top = IPersistencyService.getInstance().getTopLevelElementFor(context); if(top == null) { // Since we do not catch the max id, the id can be directly set as max id + 1 -- GitLab