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

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


     * @return The {@link PopupMenuBuilder} that is used to build the groupBy
     *         header menu.
     */
    protected PopupMenuBuilder createGroupByHeaderMenu(NatTable natTable) {
        return new PopupMenuBuilder(natTable)
                .withMenuItemProvider(new IMenuItemProvider() {
                    @Override
                    public void addMenuItem(final NatTable natTable,
                            Menu popupMenu) {
                        MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
                        menuItem.setText(Messages
View Full Code Here


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

                            @Override
                            public void addMenuItem(NatTable natTable,
                                    Menu popupMenu) {
                                MenuItem menuItem = new MenuItem(popupMenu,
                                        SWT.PUSH);
                                menuItem.setText("Toggle Group By Header"); //$NON-NLS-1$
                                menuItem.setEnabled(true);

                                menuItem.addSelectionListener(new SelectionAdapter() {
                                    @Override
                                    public void widgetSelected(
                                            SelectionEvent event) {
                                        groupByHeaderLayer
                                                .setVisible(!groupByHeaderLayer
                                                        .isVisible());
                                    }
                                });
                            }
                        }).withMenuItemProvider(new IMenuItemProvider() {

                            @Override
                            public void addMenuItem(final NatTable natTable,
                                    Menu popupMenu) {
                                MenuItem menuItem = new MenuItem(popupMenu,
                                        SWT.PUSH);
                                menuItem.setText("Collapse All"); //$NON-NLS-1$
                                menuItem.setEnabled(true);

                                menuItem.addSelectionListener(new SelectionAdapter() {
                                    @Override
                                    public void widgetSelected(
                                            SelectionEvent event) {
                                        natTable.doCommand(new TreeCollapseAllCommand());
                                    }
                                });
                            }
                        }).withMenuItemProvider(new IMenuItemProvider() {

                            @Override
                            public void addMenuItem(final NatTable natTable,
                                    Menu popupMenu) {
                                MenuItem menuItem = new MenuItem(popupMenu,
View Full Code Here

                .getString("ColumnGroups.renameColumnGroup")); //$NON-NLS-1$
    }

    public static IMenuItemProvider renameColumnGroupMenuItemProvider(
            final String menuLabel) {
        return new IMenuItemProvider() {

            public void addMenuItem(final NatTable natTable,
                    final Menu popupMenu) {
                MenuItem columnStyleEditor = new MenuItem(popupMenu, SWT.PUSH);
                columnStyleEditor.setText(menuLabel);
View Full Code Here

                .getString("ColumnGroups.removeColumnGroup")); //$NON-NLS-1$
    }

    public static IMenuItemProvider removeColumnGroupMenuItemProvider(
            final String menuLabel) {
        return new IMenuItemProvider() {

            public void addMenuItem(final NatTable natTable,
                    final Menu popupMenu) {
                MenuItem columnStyleEditor = new MenuItem(popupMenu, SWT.PUSH);
                columnStyleEditor.setText(menuLabel);
View Full Code Here

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

                            @Override
                            public void addMenuItem(NatTable natTable,
                                    Menu popupMenu) {
                                MenuItem menuItem = new MenuItem(popupMenu,
View Full Code Here

            });
        }

        protected PopupMenuBuilder createBodyMenu(final NatTable natTable) {
            return new PopupMenuBuilder(natTable).withMenuItemProvider(
                    new IMenuItemProvider() {
                        @Override
                        public void addMenuItem(final NatTable natTable,
                                Menu popupMenu) {
                            MenuItem menuItem = new MenuItem(popupMenu,
                                    SWT.PUSH);
View Full Code Here

TOP

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

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.