public void addButton(final PlugInContext context) { if (!circleButtonAdded) { final ToolboxDialog toolbox = ((EditingPlugIn) context.getWorkbenchContext().getBlackboard().get(EditingPlugIn.KEY)) .getToolbox(context.getWorkbenchContext()); QuasimodeTool quasimodeTool = new QuasimodeTool(DrawConstrainedCircleTool.create(toolbox.getContext())); quasimodeTool.add(new QuasimodeTool.ModifierKeySpec(true, false, false), null); quasimodeTool.add(new QuasimodeTool.ModifierKeySpec(true, true, false), null); toolbox.add(quasimodeTool, null); toolbox.finishAddingComponents(); toolbox.validate(); circleButtonAdded = true; } }
public void addButton(final ToolboxDialog toolbox) { if (!selectSelectItemsByCircleButtonAdded) { MouseEvent event = new MouseEvent( toolbox, MouseEvent.MOUSE_CLICKED, System.currentTimeMillis(), 0, 0, 0, 1, true); toolbox.getContext(); QuasimodeTool sit = new QuasimodeTool(new SelectItemsByCircleTool(toolbox.getContext())) .add(new QuasimodeTool.ModifierKeySpec(true, false, false), null); sit.mousePressed(event); toolbox.add(sit); toolbox.finishAddingComponents(); toolbox.validate(); selectSelectItemsByCircleButtonAdded = true; } }