Palette Entry Selection [message #1217997] |
Fri, 29 November 2013 04:46 |
Aditya Pavan Devisetty 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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02430 seconds