root.add(group);
}
viewer.setPaletteRoot(root);
viewer.addPaletteListener(new PaletteListener(){
public void activeToolChanged(PaletteViewer palette, ToolEntry tool){
ToolEntryEditPart part = (ToolEntryEditPart)palette.getEditPartRegistry().get(tool);
if(part!=null){
// get the active editor
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();