Package org.eclipse.nebula.widgets.nattable.ui.menu

Examples of org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration


        // add the
        // DefaultNatTableStyleConfiguration and the ConfigRegistry manually
        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createCornerMenu(NatTable natTable) {
                return super.createCornerMenu(natTable)
                        .withStateManagerMenuItemProvider();
            }
View Full Code Here


        final DataLayer n4DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n4DataLayer.setColumnPercentageSizing(true);
        n4DataLayer.setRowPercentageSizing(true);
        final NatTable n4 = new NatTable(gridPanel, gridLayer, false);
        n4.addConfiguration(new DefaultNatTableStyleConfiguration());
        n4.addConfiguration(new HeaderMenuConfiguration(n4));
        n4.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n4);

        // example for fixed percentage sizing in a grid
        // ensure that the sum of column sizes is not greater than 100
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer n5DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n5DataLayer.setColumnWidthByPosition(0, 25);
        n5DataLayer.setColumnWidthByPosition(1, 25);
        n5DataLayer.setColumnWidthByPosition(2, 50);
        n5DataLayer.setColumnPercentageSizing(true);
        final NatTable n5 = new NatTable(gridPanel, gridLayer, false);
        n5.addConfiguration(new DefaultNatTableStyleConfiguration());
        n5.addConfiguration(new HeaderMenuConfiguration(n5));
        n5.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n5);

        // example for mixed percentage sizing in a grid
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer n6DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n6DataLayer.setColumnWidthByPosition(0, 20);
        n6DataLayer.setColumnWidthByPosition(2, 20);
        n6DataLayer.setColumnPercentageSizing(true);
        final NatTable n6 = new NatTable(gridPanel, gridLayer, false);
        n6.addConfiguration(new DefaultNatTableStyleConfiguration());
        n6.addConfiguration(new HeaderMenuConfiguration(n6));
        n6.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n6);

        // example for mixed fixed/percentage sizing in a grid
        // configure not every column with the exact percentage value, this way
        // the columns for which
        // no exact values are set will use the remaining space
        gridLayer = new DummyGridLayerStack(dataProvider);
        final DataLayer mixGridDataLayer = (DataLayer) gridLayer
                .getBodyDataLayer();
        mixGridDataLayer.setColumnPercentageSizing(true);
        mixGridDataLayer.setColumnPercentageSizing(0, false);
        mixGridDataLayer.setColumnPercentageSizing(1, false);
        mixGridDataLayer.setColumnWidthByPosition(0, 100);
        mixGridDataLayer.setColumnWidthByPosition(1, 100);
        final NatTable mixGrid = new NatTable(gridPanel, gridLayer, false);
        mixGrid.addConfiguration(new DefaultNatTableStyleConfiguration());
        mixGrid.addConfiguration(new HeaderMenuConfiguration(mixGrid));
        mixGrid.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(mixGrid);

        Button addColumnButton = new Button(buttonPanel, SWT.PUSH);
        addColumnButton.setText("add column - no width");
View Full Code Here

                gc.setForeground(beforeColor);
            }
        });

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));
        natTable.configure();

        return composite;
    }
