Package org.apache.pivot.wtkx

Examples of org.apache.pivot.wtkx.WTKXSerializer$NamedObjectBindings


        private Component component = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "calendars.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here


        private Component component = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "color_choosers.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

        private Component component = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "navigation.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

        Action.NamedActionDictionary namedActions = Action.getNamedActions();

        namedActions.put("configureCell", new Action() {
            @Override
            public void perform(Component source) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Sheet sheet;

                // Make the cell component available to script blocks
                int rowIndex = tablePane.getRowAt(contextMenuHandler.getY());
                int columnIndex = tablePane.getColumnAt(contextMenuHandler.getX());
                Component component = tablePane.getCellComponent(rowIndex, columnIndex);
                wtkxSerializer.put("component", component);

                try {
                    sheet = (Sheet)wtkxSerializer.readObject(this, "table_panes_configure_cell.wtkx");
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                }

                sheet.open(window);
            }
        });

        namedActions.put("configureRow", new Action() {
            @Override
            public void perform(Component source) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Sheet sheet;

                // Make the selected row available to script blocks
                int rowIndex = tablePane.getRowAt(contextMenuHandler.getY());
                TablePane.Row row = tablePane.getRows().get(rowIndex);
                wtkxSerializer.put("row", row);

                try {
                    sheet = (Sheet)wtkxSerializer.readObject(this, "table_panes_configure_row.wtkx");
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                }

                sheet.open(window);
            }
        });

        namedActions.put("insertRow", new Action() {
            @Override
            public void perform(Component source) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Sheet sheet;

                // Create and insert a new row
                TablePane.Row row = new TablePane.Row();
                int rowIndex = tablePane.getRowAt(contextMenuHandler.getY());
                tablePane.getRows().insert(row, rowIndex);

                // Populate the row with the expected content
                row.add(new Label("-1"));
                for (int i = 1, n = tablePane.getColumns().getLength(); i < n; i++) {
                    Panel panel = new Panel();
                    panel.getStyles().put("backgroundColor", "#dddcd5");
                    row.add(panel);
                }

                // Make the new row available to script blocks
                wtkxSerializer.put("row", row);

                try {
                    sheet = (Sheet)wtkxSerializer.readObject(this, "table_panes_configure_row.wtkx");
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                }

                sheet.open(window);
            }
        });

        namedActions.put("removeRow", new Action() {
            @Override
            public void perform(Component source) {
                ArrayList<String> options = new ArrayList<String>("OK", "Cancel");
                String message = "Remove Row?";
                Label body = new Label("Are you sure you want to remove the row?");
                body.getStyles().put("wrapText", true);

                final Prompt prompt = new Prompt(MessageType.QUESTION, message, options, body);
                prompt.setSelectedOption(0);

                prompt.open(window, new SheetCloseListener() {
                    @Override
                    public void sheetClosed(Sheet sheet) {
                        if (prompt.getResult() && prompt.getSelectedOption() == 0) {
                            int rowIndex = tablePane.getRowAt(contextMenuHandler.getY());
                            tablePane.getRows().remove(rowIndex, 1);
                        }
                    }
                });
            }
        });

        namedActions.put("configureColumn", new Action() {
            @Override
            public void perform(Component source) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Sheet sheet;

                // Make the selected column available to script blocks
                int columnIndex = tablePane.getColumnAt(contextMenuHandler.getX());
                TablePane.Column column = tablePane.getColumns().get(columnIndex);
                wtkxSerializer.put("column", column);

                try {
                    sheet = (Sheet)wtkxSerializer.readObject(this, "table_panes_configure_column.wtkx");
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                }

                sheet.open(window);
            }
        });

        namedActions.put("insertColumn", new Action() {
            @Override
            public void perform(Component source) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                Sheet sheet;

                // Create and insert a new column
                TablePane.Column column = new TablePane.Column();
                int columnIndex = tablePane.getColumnAt(contextMenuHandler.getX());
                tablePane.getColumns().insert(column, columnIndex);

                // Populate the column with the expected content
                TablePane.RowSequence rows = tablePane.getRows();
                rows.get(0).insert(new Label("-1"), columnIndex);
                for (int i = 1, n = rows.getLength(); i < n; i++) {
                    Panel panel = new Panel();
                    panel.getStyles().put("backgroundColor", "#dddcd5");
                    rows.get(i).insert(panel, columnIndex);
                }

                // Make the new column available to script blocks
                wtkxSerializer.put("column", column);

                try {
                    sheet = (Sheet)wtkxSerializer.readObject(this, "table_panes_configure_column.wtkx");
                } catch (SerializationException exception) {
                    throw new RuntimeException(exception);
                } catch (IOException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

        private Component component = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "splitters.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

        });
    }

    @Override
    public void startup(Display display, Map<String, String> properties) throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "table_panes.wtkx");

        tablePane = (TablePane)wtkxSerializer.get("tablePane");
        cellSection = (Menu.Section)wtkxSerializer.get("cellSection");
        rowSection = (Menu.Section)wtkxSerializer.get("rowSection");
        columnSection = (Menu.Section)wtkxSerializer.get("columnSection");

        tablePane.setMenuHandler(contextMenuHandler);

        window.open(display);
    }
View Full Code Here

                        // Update the image
                        menuImageView.setImage(image);
                    }
                });

                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "menus.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }

                menuImageView = (ImageView)wtkxSerializer.get("menuImageView");
                helpAboutMenuItem  = (Menu.Item)wtkxSerializer.get("menuBar.helpAboutMenuItem");

                rollup.setContent(component);

                try {
                    menuSection = (Menu.Section)wtkxSerializer.readObject(this, "menu_section.wtkx");
                    imageMenuGroup = (ButtonGroup)wtkxSerializer.get("imageMenuGroup");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }
View Full Code Here

            public void perform(Component source) {
                Alert.alert(MessageType.INFO, "Action 2 performed.", window);
            }
        });

        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "action_mapping_test.wtkx");
        window.getActionMappings().add(new Window.ActionMapping(new Keyboard.KeyStroke(Keyboard.KeyCode.B,
            Keyboard.Modifier.SHIFT.getMask()), "action2"));

        window.open(display);
        window.requestFocus();
View Full Code Here

        private ActivityIndicator activityIndicator3 = null;

        @Override
        public Vote previewExpandedChange(Rollup rollup) {
            if (component == null) {
                WTKXSerializer wtkxSerializer = new WTKXSerializer();
                try {
                    component = (Component)wtkxSerializer.readObject(this, "meters.wtkx");
                } catch(IOException exception) {
                    throw new RuntimeException(exception);
                } catch(SerializationException exception) {
                    throw new RuntimeException(exception);
                }

                activityIndicator1 = (ActivityIndicator)wtkxSerializer.get("activityIndicator1");
                activityIndicator2 = (ActivityIndicator)wtkxSerializer.get("activityIndicator2");
                activityIndicator3 = (ActivityIndicator)wtkxSerializer.get("activityIndicator3");

                rollup.setContent(component);

                metersRollup.getRollupStateListeners().add(new RollupStateListener() {
                    @Override
View Full Code Here

    }

    @Override
    public void startup(Display display, Map<String, String> properties)
        throws Exception {
        WTKXSerializer wtkxSerializer = new WTKXSerializer();
        window = (Window)wtkxSerializer.readObject(this, "suggestion_popups.wtkx");
        stateTextInput = (TextInput)wtkxSerializer.get("stateTextInput");

        stateTextInput.getTextInputCharacterListeners().add(textInputCharacterListener);

        suggestionPopup.setListSize(4);
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtkx.WTKXSerializer$NamedObjectBindings

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.