Examples of PaletteToolbar


Examples of org.eclipse.gef.palette.PaletteToolbar

        List<PaletteContainer> categories = new ArrayList<PaletteContainer>();

        // Normal GEF Tools (SelectionTool etc...)
        // PaletteContainer controlGroup = createControlGroup(root);
        // categories.add(controlGroup);
        PaletteToolbar navigation = new PaletteToolbar("Navigation");
//        navigation.setInitialState(PaletteDrawer.INITIAL_STATE_OPEN);
//        navigation.setDrawerType(ToolEntry.PALETTE_TYPE_TOOL);
        navigation.setUserModificationPermission(PaletteContainer.PERMISSION_NO_MODIFICATION);
//        navigation.setShowDefaultIcon(false);
       
        for( ModalToolCategory category : toolManager.getModalToolCategories() ) {

            // Simple PaletteDrawer (no icon for the tool category at this time)
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteToolbar

        return palette;
    }

    /** Create the "Tools" group. */
    private static PaletteContainer 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);

        // Add a marquee tool to the group
        toolbar.add(new MarqueeToolEntry());

        // Add (solid-line) connection tool
        tool = new ConnectionCreationToolEntry("Solid connection", "Create a solid-line connection",
                new CreationFactory() {
                    public Object getNewObject() {
                        return null;
                    }

                    // see ShapeEditPart#createEditPolicies()
                    // this is abused to transmit the desired line style
                    public Object getObjectType() {
                        return ShapeConstants.SOLID_CONNECTION;
                    }
                },
                ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_s16.gif"),
                ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_s24.gif"));

        toolbar.add(tool);

        // Add (dashed-line) connection tool
        tool = new ConnectionCreationToolEntry("Dashed connection", "Create a dashed-line connection",
                new CreationFactory() {
                    public Object getNewObject() {
                        return null;
                    }

                    // see ShapeEditPart#createEditPolicies()
                    // this is abused to transmit the desired line style
                    public Object getObjectType() {
                        return ShapeConstants.DASHED_CONNECTION;
                    }
                },
                ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_d16.gif"),
                ImageDescriptor.createFromFile(ShapesPlugin.class, "icons/connection_d24.gif"));

        toolbar.add(tool);
        return toolbar;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.