diff options
| author | Maxime PORHEL | 2014-03-26 13:53:22 +0000 |
|---|---|---|
| committer | Maxime PORHEL | 2014-03-28 14:22:48 +0000 |
| commit | 0788d2d83f6a5a7eba39f9233d21ca0d768b9f5c (patch) | |
| tree | 2e74c545267c5ee712f51b34bb1cad332e4a7328 | |
| parent | b6bcacd2043f6eac174854d959200140554de8b2 (diff) | |
| download | org.eclipse.sirius-0788d2d83f6a5a7eba39f9233d21ca0d768b9f5c.tar.gz org.eclipse.sirius-0788d2d83f6a5a7eba39f9233d21ca0d768b9f5c.tar.xz org.eclipse.sirius-0788d2d83f6a5a7eba39f9233d21ca0d768b9f5c.zip | |
[431390] Improve Refresh on opening preference management
The old DialectManager.setRefreshOnOpening() could have let a developer
think that he had the possibility to programmatically change this
behavior, but this was called directly on reaction to changes in the
preference page without any checks. The dialect manager was updated from
a preference change listener added during SiriusEditPlugin.start().
Furthermore this corresponds to UI behavior and preference.
The isRefreshActivatedOnRepresentationOpening() method has been moved to
DialectUIManager which directly call the preference service.
Bug: 431390
Change-Id: I0a4f23b244801c816d18323f1f957f64b7c1efb2
Signed-off-by: Maxime PORHEL <maxime.porhel@obeo.fr>
12 files changed, 64 insertions, 83 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/part/SequenceDiagramEditPart.java b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/part/SequenceDiagramEditPart.java index 8c6f04bc46..451f8d87ce 100644 --- a/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/part/SequenceDiagramEditPart.java +++ b/plugins/org.eclipse.sirius.diagram.sequence.ui/src/org/eclipse/sirius/diagram/sequence/ui/tool/internal/edit/part/SequenceDiagramEditPart.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -17,7 +17,6 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gef.EditPart; import org.eclipse.gef.EditPolicy; import org.eclipse.gmf.runtime.notation.View; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.session.ModelChangeTrigger; import org.eclipse.sirius.business.api.session.SessionEventBroker; import org.eclipse.sirius.diagram.sequence.business.internal.elements.ISequenceElementAccessor; @@ -43,6 +42,7 @@ import org.eclipse.sirius.diagram.ui.tools.api.properties.PropertiesService; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.ext.base.Options; import org.eclipse.sirius.tools.api.ui.property.IPropertiesProvider; +import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; @@ -62,7 +62,7 @@ public class SequenceDiagramEditPart extends DDiagramEditPart { private IDiagramCommandFactoryProvider previousProvider; private ModelChangeTrigger refreshLayout; - + private ModelChangeTrigger sequenceCanonicalSynchronizer; private ResourceSetListener refreshZorder = new ResourceSetListenerImpl() { @@ -145,7 +145,7 @@ public class SequenceDiagramEditPart extends DDiagramEditPart { * ordering to work. */ boolean autoRefresh = PropertiesService.getInstance().getPropertiesProvider().getProperty(IPropertiesProvider.KEY_AUTO_REFRESH); - boolean refreshOnOpen = DialectManager.INSTANCE.isRefreshActivatedOnRepresentationOpening(); + boolean refreshOnOpen = DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening(); getEditingDomain().getCommandStack().execute(new RefreshLayoutCommand(getEditingDomain(), getDiagramView(), autoRefresh || refreshOnOpen)); getEditingDomain().addResourceSetListener(semanticOrderingSynchronizer); getEditingDomain().addResourceSetListener(refreshZorder); @@ -153,11 +153,11 @@ public class SequenceDiagramEditPart extends DDiagramEditPart { Option<SessionEventBroker> broker = getSessionBroker(); if (broker.some()) { SessionEventBroker sessionEventBroker = broker.get(); - + Predicate<Notification> refreshLayoutScope = new RefreshLayoutScope(); refreshLayout = new RefreshLayoutTrigger(getDiagramView()); sessionEventBroker.addLocalTrigger(refreshLayoutScope, refreshLayout); - + Predicate<Notification> sequenceCanonicalSynchronizerLayoutScope = new SequenceCanonicalSynchronizerAdapterScope(); sequenceCanonicalSynchronizer = new SequenceCanonicalSynchronizerAdapter(); sessionEventBroker.addLocalTrigger(sequenceCanonicalSynchronizerLayoutScope, sequenceCanonicalSynchronizer); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java index 8d40bd7fcb..4f49fc3d7b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/internal/editor/DDiagramEditorImpl.java @@ -87,7 +87,6 @@ import org.eclipse.jface.util.LocalSelectionTransfer; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionListener; @@ -539,7 +538,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE keyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId())); keyHandler.put(/* CTRL + D */ - KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); + KeyStroke.getPressed((char) 0x4, 100, SWT.CTRL), getActionRegistry().getAction(ActionIds.ACTION_DELETE_FROM_MODEL)); } return keyHandler; } @@ -1080,9 +1079,9 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE @Override protected void setDocumentProvider(final IEditorInput input) { if (getSession() != null/* - * && (input instanceof IFileEditorInput || - * input instanceof URIEditorInput) - */) { + * && (input instanceof IFileEditorInput || + * input instanceof URIEditorInput) + */) { setDocumentProvider(DiagramUIPlugin.getPlugin().getDocumentProvider(getSession().getTransactionalEditingDomain())); } else { // super.setDocumentProvider(input); @@ -1452,7 +1451,7 @@ public class DDiagramEditorImpl extends SiriusDiagramEditor implements DDiagramE /* * Refresh diagram if needed. Must be done before that */ - if (DialectManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { + if (DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { launchRefresh(true); } diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html index b7ab8e5091..401e376e3b 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html @@ -230,7 +230,20 @@ </li> <li>and <code>isEnvironmentURI</code> which checks that the given resource has an - <code>environment</code> uri scheme. + <code>environment</code> uri scheme. + </li> + </ul> + </li> + <li>In + <code>org.eclipse.sirius.business.api.dialect.DialectManager</code> + <ul> + <li>the setter + <code>setRefreshActivatedOnRepresentationOpening(boolean)</code> has been removed as the refresh on opening should be managed from the corresponding preference + <code>org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING</code>. + </li> + <li> + <code>isRefreshActivatedOnRepresentationOpening()</code> has been moved into + <code>org.eclipse.sirius.ui.business.api.dialect.DialectUIManager</code> as it refers to an UI behavior. </li> </ul> </li> diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile index af966d0354..fcc2819f1d 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile @@ -67,7 +67,10 @@ h4. Changes in @org.eclipse.sirius@ * @org.eclipse.sirius.business.api.query.URIQuery.isSiriusEnvironmentURI@ has been replaced by ** @isSiriusCoreEnvironmentURI@ which checks that the given resource is the Sirius core Environment.xmi file. -** and @isEnvironmentURI@ which checks that the given resource has an @environment@ uri scheme. +** and @isEnvironmentURI@ which checks that the given resource has an @environment@ uri scheme. +* In @org.eclipse.sirius.business.api.dialect.DialectManager@ +** the setter @setRefreshActivatedOnRepresentationOpening(boolean)@ has been removed as the refresh on opening should be managed from the corresponding preference @org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING@. +** @isRefreshActivatedOnRepresentationOpening()@ has been moved into @org.eclipse.sirius.ui.business.api.dialect.DialectUIManager@ as it refers to an UI behavior. h4. Changes in @org.eclipse.sirius.ui@ diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java index f80c794464..4e74d0a409 100644 --- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java +++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/AbstractDTableEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -45,7 +45,6 @@ import org.eclipse.jface.viewers.TreeSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.window.Window; import org.eclipse.osgi.util.NLS; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; @@ -291,7 +290,7 @@ public abstract class AbstractDTableEditor extends AbstractDTreeEditor implement notify(PROP_TITLE); // Launch the refresh if needed - if (DialectManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { + if (DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { launchRefresh(); } diff --git a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java index 3bfecc6776..3ea5baebb4 100644 --- a/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java +++ b/plugins/org.eclipse.sirius.table.ui/src/org/eclipse/sirius/table/ui/tools/internal/editor/RefreshAtOpeningActivator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 THALES GLOBAL SERVICES. + * Copyright (c) 2011, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -12,13 +12,13 @@ package org.eclipse.sirius.table.ui.tools.internal.editor; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CompoundCommand; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.table.metamodel.table.DColumn; import org.eclipse.sirius.table.metamodel.table.DTable; import org.eclipse.sirius.table.ui.tools.internal.command.ChangeColumnWidthCommand; import org.eclipse.sirius.table.ui.tools.internal.editor.provider.DTableEditorUtil; import org.eclipse.sirius.table.ui.tools.internal.editor.utils.TreeColumnWidthQuery; +import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; @@ -105,7 +105,7 @@ public class RefreshAtOpeningActivator implements IPartListener { } private void refreshDTableModelFromTreeColumnWidth() { - if (DialectManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { + if (DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { CompoundCommand refreshDTableAtOpeningCmd = new CompoundCommand("refresh table model at opening"); TreeColumn[] treeColumns = tree.getColumns(); diff --git a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeEditor.java b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeEditor.java index efdb2b9443..c98f75ba40 100644 --- a/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeEditor.java +++ b/plugins/org.eclipse.sirius.tree.ui/src/org/eclipse/sirius/tree/ui/tools/internal/editor/DTreeEditor.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -40,7 +40,6 @@ import org.eclipse.jface.viewers.TreeSelection; import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.window.Window; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; @@ -57,6 +56,7 @@ import org.eclipse.sirius.tree.business.internal.refresh.DTreeElementSynchronize import org.eclipse.sirius.tree.ui.provider.TreeUIPlugin; import org.eclipse.sirius.tree.ui.tools.internal.command.EMFCommandFactoryUI; import org.eclipse.sirius.ui.business.api.descriptor.ComposedImageDescriptor; +import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.business.api.dialect.marker.TraceabilityMarkerNavigationProvider; import org.eclipse.sirius.ui.business.api.session.IEditingSession; import org.eclipse.sirius.ui.business.api.session.SessionEditorInput; @@ -195,7 +195,7 @@ public class DTreeEditor extends AbstractDTreeEditor implements org.eclipse.siri notify(PROP_TITLE); // Launch the refresh if needed - if (DialectManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { + if (DialectUIManager.INSTANCE.isRefreshActivatedOnRepresentationOpening()) { launchRefresh(true); } diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java index e9f83b3e58..05cd1594c0 100644 --- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java +++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/SiriusEditPlugin.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -42,12 +42,10 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.sirius.business.api.dialect.DialectManager; import org.eclipse.sirius.business.api.preferences.SiriusPreferencesKeys; import org.eclipse.sirius.common.tools.api.util.EclipseUtil; import org.eclipse.sirius.tools.api.command.ui.UICallBack; import org.eclipse.sirius.tools.api.preferences.DCorePreferences; -import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys; import org.eclipse.sirius.ui.business.internal.dialect.LogThroughActiveDialectEditorLogListener; import org.eclipse.sirius.ui.business.internal.session.GenericSWTCallBack; import org.eclipse.sirius.ui.business.internal.session.factory.UISessionFactoryDescriptorRegistryListener; @@ -249,18 +247,6 @@ public final class SiriusEditPlugin extends EMFPlugin { reflectPreferencesOnCore(key); } }); - /* should be in dialect ui, and not in the start stop of the plugin */ - getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - DialectManager.INSTANCE.setRefreshActivatedOnRepresentationOpening(getPreferenceStore().getBoolean(SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING.name())); - } - }); - /* - * FIXME DO NOT CALL DIALECTMANGER.INSTANCE in start or stop => - * should be in DialectUI init - */ - if (DialectManager.INSTANCE != null) - DialectManager.INSTANCE.setRefreshActivatedOnRepresentationOpening(getPreferenceStore().getBoolean(SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING.name())); } private void reflectAllPreferencesOnCore() { diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIManager.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIManager.java index e7b5282593..ebf184156a 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIManager.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/api/dialect/DialectUIManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -64,4 +64,13 @@ public interface DialectUIManager extends DialectUIServices { * <code>format<code>, false otherwise */ boolean canExport(DRepresentation representation, ExportFormat format); -} + + /** + * Returns <code>true</code> if the refresh should be done on representation + * opening. + * + * @return <code>true</code> if the refresh should be done on representation + * opening. + */ + boolean isRefreshActivatedOnRepresentationOpening(); +}
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java index c3f3f34471..23afb57070 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/DialectUIManagerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -33,6 +33,7 @@ import org.eclipse.sirius.ui.business.api.dialect.DialectEditor; import org.eclipse.sirius.ui.business.api.dialect.DialectUI; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.business.api.dialect.ExportFormat; +import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys; import org.eclipse.sirius.ui.tools.api.actions.export.SizeTooLargeException; import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DRepresentationElement; @@ -46,6 +47,7 @@ import org.eclipse.sirius.viewpoint.description.provider.DescriptionItemProvider import org.eclipse.sirius.viewpoint.description.style.provider.StyleItemProviderAdapterFactory; import org.eclipse.sirius.viewpoint.description.tool.provider.ToolItemProviderAdapterFactory; import org.eclipse.sirius.viewpoint.description.validation.provider.ValidationItemProviderAdapterFactory; +import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; import org.eclipse.sirius.viewpoint.provider.ViewpointItemProviderAdapterFactory; import org.eclipse.ui.IEditorPart; @@ -406,4 +408,13 @@ public class DialectUIManagerImpl implements DialectUIManager { } return toolTip; } + + /** + * {@inheritDoc} + * + * @see org.eclipse.sirius.ui.business.api.dialect.DialectUIManager#isRefreshActivatedOnRepresentationOpening() + */ + public boolean isRefreshActivatedOnRepresentationOpening() { + return SiriusEditPlugin.getPlugin().getPreferenceStore().getBoolean(SiriusUIPreferencesKeys.PREF_REFRESH_ON_REPRESENTATION_OPENING.name()); + } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java index fcdf896382..8f034404d8 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/dialect/DialectManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -49,23 +49,4 @@ public interface DialectManager extends DialectServices { * dialect to disable. */ void disableDialect(Dialect dialect); - - /** - * Returns <code>true</code> if the refresh should be done on representation - * opening. - * - * @return <code>true</code> if the refresh should be done on representation - * opening. - */ - boolean isRefreshActivatedOnRepresentationOpening(); - - /** - * Sets if the the refresh should be done on representation opening. - * - * @param activated - * <code>true</code> if the refresh should be done on - * representation opening. - */ - void setRefreshActivatedOnRepresentationOpening(final boolean activated); - -} +}
\ No newline at end of file diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java index e7a28edd2d..e201086a2f 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/dialect/DialectManagerImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2014 THALES GLOBAL SERVICES and others. * 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 @@ -55,8 +55,6 @@ public class DialectManagerImpl implements DialectManager { Map<String, Dialect> dialects = new HashMap<String, Dialect>(); - private boolean refreshOnDiagramOpening; - /** * Init a default manager implementation. * @@ -351,24 +349,6 @@ public class DialectManagerImpl implements DialectManager { /** * {@inheritDoc} * - * @see org.eclipse.sirius.business.api.dialect.DialectManager#isRefreshActivatedOnRepresentationOpening() - */ - public boolean isRefreshActivatedOnRepresentationOpening() { - return this.refreshOnDiagramOpening; - } - - /** - * {@inheritDoc} - * - * @see org.eclipse.sirius.business.api.dialect.DialectManager#setRefreshActivatedOnRepresentationOpening(boolean) - */ - public void setRefreshActivatedOnRepresentationOpening(final boolean activated) { - this.refreshOnDiagramOpening = activated; - } - - /** - * {@inheritDoc} - * * @see org.eclipse.sirius.business.api.dialect.DialectServices#canCreateIdentifier(org.eclipse.emf.ecore.EObject) */ public boolean canCreateIdentifier(final EObject representationElement) { |
