Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Preform Routing Style Action(How should I call the Routing Style Action within an other action?)
Preform Routing Style Action [message #1098019] Fri, 30 August 2013 09:33 Go to next message
Eclipse UserFriend
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)
                ???
				
            }
            ...
        }
    ...

Re: Preform Routing Style Action [message #1110744 is a reply to message #1098019] Tue, 17 September 2013 05:25 Go to previous message
Eclipse UserFriend
Hi,

maybe this can help you http://publib.boulder.ibm.com/infocenter/rsmhelp/v7r0m0/topic/org.eclipse.gmf.doc/tutorials/diagram/automaticLayout.html

Ralph

[Updated on: Tue, 17 September 2013 07:19] by Moderator

Previous Topic:Multiple GMF Editors out of one Ecore-Model
Next Topic:create diagram from .ecore file by GMF
Goto Forum:
  


Current Time: Fri Jul 04 20:32:44 EDT 2025

Powered by FUDForum. Page generated in 0.03834 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top