Search in sources :

Example 1 with DesignEditorSelectionState

use of edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState in project cogtool by cogtool.

the class DesignEditorController method createDeleteTransitionAction.

// deleteFrames
protected IListenerAction createDeleteTransitionAction() {
    return new IListenerAction() {

        public Class<?> getParameterClass() {
            return DesignEditorSelectionState.class;
        }

        public boolean performAction(Object prms) {
            DesignEditorSelectionState selection = (DesignEditorSelectionState) prms;
            Transition[] transitions = selection.getSelectedTransitions();
            if ((transitions != null) && (transitions.length > 0)) {
                if (interaction.confirmDeleteTransitions(transitions)) {
                    deleteTransitions(transitions);
                    return true;
                }
            } else {
                interaction.protestNoSelection();
            }
            return false;
        }
    };
}
Also used : IListenerAction(edu.cmu.cs.hcii.cogtool.util.IListenerAction) DesignEditorSelectionState(edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState) Transition(edu.cmu.cs.hcii.cogtool.model.Transition)

Aggregations

Transition (edu.cmu.cs.hcii.cogtool.model.Transition)1 DesignEditorSelectionState (edu.cmu.cs.hcii.cogtool.ui.DesignEditorSelectionState)1 IListenerAction (edu.cmu.cs.hcii.cogtool.util.IListenerAction)1