/** * @see org.eclipse.gef.EditPartFactory#createEditPart(EditPart, Object) */ public EditPart createEditPart(EditPart parentEditPart, Object model) { if (model instanceof PaletteRoot) return createMainPaletteEditPart(parentEditPart, model); if (model instanceof PaletteStack) return createStackEditPart(parentEditPart, model); if (model instanceof PaletteContainer) { Object type = ((PaletteContainer) model).getType(); if (PaletteDrawer.PALETTE_TYPE_DRAWER.equals(type)) return createDrawerEditPart(parentEditPart, model); if (PaletteGroup.PALETTE_TYPE_GROUP.equals(type) || PaletteContainer.PALETTE_TYPE_UNKNOWN.equals(type)) return createGroupEditPart(parentEditPart, model); if (PaletteToolbar.PALETTE_TYPE_TOOLBAR_GROUP.equals(type)) return createToolbarEditPart(parentEditPart, model); } if (model instanceof PaletteTemplateEntry) return createTemplateEditPart(parentEditPart, model); if (model instanceof PaletteSeparator) return createSeparatorEditPart(parentEditPart, model); if (model instanceof PaletteEntry) return createEntryEditPart(parentEditPart, model); return null; }
private void createToolsGroup(PaletteRoot palette) { PaletteToolbar toolbar = new PaletteToolbar("Tools"); // Add a selection tool to the group // ToolEntry tool = new PanningSelectionToolEntry(); // toolbar.add(tool); // palette.setDefaultEntry(tool); palette.add(toolbar); }
/** * Creates a new JDPalette object. * * @param paletteRoot * the palette root */ public static void createToolBar(PaletteRoot paletteRoot) { PaletteToolbar paletteToolbar = new PaletteToolbar("toolbar"); //$NON-NLS-1$ paletteToolbar.add(new SelectionToolEntry()); paletteToolbar.add(new JDMarqueeToolEntry()); paletteRoot.add(paletteToolbar); }
/** * Create ToolbarEditPart - edit part for PaletteToolbar * * @param parentEditPart * the parent of the new editpart to be created * @param model * the PaletteToolbar * @return the newly created EditPart */ protected EditPart createToolbarEditPart(EditPart parentEditPart, Object model) { return new ToolbarEditPart((PaletteToolbar) model); }
/** * Creates a new instance. * * @param model * the <code>PaletteToolbar</code> */ public ToolbarEditPart(PaletteToolbar model) { super(model); }