Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Combined Selection and ConnectionCreationToolEntry
Combined Selection and ConnectionCreationToolEntry [message #987649] Tue, 27 November 2012 07:31
Bastian Schumacher is currently offline Bastian Schumacher
Messages: 1
Registered: November 2012
Junior Member
Hello,
I am currently working on an Eclipse GEF Plugin. There are Nodes that can be moved and resized using an SelectionToolEntry, and can be Connected Using a ConnectionCreationToolEntry. Since the areas with one tool can interact with are distinct from the areas the other tool can interact with, i'd like to combine these tools to one. One witch is capable of selecting and resizing nodes and create connections between them.

Here is what I got:
SelectionToolEntry selection = new SelectionToolEntry();
mainPalette.add(selection);
setDefaultEntry(selection);
        
ConnectionCreationToolEntry connectionCreation =
    new ConnectionCreationToolEntry("Connect", 
    "Connect 2 Nodes", new CreationFactory()
    {
        @Override
        public Object getObjectType()
        {
            return NodeConnection.class;
        }
    
        @Override
        public Object getNewObject()
        {
            return new NodeConnection();
        }
    }, null, null);
mainPalette.add(connectionCreation);


And this is what I'd like to get
SelectionAndConnectionCreationToolEntry editToolEntry =
    new SelectionAndConnectionCreationToolEntry("Edit", 
    "Connect 2 Actions", new CreationFactory()
    {
        @Override
        public Object getObjectType()
        {
            return NodeConnection.class;
        }
    
        @Override
        public Object getNewObject()
        {
            return new NodeConnection();
        }
    }, null, null);
mainPalette.add(editToolEntry);
setDefaultEntry(editToolEntry);


Is there a Better way then to create my own ToolEntry and my Own TargetingTool?

Thanks in advance,
Bastian Schumacher
Previous Topic:[Zest] Combining LayoutStyles and ZestStyles
Next Topic:[Zest] Arcs on top of nodes
Goto Forum:
  


Current Time: Sun Apr 20 22:58:58 EDT 2014

Powered by FUDForum. Page generated in 0.01553 seconds