diff options
author | Vincent Lorenzo | 2018-05-24 08:38:23 +0000 |
---|---|---|
committer | vincent lorenzo | 2018-05-24 15:03:57 +0000 |
commit | bfd26632a7557afd865d2184d26661d57154749f (patch) | |
tree | 0245555ff66050315c245c12ddfd70936c9c33b1 | |
parent | 1037d7f15d0cdec50f5ca59ab7208f9cb886f8d5 (diff) | |
download | org.eclipse.papyrus-bfd26632a7557afd865d2184d26661d57154749f.tar.gz org.eclipse.papyrus-bfd26632a7557afd865d2184d26661d57154749f.tar.xz org.eclipse.papyrus-bfd26632a7557afd865d2184d26661d57154749f.zip |
Bug 535055: [Widget][RichText] the additional buttons for dictionnary and reference UML Element doesn't work
Change-Id: I8efa7449a6e6b5a359605d7ca78bf8eca47029ff
Signed-off-by: Vincent Lorenzo <vincent.lorenzo@cea.fr>
3 files changed, 17 insertions, 8 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/GenericRichTextEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/GenericRichTextEditor.java index e220d2aa25b..9935d6728f2 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/GenericRichTextEditor.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/GenericRichTextEditor.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2016, 2017 CEA LIST and others. + * Copyright (c) 2016, 2017, 2018 CEA LIST and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -9,6 +9,7 @@ * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 522485 + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 535055 *****************************************************************************/ package org.eclipse.papyrus.infra.widgets.editors.richtext; @@ -115,7 +116,8 @@ public class GenericRichTextEditor extends RichTextEditor { */ public GenericRichTextEditor(Composite parent, GenericToolbarConfiguration toolbarConfig, int style) { super(parent, toolbarConfig, style); - toolbarConfig.setRichTextEditor(this); + toolbarConfig.setBrowser(getEditorConfiguration().getBrowser()); + toolbarConfig.setRichTextEditor(this); } /** diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/SpellCheckToolbarButton.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/SpellCheckToolbarButton.java index bdac667c881..4000e451263 100644 --- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/SpellCheckToolbarButton.java +++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/richtext/SpellCheckToolbarButton.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2013 CEA + * Copyright (c) 2013, 2018 CEA * * * All rights reserved. This program and the accompanying materials @@ -9,7 +9,7 @@ * * Contributors: * Soyatec - Initial API and implementation - * + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 535055 *****************************************************************************/ package org.eclipse.papyrus.infra.widgets.editors.richtext; @@ -64,10 +64,13 @@ public class SpellCheckToolbarButton extends AbstractToolbarButton { */ @Override public Object execute() { - if (richTextEditor != null) { + if(null==this.richTextEditor) { + Activator.log.warn("The action can't be executed, because the richtext editor has not bee registered for this action");// $NON-NLS-1$ + } + if (this.richTextEditor != null) { try { - dialog = createCheckSpellDialog(); - dialog.open(); + this.dialog = createCheckSpellDialog(); + this.dialog.open(); } catch (Exception e) { Activator.log.error(e); } diff --git a/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/editors/InsertReferenceToolbarButton.java b/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/editors/InsertReferenceToolbarButton.java index 8139307c4bc..b2648cf71b9 100644 --- a/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/editors/InsertReferenceToolbarButton.java +++ b/plugins/uml/org.eclipse.papyrus.uml.ui/src/org/eclipse/papyrus/uml/ui/editors/InsertReferenceToolbarButton.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2016 CEA LIST and others. + * Copyright (c) 2016, 2018 CEA LIST and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 535055 *****************************************************************************/ package org.eclipse.papyrus.uml.ui.editors; @@ -72,6 +73,9 @@ public class InsertReferenceToolbarButton extends AbstractToolbarButton { */ @Override public Object execute() { + if(null==this.richTextEditor) { + Activator.log.warn("The insert references action cannot be executed, because the Richtext editor has not be registered for this action");//$NON-NLS-1$ + }else if (!(this.richTextEditor instanceof UMLRichtextEditorWithReferences)) { Activator.log.warn("The insert references action cannot be executed, because the Richtext editor is not a UMLRichtextEditorWithReferences");//$NON-NLS-1$ } else { |