Package org.apache.pivot.util

Examples of org.apache.pivot.util.Vote


            // close - not doing so would prevent close transitions from running
            // in parallel, forcing them to run in series)
            if (cancel) {
                closing = false;
            } else {
                Vote vote = windowStateListeners.previewWindowClose(this);

                if (vote == Vote.APPROVE) {
                    // Remove the window from the display
                    Display display = getDisplay();
                    display.remove(this);
View Full Code Here


        invalidateComponent();
    }

    @Override
    public Vote previewSelectedIndexChange(CardPane cardPane, int selectedIndex) {
        Vote vote;

        if (cardPane.isShowing()
            && selectionChangeEffect != null
            && selectionChangeTransition == null) {
            int previousSelectedIndex = cardPane.getSelectedIndex();
View Full Code Here

            if (!collapsible
                && !expanded) {
                throw new IllegalStateException();
            }

            Vote vote = expanderListeners.previewExpandedChange(this);

            if (vote == Vote.APPROVE) {
                this.expanded = expanded;
                expanderListeners.expandedChanged(this);
            } else {
View Full Code Here

            }
        }

        @Override
        public Vote previewExpandedChange(Expander expander) {
            Vote vote = Vote.APPROVE;

            for (ExpanderListener listener : this) {
                vote = vote.tally(listener.previewExpandedChange(expander));
            }

            return vote;
        }
View Full Code Here

        display.getComponentKeyListeners().add(displayKeyListener);
    }

    @Override
    public Vote previewWindowClose(final Window window) {
        Vote vote = Vote.APPROVE;

        if (fade) {
            if (closeTransition == null) {
                closeTransition = new FadeWindowTransition(window,
                    closeTransitionDuration, closeTransitionRate,
View Full Code Here

        indexBoundsCheck("selectedIndex", selectedIndex, -1, panels.getLength() - 1);

        int previousSelectedIndex = this.selectedIndex;

        if (previousSelectedIndex != selectedIndex) {
            Vote vote = accordionSelectionListeners.previewSelectedIndexChange(this, selectedIndex);

            if (vote == Vote.APPROVE) {
                this.selectedIndex = selectedIndex;
                accordionSelectionListeners.selectedIndexChanged(this, previousSelectedIndex);
            } else {
View Full Code Here

    private static class AccordionSelectionListenerList extends WTKListenerList<AccordionSelectionListener>
        implements AccordionSelectionListener {
        @Override
        public Vote previewSelectedIndexChange(Accordion accordion, int selectedIndex) {
            Vote vote = Vote.APPROVE;

            for (AccordionSelectionListener listener : this) {
                vote = vote.tally(listener.previewSelectedIndexChange(accordion, selectedIndex));
            }

            return vote;
        }
View Full Code Here

        cornerBoxPane = (BoxPane)namespace.get("cornerBoxPane");

        tabPane.getTabPaneListeners().add(new TabPaneListener.Adapter() {
            @Override
            public Vote previewRemoveTabs(final TabPane tabPaneArgument, final int index, final int count) {
                Vote vote;
                if (confirmCloseTab) {
                    confirmCloseTabPrompt.open(TabPanes.this, new SheetCloseListener() {
                        @Override
                        public void sheetClosed(Sheet sheet) {
                            if (confirmCloseTabPrompt.getResult()
View Full Code Here

        if (characters.length() + text.length() > maximumLength) {
            throw new IllegalArgumentException("Insertion of text would exceed maximum length.");
        }

        if (text.length() > 0) {
            Vote vote = textInputContentListeners.previewInsertText(this, text, index);

            if (vote == Vote.APPROVE) {
                // Insert the text
                characters.insert(index, text);
View Full Code Here

        removeText(index, count, true);
    }

    private void removeText(int index, int count, boolean addToEditHistory) {
        if (count > 0) {
            Vote vote = textInputContentListeners.previewRemoveText(this, index, count);

            if (vote == Vote.APPROVE) {
                // Add a remove history item
                if (addToEditHistory) {
                    addHistoryItem(new RemoveTextEdit(index, count));
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.