Package org.thechiselgroup.choosel.core.client.command

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


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

        UndoableCommand command = getCommand();

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

        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

    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

    @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

    @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

    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

    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

Related Classes of org.thechiselgroup.choosel.core.client.command.UndoableCommand

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.