Examples of PaletteContainer


Examples of org.eclipse.gef.palette.PaletteContainer

        return (ToolProxy) item;
    }
    @Override
    public void setVisible( boolean isVisible ) {
        super.setVisible(isVisible);
        PaletteContainer parent = getParent();
        boolean doubleCheck = false;
        FREE: for( Object child : parent.getChildren() ){
            PaletteEntry entry = (PaletteEntry) child;
            if( entry.isVisible() ){
                doubleCheck = true;
                break FREE; // yes I just did that to be funny
            }
        }
        parent.setVisible(doubleCheck);
    }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteContainer

            // Simple PaletteDrawer (no icon for the tool category at this time)
            String shortcut = shortcut(category.getName());
            String name = fixLabel(category.getName());
           
            PaletteContainer container;
            if( category.getId().equals("org.locationtech.udig.tool.category.zoom") ||
                    category.getId().equals("org.locationtech.udig.tool.category.pan")){
                container = navigation;
            }
            else {
                PaletteDrawer drawer = new PaletteDrawer(name);
                drawer.setId( category.getId() );
                if( category == toolManager.getActiveCategory()){
                    drawer.setInitialState(PaletteDrawer.INITIAL_STATE_OPEN);
                }
                else {
                    drawer.setInitialState(PaletteDrawer.INITIAL_STATE_CLOSED);
                }
                drawer.setDrawerType(ToolEntry.PALETTE_TYPE_TOOL);
                drawer.setUserModificationPermission(PaletteContainer.PERMISSION_NO_MODIFICATION);
                drawer.setShowDefaultIcon(false);
                if( shortcut != null ){
                    drawer.setDescription( "("+shortcut+")" );
                }
                container = drawer;
            }
            category.container( container ); // hook up so container can cycle tools on keypress
            for( ModalItem modalItem : category ) {
                String label = fixLabel(modalItem.getName());
                String keypress = shortcut(modalItem.getName());
                ToolEntry tool = new MapToolEntry(label, modalItem, keypress, category.getId());
               
                //set the default tool
                if(modalItem.getId().equals(DEFAULT_ID)){
                    root.setDefaultEntry(tool);
                }        
                container.add(tool);
            }
            if( container == navigation){
                continue; // don't add navigation container multiple times
            }
            categories.add(container);
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteContainer

        IToolManager tools = ApplicationGIS.getToolManager();
       
        // We should unhook the ToolManager enablement notifications
        for( Object child : paletteRoot.getChildren() ){
            if( child instanceof PaletteContainer){
                PaletteContainer container = (PaletteContainer) child;
                for( Object entry : container.getChildren() ){
                    if ( entry instanceof MapToolEntry){
                        MapToolEntry mapEntry = (MapToolEntry) entry;
                        mapEntry.dispose();
                    }
                }
View Full Code Here

Examples of org.eclipse.gef.palette.PaletteContainer

        if (categoryId == null) {
          categoryId = "bpel.user";
        }
       

        PaletteContainer container = null;       
        PaletteCategory category = null;
       
        IOrderedPaletteEntry orderedContainer = containerMap.get(categoryId);
       
        if (orderedContainer == null) {
         
          container = category = new PaletteCategory(categoryName); //$NON-NLS-1$         
         
          category.setOrder ( categoryOrder );
          category.setCategoryId ( categoryId );
         
          containerMap.put(categoryId, category);
         
          paletteRoot.add(container);   
         
        } else if (orderedContainer instanceof PaletteCategory) {
          container = category = (PaletteCategory) orderedContainer;
        } else if (orderedContainer instanceof PaletteContainer) {
          container = (PaletteContainer) orderedContainer;
        }
               
       
        try {
         
          ToolEntry entry = (ToolEntry)addition.createExecutableExtension(ATT_CLASS);
         
          // The container may be null. This is most likely due to some error in configruation.
          if (container != null) {
            container.add(entry);
          }
         
          if (def != null && def.equals("true") && category != null) { //$NON-NLS-1$
            category.setDefaultTool(entry);
          }
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.