Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Expression Label For Element
Expression Label For Element [message #1123364] Wed, 02 October 2013 09:43 Go to next message
serhat gezgin is currently offline serhat gezgin
Messages: 236
Registered: January 2013
Location: Izmir
Senior Member

Hi all,

İ create expression label for element like;

"('').concat(if self.oclAsType(UIFieldElement).contentField.oclAsType(content::NamedElement) = null then self.name else self.contentField.oclAsType(content::NamedElement).name endif)";



but when i change contentField releation this expression always give me ;

" Caused by: org.eclipse.ocl.SemanticException: Unrecognized variable: (contentField) "

error. Can anyone help me to recognize this ? regars;

Error;

org.eclipse.core.commands.ExecutionException: While executing the operation, an exception occurred
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:521)
	at org.eclipse.gmf.runtime.emf.ui.properties.sections.UndoableModelPropertySheetEntry.executeValueChangedCommand(UndoableModelPropertySheetEntry.java:273)
	at org.eclipse.gmf.runtime.emf.ui.properties.sections.UndoableModelPropertySheetEntry.setValue(UndoableModelPropertySheetEntry.java:202)
	at org.eclipse.gmf.runtime.emf.ui.properties.sections.UndoableModelPropertySheetEntry.applyEditorValue(UndoableModelPropertySheetEntry.java:130)
	at org.eclipse.jface.viewers.CellEditor$1.run(CellEditor.java:335)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.CellEditor.fireApplyEditorValue(CellEditor.java:333)
	at org.eclipse.jface.viewers.ComboBoxCellEditor.applyEditorValueAndDeactivate(ComboBoxCellEditor.java:273)
	at org.eclipse.jface.viewers.ComboBoxCellEditor.focusLost(ComboBoxCellEditor.java:284)
	at org.eclipse.jface.viewers.ComboBoxCellEditor$4.focusLost(ComboBoxCellEditor.java:170)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:143)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:778)
	at org.eclipse.swt.custom.CCombo.handleFocus(CCombo.java:900)
	at org.eclipse.swt.custom.CCombo$2.handleEvent(CCombo.java:147)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1056)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2842)
	at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2421)
	at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:5235)
	at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:457)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4681)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4977)
	at org.eclipse.swt.internal.win32.OS.SetFocus(Native Method)
	at org.eclipse.swt.widgets.Control.forceFocus(Control.java:1098)
	at org.eclipse.swt.widgets.Control.setFocus(Control.java:3323)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1042)
	at org.eclipse.swt.widgets.Composite.setFocus(Composite.java:1040)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.setFocus(DiagramEditorWithFlyOutPalette.java:312)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.delegateSetFocus(CompatibilityPart.java:192)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:243)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:249)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:220)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:107)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.focusGui(PartRenderingEngine.java:763)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:592)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:539)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:104)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:59)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1081)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1453)
	at org.eclipse.swt.widgets.Shell.WM_MOUSEACTIVATE(Shell.java:2334)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4655)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1627)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
	at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java:80)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4706)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:340)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4990)
	at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:3141)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.RuntimeException: org.eclipse.ocl.SemanticException: Unrecognized variable: (contentField)
	at org.eclipse.gmf.tooling.runtime.impl.ocl.tracker.activeocl.ActiveOclTracker.doInitialize(ActiveOclTracker.java:88)
	at org.eclipse.gmf.tooling.runtime.ocl.tracker.OclTrackerBase.initialize(OclTrackerBase.java:24)
	at org.eclipse.gmf.tooling.runtime.parsers.OclTrackerWrapper.getUpdatedString(OclTrackerWrapper.java:28)
	at org.eclipse.gmf.tooling.runtime.parsers.ExpressionLabelParserBase.getPrintString(ExpressionLabelParserBase.java:37)
	at com.mdd4cca.msf.form.diagram.edit.parts.TextInputName2EditPart.getLabelText(TextInputName2EditPart.java:220)
	at com.mdd4cca.msf.form.diagram.edit.parts.TextInputName2EditPart.refreshLabel(TextInputName2EditPart.java:424)
	at com.mdd4cca.msf.form.diagram.edit.parts.TextInputName2EditPart.handleNotificationEvent(TextInputName2EditPart.java:628)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.notifyChanged(GraphicalEditPart.java:1438)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.fireNotification(DiagramEventBroker.java:504)
	at org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker.resourceSetChanged(DiagramEventBroker.java:399)
	at org.eclipse.gmf.runtime.diagram.ui.DiagramEventBrokerThreadSafe.resourceSetChanged(DiagramEventBrokerThreadSafe.java:73)
	at org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory$DiagramEditingDomain.postcommit(DiagramEditingDomainFactory.java:214)
	at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.deactivate(TransactionalEditingDomainImpl.java:543)
	at org.eclipse.emf.transaction.impl.TransactionImpl.close(TransactionImpl.java:712)
	at org.eclipse.emf.transaction.impl.TransactionImpl.commit(TransactionImpl.java:474)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:155)
	at org.eclipse.core.commands.operations.TriggeredOperations.execute(TriggeredOperations.java:166)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	... 154 more
Caused by: org.eclipse.ocl.SemanticException: Unrecognized variable: (contentField)
	at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:358)
	at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:328)
	at org.eclipse.ocl.internal.helper.HelperUtil.checkForErrors(HelperUtil.java:518)
	at org.eclipse.ocl.internal.helper.HelperUtil.parseQuery(HelperUtil.java:165)
	at org.eclipse.ocl.internal.helper.OCLHelperImpl.createQuery(OCLHelperImpl.java:176)
	at org.eclipse.ocl.ecore.OCLHelperImpl.createQuery(OCLHelperImpl.java:90)
	at org.eclipse.gmf.tooling.runtime.impl.ocl.tracker.activeocl.DependencyEvaluator.<init>(DependencyEvaluator.java:23)
	at org.eclipse.gmf.tooling.runtime.impl.ocl.tracker.activeocl.ActiveOclEvaluatorImpl.evaluate(ActiveOclEvaluatorImpl.java:16)
	at org.eclipse.gmf.tooling.runtime.impl.ocl.tracker.activeocl.ActiveOclTracker.doInitialize(ActiveOclTracker.java:86)
	... 171 more

Re: Expression Label For Element [message #1128207 is a reply to message #1123364] Mon, 07 October 2013 08:58 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

this error tells you that contentField cannot be found in your semantic model.

Ralph
Previous Topic:Add a button (button-menu) to the GMF toolbar
Next Topic:GMF customization with EEF
Goto Forum:
  


Current Time: Mon Jul 28 10:43:05 EDT 2014

Powered by FUDForum. Page generated in 0.03405 seconds