Package org.eclipse.nebula.widgets.nattable.data.convert

Examples of org.eclipse.nebula.widgets.nattable.data.convert.DefaultDoubleDisplayConverter


                DisplayMode.EDIT, EditorExample.COLUMN_SIX_LABEL);

        // don't forget to register the Double converter!
        configRegistry.registerConfigAttribute(
                CellConfigAttributes.DISPLAY_CONVERTER,
                new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                EditorExample.COLUMN_SIX_LABEL);
    }
View Full Code Here


                        .setCategory("C1"),

                new TableColumn(5, "bidPrice", "Bid price")
                        .setEditor(Editors.getTextEditor())
                        .setDisplayConverter(
                                new DefaultDoubleDisplayConverter())
                        .setGroupName("Pricing").setCategory("C1"),

                new TableColumn(6, "askPrice", "Ask price")
                        .setGroupName("Pricing")
                        .setDisplayConverter(
View Full Code Here

                    _4222_CellPainterExample.COLUMN_SIX_LABEL);

            // don't forget to register the Double converter!
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                    _4222_CellPainterExample.COLUMN_SIX_LABEL);
        }
View Full Code Here

    public void settingThresholdValuesUpdatedFilter() {
        // Since we are triggering object comparison, we must provide the right
        // type
        configRegistry.registerConfigAttribute(
                FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
                new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 5);
        // We also have to set the text matching mode
        configRegistry.registerConfigAttribute(
                FilterRowConfigAttributes.TEXT_MATCHING_MODE,
                TextMatchingMode.REGULAR_EXPRESSION, DisplayMode.NORMAL,
View Full Code Here

                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 3);

                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new DefaultDoubleDisplayConverter(),
                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 3);

                // the main styling of the summary row cell in the row header is
                // done via
                // summary row default style, but we need to override the
                // alignment
                style = new Style();
                style.setAttributeValue(
                        CellStyleAttributes.HORIZONTAL_ALIGNMENT,
                        HorizontalAlignmentEnum.CENTER);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, style,
                        DisplayMode.NORMAL, ROW_HEADER_SUMMARY_ROW);
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.CELL_STYLE, style,
                        DisplayMode.SELECT, ROW_HEADER_SUMMARY_ROW);
            }
        });

        // add sorting configuration
        natTable.addConfiguration(new SingleClickSortConfiguration());

        this.sumMoneyGroupBySummaryProvider = new SummationGroupBySummaryProvider<ExtendedPersonWithAddress>(
                columnPropertyAccessor);
        this.avgMoneyGroupBySummaryProvider = new AverageMoneyGroupBySummaryProvider();

        // create a new IDataProvider that operates on the basic underlying list
        // this is necessary because the IDataProvider in the body layer stack
        // is operating
        // on the TreeList, and on collapsing a node, the children will be not
        // visible, which
        // has effect on the summary value.
        final IDataProvider summaryDataProvider = new ListDataProvider<ExtendedPersonWithAddress>(
                persons, columnPropertyAccessor);
        this.sumMoneySummaryProvider = new SummationSummaryProvider(
                summaryDataProvider, false);
        this.avgMoneySummaryProvider = new AverageMoneySummaryProvider(
                summaryDataProvider);

        // add group by summary configuration
        natTable.addConfiguration(new AbstractRegistryConfiguration() {

            @Override
            public void configureRegistry(IConfigRegistry configRegistry) {
                // GroupBy summary configuration
                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_SUMMARY_PROVIDER,
                        _809_GroupBySummarySummaryRowExample.this.sumMoneyGroupBySummaryProvider, DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_COLUMN_PREFIX + 3);

                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_SUMMARY_PROVIDER,
                        new AverageAgeGroupBySummaryProvider(),
                        DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_COLUMN_PREFIX + 2);

                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_CHILD_COUNT_PATTERN,
                        "[{0}] - ({1})");

                // set a custom display converter to the money groupby column
                // that transforms the values correctly localized
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new SummaryDisplayConverter(
                                new DefaultDoubleDisplayConverter()),
                        DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_SUMMARY_COLUMN_PREFIX + 3);

                // SummaryRow configuration
                configRegistry
                        .registerConfigAttribute(
                                SummaryRowConfigAttributes.SUMMARY_PROVIDER,
                                _809_GroupBySummarySummaryRowExample.this.sumMoneySummaryProvider,
                                DisplayMode.NORMAL,
                                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 3);

                configRegistry
                        .registerConfigAttribute(
                                SummaryRowConfigAttributes.SUMMARY_PROVIDER,
                                new AverageAgeSummaryProvider(
                                        summaryDataProvider),
                                DisplayMode.NORMAL,
                                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 2);

                configRegistry
                        .registerConfigAttribute(
                                CellConfigAttributes.DISPLAY_CONVERTER,
                                new SummaryDisplayConverter(
                                        new DefaultDoubleDisplayConverter()),
                                DisplayMode.NORMAL,
                                SummaryRowLayer.DEFAULT_SUMMARY_COLUMN_CONFIG_LABEL_PREFIX + 3);
            }
        });
