Examples of UndoableCommand


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

  public void rollback( IProgressMonitor monitor ) throws Exception {
        final boolean previousDeliver = model.eDeliver();
        model.eSetDeliver(false);
        try{
        for (int i = finalizerCommands.size() - 1; i > -1; i--) {
            UndoableCommand command = (UndoableCommand) finalizerCommands.get(i);
            command.rollback(monitor);
        }

        for (int i = commands.size() - 1; i > -1; i--) {
            // reset the eSetDeliverState so that the last change will trigger a re-render
            if( i==0 ){
                model.eSetDeliver(previousDeliver);
            }
            UndoableCommand command = (UndoableCommand) commands.get(i);
            command.rollback(monitor);
       
       
        }finally{
            model.eSetDeliver(previousDeliver);
        }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    public void onEnter(final DragContext context) {
        // TODO support dragging multiple widgets?
        super.onEnter(context);

        if (canDrop(context)) {
            UndoableCommand command = createCommand(context);

            if (command instanceof HasDescription) {
                showPopup(context, ((HasDescription) command).getDescription());
            }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    private String getCommandDescription() {
        if (!canPerformOperation()) {
            return "";
        }

        UndoableCommand command = getCommand();

        if (!(command instanceof HasDescription)) {
            return "";
        }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

        ArgumentCaptor<UndoableCommand> argument2 = ArgumentCaptor
                .forClass(UndoableCommand.class);

        verify(commandManager, times(1)).execute(argument2.capture());

        UndoableCommand command = argument2.getValue();
        assertThat(command.hasExecuted(), is(true));
        assertEquals(true, command instanceof MoveNodeCommand);

        MoveNodeCommand command2 = (MoveNodeCommand) command;

        assertEquals(node, command2.getNode());
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    private void testResourceSetInCommandIsModifiable(boolean modifiable,
            ResourceSetAvatarType type) {
        when(dragAvatar.getType()).thenReturn(type);

        UndoableCommand result = underTest.createCommand(dragAvatar);

        assertEquals(true, result instanceof AddResourceSetToViewCommand);
        AddResourceSetToViewCommand result2 = (AddResourceSetToViewCommand) result;

        assertEquals(modifiable, result2.getResourceSet().isModifiable());
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    @Test
    public void useAddResourcesCommandForUnlabeledResourceSet() {
        when(dragAvatar.getType()).thenReturn(ResourceSetAvatarType.SET);
        resources.setLabel(null);

        UndoableCommand result = underTest.createCommand(dragAvatar);

        assertEquals(true, result instanceof AddResourcesToResourceModelCommand);
    }
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    @Test
    public void createAddResourceSetToResourceSetCommand() {
        when(targetSet.isModifiable()).thenReturn(true);

        UndoableCommand result = dropCommandFactory.createCommand(dragAvatar);

        assertNotNull(result);
        assertEquals(true, result instanceof AddResourceSetToResourceSetCommand);
        assertEquals(true, !(result instanceof MergeResourceSetsCommand));
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    public void createAddResourceSetToResourceSetCommandWhenAvatarsFromSameViewButSourceTypeIsSelection() {
        when(targetSet.isModifiable()).thenReturn(true);
        when(accessor.findView(dragAvatar)).thenReturn(view);
        when(dragAvatar.getType()).thenReturn(ResourceSetAvatarType.SELECTION);

        UndoableCommand result = dropCommandFactory.createCommand(dragAvatar);

        assertNotNull(result);
        assertEquals(true, !(result instanceof MergeResourceSetsCommand));

        AddResourceSetToResourceSetCommand result2 = (AddResourceSetToResourceSetCommand) result;
View Full Code Here

Examples of org.thechiselgroup.choosel.core.client.command.UndoableCommand

    public void createMergeResourceCommandWhenAvatarsFromSameViewAndSourceTypeIsSet() {
        when(targetSet.isModifiable()).thenReturn(true);
        when(accessor.findView(dragAvatar)).thenReturn(view);
        when(dragAvatar.getType()).thenReturn(ResourceSetAvatarType.SET);

        UndoableCommand result = dropCommandFactory.createCommand(dragAvatar);

        assertNotNull(result);
        assertEquals(true, result instanceof MergeResourceSetsCommand);

        MergeResourceSetsCommand result2 = (MergeResourceSetsCommand) result;
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.