|
|
|
|
|
|
|
|
Re: Adding menu options when I right click on my diagram [message #1841509 is a reply to message #1841497] |
Wed, 19 May 2021 14:27 |
Thomas Chiang Messages: 106 Registered: March 2020 |
Senior Member |
|
|
Ok if that's the case I think my question is how do I actually get to that class? I've been trying to work based off of what has been discussed in this post but I don't really understand how they specified the context for which they want to run their java calls.
https://www.eclipse.org/forums/index.php/t/1089628/
In my canExecute() method I have a simple check to make sure that I can't access the java call if I right click on the blank space in the diagram:
public boolean canExecute(Collection<? extends EObject> arg0) {
// TODO Auto-generated method stub
Iterator it = arg0.iterator();
while (it.hasNext()) {
EObject next = (EObject) it.next();
if (next.eClass().getName().contentEquals("DSemanticDiagram")){
//System.out.println("Object name is " + next.eClass().getName());
return false;
}
}
return true;
}
Ultimately I aim trying to further specify what my call can run on based on what type of class it is based upon what I have specified in my metamodel. And then later on when I want to specify the execute() method I will need to be able to check what model elements I am working on so that I can perform different actions on them like changing colors, sizes, deletion/creation etc.
[Updated on: Wed, 19 May 2021 15:09] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03624 seconds