Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Palette Entry Selection
Palette Entry Selection [message #1217997] Fri, 29 November 2013 04:46 Go to next message
Aditya Pavan Devisetty is currently offline Aditya Pavan DevisettyFriend
Messages: 14
Registered: August 2013
Junior Member
Hi,

I'm new to GEF and I'm digging the GEF tutorials that are available. I displayed some components/items on palette, all of type class Module(Module.class) with different names.Then how would I know the particular component/item of palette is selected by user, so that I create a Draw2D figure of that component/item on design tab of editor. Here is the code , how I added entires to the palette.

protected PaletteRoot getPaletteRoot() {
PaletteRoot root = new PaletteRoot();
PaletteGroup manipGroup = new PaletteGroup("Manipulation d'objets");
root.add(manipGroup);

SelectionToolEntry selectionToolEntry = new SelectionToolEntry();
manipGroup.add(selectionToolEntry);
manipGroup.add(new MarqueeToolEntry());
root.setDefaultEntry(selectionToolEntry);

PaletteSeparator sep1 = new PaletteSeparator();
root.add(sep2);

PaletteGroup instGroup = new PaletteGroup("Creation d'elemnts");
root.add(instGroup);

PaletteSeparator sep2 = new PaletteSeparator();
instGroup.add(sep2);

Map listofinterfaces=TestCommand.getModules();
Set<String> interfacesname=listofinterfaces.keySet();
Iterator<String> it= interfacesname.iterator();
ArrayList<String> names=new ArrayList<String>();
while(it.hasNext()){
names.add(it.next());
}
...
...
for(String Ninterface:names){
instGroup.add(new CreationToolEntry(Ninterface, "Creation of Component",new NodeCreationFactory(Module.class),null, null));
}
root.setDefaultEntry(selectionToolEntry);
pr=root;
return root;
}


I created a Draw2D figure of component/item on palette of different type of classes,but here my test case is of type same class.
Re: Palette Entry Selection [message #1220333 is a reply to message #1217997] Wed, 11 December 2013 07:38 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi, what is the problem?
Previous Topic:[Zest] EMF, adapters and Zest graph
Next Topic:Save gef diagram or view as xml file
Goto Forum:
  


Current Time: Thu Dec 18 17:38:14 GMT 2014

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

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