View Full Code Here

                // that transforms the
                // values correctly localized
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new SummaryDisplayConverter(
                                new DefaultDoubleDisplayConverter()),
                        DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_SUMMARY_COLUMN_PREFIX + 3);
            }
        });
View Full Code Here

                    _804_GlazedListsEditorExample.COLUMN_SIX_LABEL);

            // don't forget to register the Double converter!
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                    _804_GlazedListsEditorExample.COLUMN_SIX_LABEL);
        }
View Full Code Here

                    DisplayMode.EDIT, _447_EditorExample.COLUMN_SIX_LABEL);

            // don't forget to register the Double converter!
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                    _447_EditorExample.COLUMN_SIX_LABEL);
        }
View Full Code Here

                        new CheckBoxPainter(), DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 4);

                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new DefaultDoubleDisplayConverter(),
                        DisplayMode.NORMAL,
                        ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 3);
            }
        });

        // add sorting configuration
        natTable.addConfiguration(new SingleClickSortConfiguration());

        sumMoneySummaryProvider = new SummationGroupBySummaryProvider<ExtendedPersonWithAddress>(
                columnPropertyAccessor);
        avgMoneySummaryProvider = new AverageMoneyGroupBySummaryProvider();

        // add group by summary configuration
        natTable.addConfiguration(new AbstractRegistryConfiguration() {

            @Override
            public void configureRegistry(IConfigRegistry configRegistry) {
                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_SUMMARY_PROVIDER,
                        sumMoneySummaryProvider, DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_COLUMN_PREFIX + 3);

                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_SUMMARY_PROVIDER,
                        new AverageAgeGroupBySummaryProvider(),
                        DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_COLUMN_PREFIX + 2);

                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_CHILD_COUNT_PATTERN,
                        "[{0}] - ({1})");

                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_HINT,
                        "Drag columns here");

                Style hintStyle = new Style();
                hintStyle.setAttributeValue(CellStyleAttributes.FONT, GUIHelper
                        .getFont(new FontData("Arial", 10, SWT.ITALIC)));
                configRegistry.registerConfigAttribute(
                        GroupByConfigAttributes.GROUP_BY_HINT_STYLE, hintStyle);

                // register a groupBy double display converter to avoid
                // rendering rounding issues
                configRegistry.registerConfigAttribute(
                        CellConfigAttributes.DISPLAY_CONVERTER,
                        new SummaryDisplayConverter(
                                new DefaultDoubleDisplayConverter()),
                        DisplayMode.NORMAL,
                        GroupByDataLayer.GROUP_BY_SUMMARY_COLUMN_PREFIX + 3);
            }
        });
View Full Code Here

                    new DefaultIntegerDisplayConverter(), DisplayMode.NORMAL,
                    ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 1);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL,
                    ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 2);

            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new GenderDisplayConverter(), DisplayMode.NORMAL,
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.data.convert.DefaultDoubleDisplayConverter

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.