Skip to content

Commit

Permalink
[2099] Adapt the Capella code to the removing of refresh() operation.
Browse files Browse the repository at this point in the history
Bug: 2099
Change-Id: I081404d313fb46d56b1c92c023cf507d09e05767
Signed-off-by: Florian Barbin <florian.barbin@obeo.fr>
  • Loading branch information
florianbarbin authored and pdulth committed Jun 13, 2018
1 parent 11f7a92 commit 617223b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2016 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -797,7 +797,7 @@ private boolean process(DDiagram object) {
new EmbeddedMessage(NLS.bind("Edges on diagram ''{0}'' have recovered default color.", object.getName()), IReportManagerDefaultComponents.UI, //$NON-NLS-1$
object));
try {
object.refresh();
DialectManager.INSTANCE.refresh(object, new NullProgressMonitor());
} catch (Exception exceptionP) {
getLogger().warn(
new EmbeddedMessage(NLS.bind("An error occured while refreshing diagram ''{0}''.", object.getName()), IReportManagerDefaultComponents.UI, //$NON-NLS-1$
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -15,6 +15,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.notation.Diagram;
Expand All @@ -23,6 +24,7 @@
import org.eclipse.gmf.runtime.notation.Location;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.DDiagramElement;
import org.eclipse.sirius.diagram.tools.api.layout.PinHelper;
Expand Down Expand Up @@ -152,7 +154,9 @@ protected void refresh(Collection<? extends Node> roots) {
if (diagElement instanceof DDiagram)
diagram = (DDiagram)diagElement;
}
if (diagram != null) diagram.refresh();
if (diagram != null) {
DialectManager.INSTANCE.refresh(diagram, new NullProgressMonitor());
}
}

/**
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2006, 2014 THALES GLOBAL SERVICES.
* Copyright (c) 2006, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -17,6 +17,7 @@
import java.util.List;
import java.util.Set;

import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature.Setting;
import org.eclipse.emf.ecore.util.ECrossReferenceAdapter;
Expand All @@ -32,6 +33,7 @@
import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.sirius.business.api.dialect.DialectManager;
import org.eclipse.sirius.common.tools.api.util.TreeItemWrapper;
import org.eclipse.sirius.common.ui.tools.api.selection.EObjectSelectionWizard;
import org.eclipse.sirius.diagram.ui.graphical.edit.policies.AbstractSiriusEditPolicy;
Expand Down Expand Up @@ -121,7 +123,7 @@ public void execute() {
new ICommandProxy(new GMFCommandWrapper(getEditingDomain(), new RecordingCommand(getEditingDomain()) {
@Override
protected void doExecute() {
getSirius().refresh();
DialectManager.INSTANCE.refresh(getSirius(), new NullProgressMonitor());
}
})).execute();
// Do not call RefreshDiagramCommand anymore since Sirius 4.18.
Expand Down
Expand Up @@ -37,6 +37,7 @@
import org.eclipse.sirius.diagram.description.EdgeMapping;
import org.eclipse.sirius.diagram.description.style.BorderedStyleDescription;
import org.eclipse.sirius.diagram.description.style.EdgeStyleDescription;
import org.eclipse.sirius.diagram.tools.api.command.view.RefreshSiriusElement;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.RGBValues;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
Expand Down Expand Up @@ -342,7 +343,7 @@ public void updateFunctionalChainStyles(DDiagram diagram) {
incompleteFC.add(me.getKey());
}
}
me.getValue().refresh();
RefreshSiriusElement.refresh(me.getValue());
}

// destroy old internal links
Expand Down
Expand Up @@ -21,10 +21,8 @@
import java.util.Map.Entry;
import java.util.Set;

import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.sirius.diagram.AbstractDNode;
import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.DDiagramElement;
Expand All @@ -41,6 +39,7 @@
import org.eclipse.sirius.diagram.description.EdgeMapping;
import org.eclipse.sirius.diagram.description.NodeMapping;
import org.eclipse.sirius.diagram.description.style.EdgeStyleDescription;
import org.eclipse.sirius.diagram.tools.api.command.view.RefreshSiriusElement;
import org.eclipse.sirius.viewpoint.DSemanticDecorator;
import org.eclipse.sirius.viewpoint.RGBValues;
import org.eclipse.sirius.viewpoint.SiriusPlugin;
Expand Down Expand Up @@ -826,7 +825,7 @@ public void updatePhysicalPathStyles(DDiagram diagram) {
}
}
}
me.getValue().refresh();
RefreshSiriusElement.refresh(me.getValue());
}

// Destroy old internal links
Expand Down

0 comments on commit 617223b

Please sign in to comment.