Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.SuggestionPopup$SuggestionPopupItemListenerList


    @Override
    public void install(Component component) {
        super.install(component);

        SuggestionPopup suggestionPopup = (SuggestionPopup)component;
        suggestionPopup.getSuggestionPopupListeners().add(this);
        suggestionPopup.getSuggestionPopupSelectionListeners().add(this);
        suggestionPopup.getSuggestionPopupStateListeners().add(this);

        suggestionPopup.setContent(listViewBorder);

        listView.setListData(suggestionPopup.getSuggestionData());
        listView.setItemRenderer(suggestionPopup.getSuggestionRenderer());

        // Attach the drop-shadow decorator
        dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
        suggestionPopup.getDecorators().add(dropShadowDecorator);
    }
View Full Code Here


        this.closeTransitionRate = closeTransitionRate;
    }

    @Override
    public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();
        suggestionPopup.close(true);

        return true;
    }
View Full Code Here

     * {@link KeyCode#ESCAPE ESCAPE} Close the suggestion popup with a 'result'
     * of false.
     */
    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();

        switch (keyCode) {
            case Keyboard.KeyCode.ENTER: {
                suggestionPopup.close(true);
                break;
            }

            case Keyboard.KeyCode.ESCAPE: {
                suggestionPopup.close(false);
                break;
            }

            default: {
                break;
View Full Code Here

    @Override
    public void windowOpened(Window window) {
        super.windowOpened(window);

        // Adjust for list size
        SuggestionPopup suggestionPopup = (SuggestionPopup)window;

        int listSize = suggestionPopup.getListSize();
        if (listSize == -1) {
            listViewBorder.setPreferredHeight(-1);
        } else {
            if (!listViewBorder.isPreferredHeightSet()) {
                ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
                int borderHeight = itemRenderer.getPreferredHeight(-1) * listSize + 2;

                if (listViewBorder.getPreferredHeight() > borderHeight) {
                    listViewBorder.setPreferredHeight(borderHeight);
                } else {
                    listViewBorder.setPreferredHeight(-1);
                }
            }
        }

        Display display = window.getDisplay();
        display.getContainerMouseListeners().add(displayMouseListener);

        dropShadowDecorator.setShadowOpacity(DropShadowDecorator.DEFAULT_SHADOW_OPACITY);

        returnFocusToTextInput = true;

        TextInput textInput = suggestionPopup.getTextInput();
        textInput.getComponentStateListeners().add(textInputStateListener);
        textInput.getComponentKeyListeners().add(textInputKeyListener);

        // Size and position the popup
        Point location = textInput.mapPointToAncestor(textInput.getDisplay(), 0, 0);
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        SuggestionPopup suggestionPopup = (SuggestionPopup)component;
        suggestionPopup.getSuggestionPopupListeners().add(this);
        suggestionPopup.getSuggestionPopupSelectionListeners().add(this);
        suggestionPopup.getSuggestionPopupStateListeners().add(this);

        suggestionPopup.setContent(listViewBorder);

        listView.setListData(suggestionPopup.getSuggestionData());
        listView.setItemRenderer(suggestionPopup.getSuggestionRenderer());

        // Attach the drop-shadow decorator
        dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
        suggestionPopup.getDecorators().add(dropShadowDecorator);
    }
View Full Code Here

        this.closeTransitionRate = closeTransitionRate;
    }

    @Override
    public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();
        suggestionPopup.close(true);

        return true;
    }
View Full Code Here

     * {@link KeyCode#ESCAPE ESCAPE} Close the suggestion popup with a 'result'
     * of false.
     */
    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();

        switch (keyCode) {
            case Keyboard.KeyCode.ENTER: {
                suggestionPopup.close(true);
                break;
            }

            case Keyboard.KeyCode.ESCAPE: {
                suggestionPopup.close(false);
                break;
            }
        }

        return false;
View Full Code Here

    @Override
    public void windowOpened(Window window) {
        super.windowOpened(window);

        // Adjust for list size
        SuggestionPopup suggestionPopup = (SuggestionPopup)window;

        int listSize = suggestionPopup.getListSize();
        if (listSize == -1) {
            listViewBorder.setPreferredHeight(-1);
        } else {
            if (!listViewBorder.isPreferredHeightSet()) {
                ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
                int borderHeight = itemRenderer.getPreferredHeight(-1) * listSize + 2;

                if (listViewBorder.getPreferredHeight() > borderHeight) {
                    listViewBorder.setPreferredHeight(borderHeight);
                } else {
                    listViewBorder.setPreferredHeight(-1);
                }
            }
        }

        Display display = window.getDisplay();
        display.getContainerMouseListeners().add(displayMouseListener);

        dropShadowDecorator.setShadowOpacity(DropShadowDecorator.DEFAULT_SHADOW_OPACITY);

        returnFocusToTextInput = true;

        TextInput textInput = suggestionPopup.getTextInput();
        textInput.getComponentStateListeners().add(textInputStateListener);
        textInput.getComponentKeyListeners().add(textInputKeyListener);

        // Size and position the popup
        Point location = textInput.mapPointToAncestor(textInput.getDisplay(), 0, 0);
View Full Code Here

    @Override
    public void install(Component component) {
        super.install(component);

        SuggestionPopup suggestionPopup = (SuggestionPopup)component;
        suggestionPopup.getSuggestionPopupListeners().add(this);
        suggestionPopup.getSuggestionPopupSelectionListeners().add(this);
        suggestionPopup.getSuggestionPopupStateListeners().add(this);

        suggestionPopup.setContent(listViewBorder);

        listView.setListData(suggestionPopup.getSuggestionData());
        listView.setItemRenderer(suggestionPopup.getSuggestionRenderer());

        // Attach the drop-shadow decorator
        dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
        suggestionPopup.getDecorators().add(dropShadowDecorator);
    }
View Full Code Here

        this.closeTransitionRate = closeTransitionRate;
    }

    @Override
    public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();
        suggestionPopup.close(true);

        return true;
    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.SuggestionPopup$SuggestionPopupItemListenerList

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.