View Full Code Here

        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        // add filter row configuration
        natTable.addConfiguration(new FilterRowConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createCornerMenu(NatTable natTable) {
                return super.createCornerMenu(natTable)
                        .withStateManagerMenuItemProvider();
            }
View Full Code Here

        // by the ViewportLayer. Without the ViewportLayer the scrollbars will
        // always be visible with the default style bits of NatTable.
        final NatTable n4 = new NatTable(
                gridPanel, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED, gridLayer, false);
        n4.addConfiguration(new DefaultNatTableStyleConfiguration());
        n4.addConfiguration(new HeaderMenuConfiguration(n4));
        n4.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n4);

        // example for fixed percentage sizing in a grid
        // ensure that the sum of column sizes is not greater than 100
        gridLayer = new SimpleGridLayer(dataProvider);
        final DataLayer n5DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n5DataLayer.setColumnWidthByPosition(0, 25);
        n5DataLayer.setColumnWidthByPosition(1, 25);
        n5DataLayer.setColumnWidthByPosition(2, 50);
        n5DataLayer.setColumnPercentageSizing(true);
        // use different style bits to avoid rendering of inactive scrollbars
        // for small table when using percentage sizing, typically there should
        // be no scrollbars, as the table should take the available space
        // Note: The enabling/disabling and showing of the scrollbars is handled
        // by the ViewportLayer. Without the ViewportLayer the scrollbars will
        // always be visible with the default style bits of NatTable.
        final NatTable n5 = new NatTable(
                gridPanel, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED, gridLayer, false);
        n5.addConfiguration(new DefaultNatTableStyleConfiguration());
        n5.addConfiguration(new HeaderMenuConfiguration(n5));
        n5.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n5);

        // example for mixed percentage sizing in a grid configure not every
        // column with the exact percentage value, this way the columns for
        // which no exact values are set will use the remaining space
        gridLayer = new SimpleGridLayer(dataProvider);
        final DataLayer n6DataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        n6DataLayer.setColumnWidthByPosition(0, 20);
        n6DataLayer.setColumnWidthByPosition(2, 20);
        n6DataLayer.setColumnPercentageSizing(true);
        // use different style bits to avoid rendering of inactive scrollbars
        // for small table when using percentage sizing, typically there should
        // be no scrollbars, as the table should take the available space
        // Note: The enabling/disabling and showing of the scrollbars is handled
        // by the ViewportLayer. Without the ViewportLayer the scrollbars will
        // always be visible with the default style bits of NatTable.
        final NatTable n6 = new NatTable(
                gridPanel, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED, gridLayer, false);
        n6.addConfiguration(new DefaultNatTableStyleConfiguration());
        n6.addConfiguration(new HeaderMenuConfiguration(n6));
        n6.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(n6);

        // example for mixed fixed/percentage sizing in a grid configure not
        // every column with the exact percentage value, this way the columns
        // for which no exact values are set will use the remaining space
        gridLayer = new SimpleGridLayer(dataProvider);
        final DataLayer mixGridDataLayer = (DataLayer) gridLayer.getBodyDataLayer();
        mixGridDataLayer.setColumnPercentageSizing(true);
        mixGridDataLayer.setColumnPercentageSizing(0, false);
        mixGridDataLayer.setColumnPercentageSizing(1, false);
        mixGridDataLayer.setColumnWidthByPosition(0, 100);
        mixGridDataLayer.setColumnWidthByPosition(1, 100);
        // use different style bits to avoid rendering of inactive scrollbars
        // for small table when using percentage sizing, typically there should
        // be no scrollbars, as the table should take the available space
        // Note: The enabling/disabling and showing of the scrollbars is handled
        // by the ViewportLayer. Without the ViewportLayer the scrollbars will
        // always be visible with the default style bits of NatTable.
        final NatTable mixGrid = new NatTable(
                gridPanel, SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE | SWT.DOUBLE_BUFFERED, gridLayer, false);
        mixGrid.addConfiguration(new DefaultNatTableStyleConfiguration());
        mixGrid.addConfiguration(new HeaderMenuConfiguration(mixGrid));
        mixGrid.configure();
        GridDataFactory.fillDefaults().grab(true, true).applyTo(mixGrid);

        Button addColumnButton = new Button(buttonPanel, SWT.PUSH);
        addColumnButton.setText("add column - no width");
View Full Code Here

        // add group by configuration
        natTable.addConfiguration(new GroupByHeaderMenuConfiguration(natTable,
                groupByHeaderLayer));
        natTable.addConfiguration(new MyRowObjectTableConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createCornerMenu(NatTable natTable) {
                return super.createCornerMenu(natTable)
                        .withStateManagerMenuItemProvider()
                        .withMenuItemProvider(new IMenuItemProvider() {
View Full Code Here

        // as the autoconfiguration of the NatTable is turned off, we have to
        // add the
        // DefaultNatTableStyleConfiguration manually
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
                return super.createColumnHeaderMenu(natTable)
                        .withColumnChooserMenuItem();
            }
View Full Code Here

        natTable.setConfigRegistry(configRegistry);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        // add filter row configuration
        natTable.addConfiguration(new FilterRowConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) {
                return super.createColumnHeaderMenu(natTable)
                        .withColumnChooserMenuItem();
            }
View Full Code Here

        GridLayer gridLayer = new GridLayer(viewportLayer, columnHeaderLayer,
                rowGroupHeaderLayer, cornerLayer);

        NatTable natTable = new NatTable(parent, gridLayer, false);
        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        natTable.addConfiguration(new HeaderMenuConfiguration(natTable));

        natTable.configure();

        natTable.setTheme(new ModernNatTableThemeConfiguration());
View Full Code Here

        natTable.addConfiguration(new DefaultNatTableStyleConfiguration());
        // add filter row configuration
        natTable.addConfiguration(new FilterRowConfiguration());
        natTable.addConfiguration(new MyRowObjectTableConfiguration());

        natTable.addConfiguration(new HeaderMenuConfiguration(natTable) {
            @Override
            protected PopupMenuBuilder createCornerMenu(NatTable natTable) {
                return super.createCornerMenu(natTable)
                        .withStateManagerMenuItemProvider();
            }
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration

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.