Search in sources :

Example 11 with NatTable

use of net.sourceforge.nattable.NatTable in project translationstudio8 by heartsome.

the class MenuItemProviders method hideColumnMenuItemProvider.

public static IMenuItemProvider hideColumnMenuItemProvider() {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
            menuItem.setText("Hide column");
            menuItem.setImage(GUIHelper.getImage("hide_column"));
            menuItem.setEnabled(true);
            menuItem.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent event) {
                    int columnPosition = getNatEventData(event).getColumnPosition();
                    natTable.doCommand(new ColumnHideCommand(natTable, columnPosition));
                }
            });
        }
    };
}
Also used : ColumnHideCommand(net.sourceforge.nattable.hideshow.command.ColumnHideCommand) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu)

Example 12 with NatTable

use of net.sourceforge.nattable.NatTable in project translationstudio8 by heartsome.

the class MenuItemProviders method clearAllFiltersMenuItemProvider.

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

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem menuItem = new MenuItem(popupMenu, SWT.PUSH);
            menuItem.setText(menuLabel);
            menuItem.setImage(GUIHelper.getImage("remove_filter"));
            menuItem.setEnabled(true);
            menuItem.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    natTable.doCommand(new ClearAllFiltersCommand());
                }
            });
        }
    };
}
Also used : ClearAllFiltersCommand(net.sourceforge.nattable.filterrow.command.ClearAllFiltersCommand) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu)

Example 13 with NatTable

use of net.sourceforge.nattable.NatTable in project translationstudio8 by heartsome.

the class MenuItemProviders method showAllColumnMenuItemProvider.

public static IMenuItemProvider showAllColumnMenuItemProvider() {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, Menu popupMenu) {
            MenuItem showAllColumns = new MenuItem(popupMenu, SWT.PUSH);
            showAllColumns.setText("Show all columns");
            showAllColumns.setImage(GUIHelper.getImage("show_column"));
            showAllColumns.setEnabled(true);
            showAllColumns.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    natTable.doCommand(new ShowAllColumnsCommand());
                }
            });
        }
    };
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) ShowAllColumnsCommand(net.sourceforge.nattable.hideshow.command.ShowAllColumnsCommand) Menu(org.eclipse.swt.widgets.Menu)

Example 14 with NatTable

use of net.sourceforge.nattable.NatTable in project translationstudio8 by heartsome.

the class MenuItemProviders method autoResizeColumnMenuItemProvider.

public static IMenuItemProvider autoResizeColumnMenuItemProvider() {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem autoResizeColumns = new MenuItem(popupMenu, SWT.PUSH);
            autoResizeColumns.setText("Auto resize column");
            autoResizeColumns.setImage(GUIHelper.getImage("auto_resize"));
            autoResizeColumns.setEnabled(true);
            autoResizeColumns.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent event) {
                    int columnPosition = getNatEventData(event).getColumnPosition();
                    natTable.doCommand(new InitializeAutoResizeColumnsCommand(natTable, columnPosition, natTable.getConfigRegistry(), new GC(natTable)));
                }
            });
        }
    };
}
Also used : SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) InitializeAutoResizeColumnsCommand(net.sourceforge.nattable.resize.command.InitializeAutoResizeColumnsCommand) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu) GC(org.eclipse.swt.graphics.GC)

Example 15 with NatTable

use of net.sourceforge.nattable.NatTable in project translationstudio8 by heartsome.

the class MenuItemProviders method createColumnGroupMenuItemProvider.

public static IMenuItemProvider createColumnGroupMenuItemProvider() {
    return new IMenuItemProvider() {

        public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
            MenuItem columnStyleEditor = new MenuItem(popupMenu, SWT.PUSH);
            columnStyleEditor.setText("Create column group");
            columnStyleEditor.setEnabled(true);
            columnStyleEditor.addSelectionListener(new SelectionAdapter() {

                @Override
                public void widgetSelected(SelectionEvent e) {
                    natTable.doCommand(new OpenCreateColumnGroupDialog(natTable.getShell()));
                }
            });
        }
    };
}
Also used : OpenCreateColumnGroupDialog(net.sourceforge.nattable.group.command.OpenCreateColumnGroupDialog) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) NatTable(net.sourceforge.nattable.NatTable) MenuItem(org.eclipse.swt.widgets.MenuItem) Menu(org.eclipse.swt.widgets.Menu)

Aggregations

NatTable (net.sourceforge.nattable.NatTable)19 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)14 SelectionEvent (org.eclipse.swt.events.SelectionEvent)14 Menu (org.eclipse.swt.widgets.Menu)14 MenuItem (org.eclipse.swt.widgets.MenuItem)14 GC (org.eclipse.swt.graphics.GC)3 IConfigRegistry (net.sourceforge.nattable.config.IConfigRegistry)2 ILayer (net.sourceforge.nattable.layer.ILayer)2 InitializeAutoResizeColumnsCommand (net.sourceforge.nattable.resize.command.InitializeAutoResizeColumnsCommand)2 Point (org.eclipse.swt.graphics.Point)2 Language (net.heartsome.cat.common.locale.Language)1 XLIFFEditorImplWithNatTable (net.heartsome.cat.ts.ui.xliffeditor.nattable.editor.XLIFFEditorImplWithNatTable)1 AutoResizeCurrentRowsCommandHandler (net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.AutoResizeCurrentRowsCommandHandler)1 UpdateDataAndAutoResizeCommandHandler (net.heartsome.cat.ts.ui.xliffeditor.nattable.handler.UpdateDataAndAutoResizeCommandHandler)1 HorizontalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.HorizontalViewportLayer)1 RowHeightCalculator (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.RowHeightCalculator)1 VerticalViewportLayer (net.heartsome.cat.ts.ui.xliffeditor.nattable.layer.VerticalViewportLayer)1 BodyMenuConfiguration (net.heartsome.cat.ts.ui.xliffeditor.nattable.menu.BodyMenuConfiguration)1 FindReplaceCommandHandler (net.heartsome.cat.ts.ui.xliffeditor.nattable.search.command.FindReplaceCommandHandler)1 ActiveCellRegion (net.heartsome.cat.ts.ui.xliffeditor.nattable.search.coordinate.ActiveCellRegion)1