Package org.locationtech.udig.project.command

Examples of org.locationtech.udig.project.command.CompositeCommand


            if( selection == null || selection.isEmpty() || table.getSelectionCount()==0 )
                return;
           
            Id filter=(Id) selection.getFirstElement();

            CompositeCommand composite;
            if( table.getSelectionCount()==1 ){
                composite = deleteFeature();
            }else{
                composite = deleteManyFeatures(filter);
            }
View Full Code Here


           
            layer.getMap().sendCommandASync(composite);
        }

        private CompositeCommand deleteFeature( ) {
            CompositeCommand composite=new CompositeCommand();
            composite.setName(Messages.TableView_compositeName);
            composite.getCommands().add(new SetEditingFlag(true));
            DeleteFromTableCommand deleteFromTableCommand = new DeleteFromTableCommand(layer);
            composite.getCommands().add(deleteFromTableCommand);
            IBlockingProvider<ILayer> layerProvider=new StaticBlockingProvider<ILayer>(layer);
            composite.getCommands().add(new DeleteFeatureCommand(deleteFromTableCommand, layerProvider));
            composite.getFinalizerCommands().add(new SetEditingFlag(false));
            return composite;
        }
View Full Code Here

            composite.getCommands().add(new DeleteFeatureCommand(deleteFromTableCommand, layerProvider));
            composite.getFinalizerCommands().add(new SetEditingFlag(false));
            return composite;
        }
        private CompositeCommand deleteManyFeatures( Id filter ) {
            CompositeCommand composite=new CompositeCommand();
            composite.setName(Messages.TableView_compositeName);
            composite.getCommands().add(new SetEditingFlag(true));
            composite.getCommands().add(new DeleteManyFeaturesCommand(layer,filter));
            composite.getCommands().add(new DeleteFromTableCommand(layer));
            composite.getFinalizerCommands().add(new SetEditingFlag(false));
            return composite;
        }
View Full Code Here

            } catch (IllegalAttributeException e1) {
                // shouldn't happen.
            }

            final CompositeCommand compComm = new CompositeCommand();
            //Sets the feature (with the edited values) used in the view as the editFeature
            compComm.getCommands().add(new SetEditFeatureCommand(editedFeature));
            //Write the changes to the actual dataset
            compComm.getCommands().add(new WriteEditFeatureCommand());
            context.sendASyncCommand(compComm);

            setEnabled(false);
        }
View Full Code Here

            editedFeature.setAttribute(COLOR_MAP, color.toString());

        } catch (IllegalAttributeException e1) {
            // shouldn't happen.
        }
        CompositeCommand compComm = new CompositeCommand();
        compComm.getCommands().add(
                context.getEditFactory().createSetEditFeatureCommand(editedFeature));
        compComm.getCommands().add(context.getEditFactory().createWriteEditFeatureCommand());
        context.sendASyncCommand(compComm);
        setEnabled(false);
    }
View Full Code Here

            Geometry newGeometry = geometry.reverse();
            UndoableMapCommand setGeometryCmd = cmdFactory.createSetGeomteryCommand(feature, selectedLayer, newGeometry);
            cmdList.add(setGeometryCmd);
            count++;
        }
        CompositeCommand compositeCommand = new CompositeCommand(cmdList);
        IToolContext toolContext = ApplicationGIS.createContext(ApplicationGIS.getActiveMap());
        toolContext.sendSyncCommand(compositeCommand);

        showMessage(display, Messages.getString("ReverseFeatureOrientation_info"), //$NON-NLS-1$
                Messages.getString("ReverseFeatureOrientation_infomsg") + count, MSGTYPE.INFO); //$NON-NLS-1$
View Full Code Here

        /*
         * first copy things over and if that works, delete the old ones
         */
        IToolContext toolContext = ApplicationGIS.createContext(ApplicationGIS.getActiveMap());
        try {
            CompositeCommand compositeCommand = new CompositeCommand(copyOverList);
            toolContext.sendSyncCommand(compositeCommand);
        } catch (Exception e) {
            showMessage(display,
                    Messages.getString("OperationUtils_error"), Messages.getString("OperationUtils_copyproblem"), MSGTYPE.ERROR); //$NON-NLS-1$ //$NON-NLS-2$
            return;
        }
        try {
            CompositeCommand compositeCommand = new CompositeCommand(deleteOldList);
            toolContext.sendSyncCommand(compositeCommand);
            showMessage(
                    display,
                    Messages.getString("OperationUtils_info"), MessageFormat.format(Messages.getString("OperationUtils_movedinfo"), count), MSGTYPE.WARNING); //$NON-NLS-1$ //$NON-NLS-2$
        } catch (Exception e) {
View Full Code Here

   * @return a {@linkplain CompositeCommand}
   * @see MapCommand
   */
  @Override
    public MapCommand createCompositeCommand(List<? extends MapCommand> commands) {
    return new CompositeCommand(commands);
  }
View Full Code Here

            } catch (IllegalAttributeException e1) {
                // shouldn't happen.
            }

            final CompositeCommand compComm = new CompositeCommand();
            //Sets the feature (with the edited values) used in the view as the editFeature
            compComm.getCommands().add(new SetEditFeatureCommand(editedFeature));
            //Write the changes to the actual dataset
            compComm.getCommands().add(new WriteEditFeatureCommand());
            context.sendASyncCommand(compComm);

            setEnabled(false);
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.command.CompositeCommand

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.