Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Alert$AlertListenerList


                                body = (Component)bxmlSerializer.readObject(KitchenSink.class, "alert.bxml");
                            } catch(Exception exception) {
                                System.err.println(exception);
                            }

                            Alert alert = new Alert(MessageType.QUESTION, "Please select your favorite icon:",
                                options, body);
                            alert.setTitle("Select Icon");
                            alert.setSelectedOptionIndex(0);
                            alert.getDecorators().update(0, new ReflectionDecorator());
                            alert.open(window);
                        } else {
                            String message = (String)userData.get("message");
                            Alert.alert(MessageType.valueOf(messageType.toUpperCase()), message, window);
                        }
                    }
View Full Code Here


        if (alert == null) {
            ArrayList<String> options = new ArrayList<String>();
            options.add("Yes");
            options.add("No");

            alert = new Alert(MessageType.QUESTION, "Cancel shutdown?", options);
            alert.setModal(false);
            alert.open(display, new DialogCloseListener() {
                public void dialogClosed(Dialog dialog, boolean modal) {
                    Alert alert = (Alert)dialog;

                    if (alert.getResult()) {
                        if (alert.getSelectedOptionIndex() == 1) {
                            cancelShutdown = false;
                            DesktopApplicationContext.exit();
                        }
                    }
View Full Code Here

        });

        Label alertBody = new Label("Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.");
        alertBody.getStyles().put("wrapText", true);

        final Alert alert = new Alert(MessageType.INFO, "Alert", new ArrayList<String>("OK"), alertBody);
        alert.setTitle("Alert");

        BoxPane boxPane = new BoxPane();
        tablePane.getRows().get(1).add(boxPane);

        boxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
View Full Code Here

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

        Alert alert = (Alert)component;
        alert.setPreferredWidth(320);
        alert.setMinimumWidth(160);

        alert.getAlertListeners().add(this);

        // Load the alert content
        BXMLSerializer bxmlSerializer = new BXMLSerializer();

        Component content;
        try {
            content = (Component)bxmlSerializer.readObject(TerraAlertSkin.class,
                "terra_alert_skin.bxml");
        } catch(Exception exception) {
            throw new RuntimeException(exception);
        }

        alert.setContent(content);

        typeImageView = (ImageView)bxmlSerializer.getNamespace().get("typeImageView");
        messageLabel = (Label)bxmlSerializer.getNamespace().get("messageLabel");
        messageBoxPane = (BoxPane)bxmlSerializer.getNamespace().get("messageBoxPane");
        optionButtonBoxPane = (BoxPane)bxmlSerializer.getNamespace().get("optionButtonBoxPane");

        for (Object option : alert.getOptions()) {
            PushButton optionButton = new PushButton(option);
            optionButton.setStyleName(TerraAlertSkin.class.getPackage().getName()
                + "." + TerraTheme.COMMAND_BUTTON_STYLE);
            optionButton.getButtonPressListeners().add(optionButtonPressListener);
View Full Code Here

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

        Alert alert = (Alert)window;
        int index = alert.getSelectedOptionIndex();

        if (index >= 0) {
            optionButtonBoxPane.get(index).requestFocus();
        } else {
            window.requestFocus();
View Full Code Here

                                body = (Component)wtkxSerializer.readObject(this, "alert.wtkx");
                            } catch(Exception exception) {
                                System.err.println(exception);
                            }

                            Alert alert = new Alert(MessageType.QUESTION, "Please select your favorite icon:",
                                options, body);
                            alert.setTitle("Select Icon");
                            alert.setSelectedOption(0);
                            alert.getDecorators().update(0, new ReflectionDecorator());
                            alert.open(window);
                        } else {
                            String message = (String)userData.get("message");
                            Alert.alert(MessageType.valueOf(messageType.toUpperCase()), message, window);
                        }
                    }
View Full Code Here

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

        Alert alert = (Alert)component;
        alert.getAlertListeners().add(this);

        // Load the alert content
        WTKXSerializer wtkxSerializer = new WTKXSerializer();

        Component content;
        try {
            content = (Component)wtkxSerializer.readObject(this, "terra_alert_skin.wtkx");
        } catch(Exception exception) {
            throw new RuntimeException(exception);
        }

        alert.setContent(content);

        typeImageView = (ImageView)wtkxSerializer.get("typeImageView");
        messageLabel = (Label)wtkxSerializer.get("messageLabel");
        messageBoxPane = (BoxPane)wtkxSerializer.get("messageBoxPane");
        optionButtonBoxPane = (BoxPane)wtkxSerializer.get("optionButtonBoxPane");

        for (Object option : alert.getOptions()) {
            PushButton optionButton = new PushButton(option);
            optionButton.setStyles(commandButtonStyles);
            optionButton.getButtonPressListeners().add(optionButtonPressListener);

            optionButtonBoxPane.add(optionButton);
View Full Code Here

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

        Alert alert = (Alert)window;
        int index = alert.getSelectedOption();

        if (index >= 0) {
            optionButtonBoxPane.get(index).requestFocus();
        } else {
            window.requestFocus();
View Full Code Here

        });

        Label alertBody = new Label("Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.");
        alertBody.getStyles().put("wrapText", true);

        final Alert alert = new Alert(MessageType.INFO, "Alert", new ArrayList<String>("OK"), alertBody);
        alert.setTitle("Alert");

        BoxPane boxPane = new BoxPane();
        tablePane.getRows().get(1).add(boxPane);

        boxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
View Full Code Here

        if (alert == null) {
            ArrayList<String> options = new ArrayList<String>();
            options.add("Yes");
            options.add("No");

            alert = new Alert(MessageType.QUESTION, "Cancel shutdown?", options);
            alert.setModal(false);
            alert.open(display, new DialogCloseListener() {
                public void dialogClosed(Dialog dialog, boolean modal) {
                    Alert alert = (Alert)dialog;

                    if (alert.getResult()) {
                        if (alert.getSelectedOption() == 1) {
                            cancelShutdown = false;
                            DesktopApplicationContext.exit();
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Alert$AlertListenerList

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.