Package org.apache.pivot.wtk

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


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

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

        suggestionPopup.setContent(suggestionListViewBorder);

        suggestionListView.setListData(suggestionPopup.getSuggestions());
        suggestionListView.setItemRenderer(suggestionPopup.getSuggestionRenderer());

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


        setBorderColor(GraphicsUtilities.decodeColor(borderColor));
    }

    @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

        return true;
    }

    @Override
    public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
        SuggestionPopup suggestionPopup = (SuggestionPopup)getComponent();
        TextInput textInput = suggestionPopup.getTextInput();

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

            case Keyboard.KeyCode.TAB: {
                suggestionPopup.close(true);

                FocusTraversalDirection direction = (Keyboard.isPressed(Keyboard.Modifier.SHIFT)) ?
                    FocusTraversalDirection.BACKWARD : FocusTraversalDirection.FORWARD;
                textInput.transferFocus(direction);

                break;
            }

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

        return false;
View Full Code Here

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

        dropShadowDecorator.setShadowOpacity(DropShadowDecorator.DEFAULT_SHADOW_OPACITY);

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

        // Reposition under text input
        Point location = textInput.mapPointToAncestor(textInput.getDisplay(), 0, 0);
        suggestionPopup.setLocation(location.x, location.y + textInput.getHeight() - 1);
        suggestionPopup.setMinimumPreferredWidth(textInput.getWidth());
    }
View Full Code Here

TOP

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

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.