Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:33 Go to next message
svdwoude V is currently offline svdwoude VFriend
Messages: 3
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)
                ???
				
            }
            ...
        }
    ...

Re: Preform Routing Style Action [message #1110744 is a reply to message #1098019] Tue, 17 September 2013 09:25 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
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 11:19]

Report message to a moderator

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


Current Time: Wed Apr 24 15:56:16 GMT 2024

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

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

Back to the top