Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Action$NamedActionDictionary


    private Frame frame = null;

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        Action action = new Action() {
            @Override
            public String getDescription() {
                return null;
            }

            @Override
            public void perform() {
                Alert.alert("Foo", frame);
            }
        };

        Action.getNamedActions().put("buttonAction", action);

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        frame = new Frame((Component)wtkxSerializer.readObject(getClass().getResource("spinner_focus_test.wtkx")));
        frame.setTitle("Spinner Focus Test");
        frame.open(display);

        Spinner spinner = (Spinner)wtkxSerializer.get("spinner");
        spinner.requestFocus();

        action.setEnabled(false);
    }
View Full Code Here


        private Menu.Section menuSection = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                Action.getNamedActions().put("selectImageAction", new Action() {
                    @Override
                    public String getDescription() {
                        return "Select Image Action";
                    }
View Full Code Here

public class Menus implements Application {
    private Window window = null;
    private TabPane tabPane = null;

    public Menus() {
        Action.getNamedActions().put("fileNew", new Action() {
            @Override
            public void perform() {
                // TODO Read document.wtkx

                Panel panel = new Panel();
                tabPane.getTabs().add(panel);
                TabPane.setLabel(panel, "Document " + tabPane.getTabs().getLength());
            }
        });

        Action.getNamedActions().put("fileOpen", new Action() {
            @Override
            public void perform() {
                FileBrowserSheet fileBrowserSheet = new FileBrowserSheet(FileBrowserSheet.Mode.OPEN);
                fileBrowserSheet.open(window);
            }
        });

        Action.getNamedActions().put("cut", new Action() {
            @Override
            public void perform() {
                TextInput textInput = (TextInput)window.getFocusDescendant();
                textInput.cut();
            }
        });

        Action.getNamedActions().put("copy", new Action() {
            @Override
            public void perform() {
                TextInput textInput = (TextInput)window.getFocusDescendant();
                textInput.copy();
            }
        });

        Action.getNamedActions().put("paste", new Action() {
            @Override
            public void perform() {
                TextInput textInput = (TextInput)window.getFocusDescendant();
                textInput.paste();
            }
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Action$NamedActionDictionary

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.