| Preform Routing Style Action [message #1098019] |
Fri, 30 August 2013 09:33  |
svdwoude V Messages: 1 Registered: August 2013 |
Junior Member |
|
|
Hi,
I made a new "Group Generalization" Action which basically should set the routing style for the selected generalizations (ConnectorImpl figure) to "Tree Style Routing" along with some other stuff that is irrelevant to this post.
How can I call the right RouterAction command/method/request to preform a tree style routing on the collection of selected Generalizations? I tried to just set the router for each GeneralizationEditPart, but get "Cannot modify resource set without a write transaction" errors. So I'm guessing only the proper commands will do the trick.
Thanks!
Below a code snippet of the aforementioned "Group Generalization" Action class:
public class GeneralizationTypeAction implements IObjectActionDelegate {
private Shell shell;
private ArrayList<GeneralizationEditPart> selectedElements;
/**
* Constructor for Action.
*/
public GeneralizationTypeAction() {
super();
}
/**
* @see IObjectActionDelegate#setActivePart(IAction, IWorkbenchPart)
*/
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
shell = targetPart.getSite().getShell();
}
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
String menu = action.getId();
if(menu.equals("UML_ER_tool.GroupGeneralization")){
// Check if one of the Generalizations is already part of a Group
...
// Create Generalization Category
...
for (GeneralizationEditPart element : selectedElements) {
GeneralizationImpl gen = (GeneralizationImpl)((View)element.getModel()).getElement();
// Set Generalization Category in selected Generalizations
...
// Set Tree Routing for selected GeneralizationImpl (= ConnectorImpl)
???
}
...
}
...
|
|
|
|
Powered by
FUDForum. Page generated in 0.11232 seconds