Package org.locationtech.udig.internal.ui.operations

Examples of org.locationtech.udig.internal.ui.operations.OperationCategory


                if( selection instanceof OperationDialog){
                    setMessage( "What would you like to do:");
                    button.setEnabled(false);
                }
                else if (selection instanceof OperationCategory){
                    OperationCategory category = (OperationCategory) selection;
                    if( category.getDescription() != null ){
                        setMessage( category.getDescription() );
                    }
                    else {
                        setMessage( "Please select an operation:");
                    }
                    button.setEnabled(false);
View Full Code Here


        super.buttonPressed(buttonId);
    }

    public Object[] getElements( Object inputElement ) {
        if (inputElement instanceof OperationCategory) {
            OperationCategory operationCategory = (OperationCategory) inputElement;
            return operationCategory.getActions().toArray();
        }
        else if (inputElement instanceof OperationDialog) {
            OperationMenuFactory factory = UiPlugin.getDefault().getOperationMenuFactory();
            return factory.getCategories().values().toArray();
        }
View Full Code Here

            }
            else if( list.size() == 1 ){
                items = list.toArray( new IContributionItem[list.size()]);
            }
            else {
                OperationCategory category = factory.findCategory( categoryId );
                MenuManager subMenu = new MenuManager( category.getMenuText(), category.getId() );
                for( IContributionItem item : list ){
                    subMenu.add( item );
                }
                items = new IContributionItem[]{ subMenu, };
            }
View Full Code Here

            List<OperationCategory> primaryCategories = activeModalToolProxy.getOperationCategories();
            Collection<OperationCategory> secondaryCategories = getOperationMenuFactory()
                    .getCategories().values();

            for( int i = 0; i < primaryCategories.size(); i++ ) {
                OperationCategory category = primaryCategories.get(i);

                // Limit the size of the context menu to 20, but don't ever display a portion of
                // a category, only always the entire thing.
                if (contextManager.getItems().length >= 15 && category.getActions().size() > 5) {
                    break;
                }

                MenuManager menu = category.createContextMenu();

                if ((i != 0 && menu.getItems().length != 0)
                        && (secondaryCategories.size() != 0 || getOperationMenuFactory()
                                .getActions().size() != 0)) {

                    contextManager.add(new Separator());
                }

                for( IContributionItem item : menu.getItems() ) {
                    contextManager.add(item);
                }
            }

            // if primaryCategories are present, create an "Other" submenu
            if (contextManager.getItems().length != 0) {
                RunOperationsAction action = new RunOperationsAction();
                action.setText(Messages.ToolCategory_other);

                contextManager.add(new Separator());
                contextManager.add(action);
            } else {
                Iterator iter = secondaryCategories.iterator();
                while( iter.hasNext() ) {
                    OperationCategory category = (OperationCategory) iter.next();

                    for( OpAction action : category.getActions() ) {
                        if( selection instanceof IStructuredSelection )
                            action.updateEnablement((IStructuredSelection) selection, true);
                        if (action.isEnabled())
                            contextManager.add(action);
                    }
View Full Code Here

            if (opCategoryID == null || opCategoryID.length() == 0) {
                ProjectUIPlugin.log("Warning: CategoryID attribute of operationCategory element in tool '"+id+"' is empty.",null); //$NON-NLS-1$ //$NON-NLS-2$
                continue;
            }
           
            OperationCategory opCategory = categories.get(opCategoryID);
            if (opCategory == null) {
                ProjectUIPlugin.log("Warning: CategoryID attribute of operationCategory element in tool '"+id+"' cannot be found. Does it actually exist?", null); //$NON-NLS-1$ //$NON-NLS-2$
                continue;
            }
           
View Full Code Here

TOP

Related Classes of org.locationtech.udig.internal.ui.operations.OperationCategory

Copyright © 2018 www.massapicom. 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.