Package org.apache.pivot.util

Examples of org.apache.pivot.util.Vote


            }
        }

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

            for (WindowStateListener listener : this) {
                vote = vote.tally(listener.previewWindowOpen(window));
            }

            return vote;
        }
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

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

            Vote vote = sheetStateListeners.previewSheetClose(this, result);

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

                super.close();
View Full Code Here

public class Sheet extends Window {
    private static class SheetStateListenerList extends WTKListenerList<SheetStateListener>
        implements SheetStateListener {
        @Override
        public Vote previewSheetClose(Sheet sheet, boolean result) {
            Vote vote = Vote.APPROVE;

            for (SheetStateListener listener : this) {
                vote = vote.tally(listener.previewSheetClose(sheet, result));
            }

            return vote;
        }
View Full Code Here

    }

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

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

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

        tabPane.getTabPaneListeners().add(new TabPaneListener.Adapter() {
            @Override
            public Vote previewRemoveTabs(final TabPane tabPane, 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

    }

    // 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

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

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

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

                super.close();
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.