From affc638f030129e887837f8594f43a5edb540807 Mon Sep 17 00:00:00 2001 From: atischenko Date: Tue, 13 Oct 2015 21:41:33 +0300 Subject: Bug 450921 - Additional graphics no longer available Change-Id: I84c544e1cae02a835d29494740d2ce4a1665d98c Signed-off-by: atischenko --- .../infra/gmfdiag/common/commands/CreateViewCommand.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins') diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java index 23621256dd4..12b463c5622 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/commands/CreateViewCommand.java @@ -39,6 +39,20 @@ public class CreateViewCommand extends CreateCommand { @Override public boolean canExecute() { + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=450921 + // it should be possible to create not only elements with semantic + // like oval or note + int hint; + try { + hint = Integer.parseInt(viewDescriptor.getSemanticHint()); + } catch(Exception e) { + hint = -1; + } + + if (hint == -1) { + return super.canExecute(); + } + // Warning the element adapter can possibly be null (see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=353129) if (viewDescriptor.getElementAdapter() == null) { return false; -- cgit v1.2.3