Skip to content

Commit

Permalink
[341] Adapt to recent GEF Classic changes
Browse files Browse the repository at this point in the history
Bug: #341
Signed-off-by: Pierre-Charles David <[email protected]>
  • Loading branch information
pcdavid committed Aug 23, 2024
1 parent 3a1f816 commit cda18c1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2021 THALES GLOBAL SERVICES.
* Copyright (c) 2010, 2024 THALES GLOBAL SERVICES.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -200,7 +200,7 @@ public static void registerDiagramElement(IGraphicalEditPart self, EObject eleme
* the key of the registry entry to remove.
*/
public static void unregisterDiagramElement(IGraphicalEditPart self, EObject element) {
Map<Object, Object> registry = self.getViewer().getEditPartRegistry();
Map<?, ?> registry = self.getViewer().getEditPartRegistry();
if (registry.get(element) == self) {
registry.remove(element);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ private Command arrangeSeveralCreatedViews(List<IAdaptable> createdViewsAdapters
}
}
if (borderedCreatedViews != null && borderedCreatedViews.size() > 0) {
Map<View, EditPart> editPartRegistry = host.getRoot().getViewer().getEditPartRegistry();
Map<Object, EditPart> editPartRegistry = host.getRoot().getViewer().getEditPartRegistry();

List<EditPart> editPartToLayout = borderedCreatedViews.stream() //
.map(adaptable -> adaptable.getAdapter(View.class)) //
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2007, 2021, 2023 THALES GLOBAL SERVICES and others.
* Copyright (c) 2007, 2024 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -413,7 +413,7 @@ private static int getLineWidth(final DEdge edge) {
private static Point getPointFor(final EdgeTarget edgeTarget, final IDiagramEdgeEditPart self) {
// Retrieve the view.
View view = null;
final Map<View, EditPart> editPartRegistry = self.getRoot().getViewer().getEditPartRegistry();
final Map<Object, EditPart> editPartRegistry = self.getRoot().getViewer().getEditPartRegistry();

for (final View currentView : DiagramEdgeEditPartOperation.getViews(edgeTarget, self)) {
if (currentView.isVisible()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018 THALES GLOBAL SERVICES and others.
* Copyright (c) 2018, 2024 THALES GLOBAL SERVICES and others.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -36,7 +36,15 @@ public SiriusRulerEditPartFactory(GraphicalViewer primaryViewer) {
}

@Override
protected EditPart createRulerEditPart(EditPart parentEditPart, Object model) {
return new SiriusRulerEditPart(model);
public EditPart createEditPart(EditPart parentEditPart, Object model) {
// the model can be null when the contents of the root edit part are set
// to null
EditPart part = null;
if (isRuler(model)) {
part = new SiriusRulerEditPart(model);
} else if (model != null) {
part = new GuideEditPart(model);
}
return part;
}
}

0 comments on commit cda18c1

Please sign in to comment.