[GMF] Read attribute of current selected node in canvas [message #759156] |
Sun, 27 November 2011 02:45 |
Snakebyte Missing name Messages: 130 Registered: November 2011 |
Senior Member |
|
|
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;
}
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
[Updated on: Sun, 27 November 2011 15:48] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03988 seconds