Package org.apache.pivot.util

Examples of org.apache.pivot.util.Vote


    public void close(boolean resultArgument) {
        if (!isClosed()) {
            closing = true;

            Vote vote = dialogStateListeners.previewDialogClose(this, resultArgument);

            if (vote == Vote.APPROVE) {
                Window owner = getOwner();

                super.close();
View Full Code Here


    private static class DialogStateListenerList extends WTKListenerList<DialogStateListener>
        implements DialogStateListener {
        @Override
        public Vote previewDialogClose(Dialog dialog, boolean result) {
            Vote vote = Vote.APPROVE;

            for (DialogStateListener listener : this) {
                vote = vote.tally(listener.previewDialogClose(dialog, result));
            }

            return vote;
        }
View Full Code Here

        owner.getComponentListeners().remove(ownerListener);
    }

    @Override
    public Vote previewSheetClose(Sheet sheet, boolean result) {
        Vote vote = Vote.APPROVE;

        // Don't start the transition if the sheet is being closed as a result
        // of the owner closing
        Window owner = sheet.getOwner();
        if (!(owner.isClosing()
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public Vote previewExpandedChange(final Expander expander) {
        Vote vote;

        if (expander.isShowing()
            && expandTransition == null
            && expander.getContent() != null) {
            final boolean expanded = expander.isExpanded();
View Full Code Here

    }

    // Text input character events
    @Override
    public Vote previewInsertText(TextInput textInput, CharSequence text, int index) {
        Vote vote = Vote.APPROVE;

        if (textInput.isStrictValidation()) {
            Validator validator = textInput.getValidator();
            if (validator != null) {
                StringBuilder textBuilder = new StringBuilder();
View Full Code Here

        // No-op
    }

    @Override
    public Vote previewRemoveText(TextInput textInput, int index, int count) {
        Vote vote = Vote.APPROVE;

        if (textInput.isStrictValidation()) {
            Validator validator = textInput.getValidator();
            if (validator != null) {
                StringBuilder textBuilder = new StringBuilder();
View Full Code Here

    }

    // Tab pane selection events
    @Override
    public Vote previewSelectedIndexChange(TabPane tabPane, int selectedIndex) {
        Vote vote;

        if (tabPane.isCollapsible()) {
            if (tabPane.isShowing()
                && selectionChangeTransition == null) {
                int previousSelectedIndex = tabPane.getSelectedIndex();
View Full Code Here

    }

    // Rollup state events
    @Override
    public Vote previewExpandedChange(final Rollup rollup) {
        Vote vote;

        if (rollup.isShowing()
            && expandTransition == null
            && rollup.getContent() != null) {
            final boolean expanded = rollup.isExpanded();
View Full Code Here

        window.requestFocus();
    }

    @Override
    public Vote previewSheetClose(final Sheet sheet, final boolean result) {
        Vote vote = null;

        if (result
            && !okButton.isEnabled()) {
            vote = Vote.DENY;
        } else {
View Full Code Here

    }

    // Accordion selection events
    @Override
    public Vote previewSelectedIndexChange(final Accordion accordion, final int selectedIndex) {
        Vote vote = Vote.APPROVE;

        if (accordion.isShowing()
            && accordion.isValid()) {
            if (selectionChangeTransition == null) {
                int previousSelectedIndex = accordion.getSelectedIndex();
View Full Code Here

TOP

Related Classes of org.apache.pivot.util.Vote

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.