|
Re: [EMFatic] Read attribute of current selected node in canvas [message #760158 is a reply to message #760142] |
Thu, 01 December 2011 13:49 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
It's hard to tell, but I think this is a GMF question.
On 01/12/2011 2:31 PM, Snakebyte wrote:
> Suppose i got the following model :
> (its an eugenia model)
>
>
> @namespace(uri="trustcasemodel", prefix="trustcasemodel")
> @gmf(foo="bar")
> package trustCase;
>
> @gmf.diagram(onefile="false")
> class TrustCase {
> attr String path;
> val Claim[*] valclaims;
> val Fact[*] facts;
> }
> @gmf.node(foo="bar")
> class Claim {
> attr String path;
> }
> @gmf.node(foo="bar")
> class Fact {
> attr String path;
> }
>
>
> Creating a gmf Editor out of it with Eugenia.
>
> Now i have a new Plugin adding an action to the top menu bar.
> This Plugin should now read the "path" variable from the current
> selected Node in canvas.
> Whats the code for that ?
>
> I simply want to open the file shown by path.
>
> If that doesn't work, can i do it by double click on a node ?
>
> I'm really frustrated an that.
> I only need the option to make a systemcall on the mentioned path.
> It's not really important which action triggers that call.....
> Anybody got an idea ?
>
> How can i get a specific known attribute ("path") from a selected node
> in canvas ?
>
> With
>
>
> ( EditPart part =
> ((EditPart)((IStructuredSelection)HandlerUtil.getCurrentSelection(event)).getFirstElement());
>
>
> i get the currently selected node in canvas.
> This is a ClaimEditPart or a FactEditPart.
>
> How can i get the path-attribute from that EditPart ?
>
> If i want to cast the EditPart to a specific xxxEditPart.java like that
>
>
> FactEditPart editpart = (FactEditPart) part;
> editpart.resolveSemanticElement();
>
>
> i always got the following error :
>
> java.lang.NoClassDefFoundError: trustCase/diagram/edit/parts/FactEditPart
>
> How can i fix this ?
>
> Greeting
> Snakebyte
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03448 seconds