Package org.apache.pivot.beans

Examples of org.apache.pivot.beans.BeanDictionary


            if (columnName != null) {
                Dictionary<String, Object> rowData;
                if (value instanceof Dictionary<?, ?>) {
                    rowData = (Dictionary<String, Object>)value;
                } else {
                    rowData = new BeanDictionary(value);
                }

                Object cellData = rowData.get(columnName);

                if (cellData instanceof Number) {
View Full Code Here


        Object tableRow = tableView.getTableData().get(rowIndex);
        Dictionary<String, Object> rowData;
        if (tableRow instanceof Dictionary<?, ?>) {
            rowData = (Dictionary<String, Object>)tableRow;
        } else {
            BeanDictionary beanDictionary = new BeanDictionary(tableRow);
            isReadOnly = beanDictionary.isReadOnly(columnName);
            rowData = beanDictionary;
        }

        if (isReadOnly) {
            // Don't initiate the edit
View Full Code Here

        Object tableRow = tableData.get(rowIndex);
        Dictionary<String, Object> rowData;
        if (tableRow instanceof Dictionary<?, ?>) {
            rowData = (Dictionary<String, Object>)tableRow;
        } else {
            rowData = new BeanDictionary(tableRow);
        }

        // Update the cell data
        String text = textInput.getText();
        String columnName = tableView.getColumns().get(columnIndex).getName();
View Full Code Here

            if (columnName != null) {
                Dictionary<String, Object> rowData;
                if (value instanceof Dictionary<?, ?>) {
                    rowData = (Dictionary<String, Object>)value;
                } else {
                    rowData = new BeanDictionary(value);
                }

                Object cellData = rowData.get(columnName);

                if (cellData instanceof Date) {
View Full Code Here

            if (columnName != null) {
                Dictionary<String, Object> rowData;
                if (value instanceof Dictionary<?, ?>) {
                    rowData = (Dictionary<String, Object>)value;
                } else {
                    rowData = new BeanDictionary(value);
                }

                cellData = rowData.get(columnName);
            }
View Full Code Here

        }

        // Get the row data, represented as a Dictionary
        Object tableRow = tableView.getTableData().get(rowIndex);
        Dictionary<String, Object> rowData;
        BeanDictionary beanDictionary = null;
        if (tableRow instanceof Dictionary<?, ?>) {
            rowData = (Dictionary<String, Object>)tableRow;
        } else {
            beanDictionary = new BeanDictionary(tableRow);
            rowData = beanDictionary;
        }

        // Match the table pane's columns to the table view's
        TableView.ColumnSequence tableViewColumns = tableView.getColumns();
        TablePane.ColumnSequence tablePaneColumns = editorTablePane.getColumns();
        TablePane.Row tablePaneRow = editorTablePane.getRows().get(0);

        for (int i = 0, n = tableViewColumns.getLength(); i < n; i++) {
            // Add a new column to the table pane to match the table view column
            TablePane.Column tablePaneColumn = new TablePane.Column();
            tablePaneColumns.add(tablePaneColumn);

            // Size the table pane column to match that of the table view
            // column. We get the real-time column width from the table view as
            // opposed to the width property of the column, because the latter
            // may represent a relative width, and we need the actual width
            int columnWidth = tableView.getColumnBounds(i).width;
            tablePaneColumn.setWidth(columnWidth, false);

            // Determine which component to use as the editor for this column
            String columnName = tableViewColumns.get(i).getName();
            Component editorComponent = cellEditors.get(columnName);

            // Default to a TextInput editor
            if (editorComponent == null) {
                TextInput editorTextInput = new TextInput();
                editorTextInput.setTextKey(columnName);
                editorComponent = editorTextInput;
            }

            // Disable the component for read-only properties
            if (beanDictionary != null
                && beanDictionary.isReadOnly(columnName)) {
                editorComponent.setEnabled(false);
            }

            // Add the editor component to the table pane
            tablePaneRow.add(editorComponent);
View Full Code Here

        Object tableRow = tableData.get(rowIndex);
        Dictionary<String, Object> rowData;
        if (tableRow instanceof Dictionary<?, ?>) {
            rowData = (Dictionary<String, Object>)tableRow;
        } else {
            rowData = new BeanDictionary(tableRow);
        }

        // Update the row data using data binding
        editorTablePane.store(rowData);
View Full Code Here

            if (columnName != null) {
                Dictionary<String, Object> rowData;
                if (value instanceof Dictionary<?, ?>) {
                    rowData = (Dictionary<String, Object>)value;
                } else {
                    rowData = new BeanDictionary(value);
                }

                cellData = rowData.get(columnName);
            }
View Full Code Here

            && context.containsKey(contextKey)) {
            Object value = context.get(contextKey);
            if (value instanceof Dictionary<?, ?>) {
                context = (Map<String, Object>)value;
            } else {
                context = new BeanDictionary(value);
            }
        }

        for (Component component : components) {
            component.load(context);
View Full Code Here

                // Bound value is expected to be a sub-context
                Object value = context.get(contextKey);
                if (value instanceof Dictionary<?, ?>) {
                    context = (Map<String, Object>)value;
                } else {
                    context = new BeanDictionary(value);
                }
            }

            for (Component component : components) {
                component.store(context);
View Full Code Here

TOP

Related Classes of org.apache.pivot.beans.BeanDictionary

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.