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));
}
});
}
};
}
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());
}
});
}
};
}
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());
}
});
}
};
}
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)));
}
});
}
};
}
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()));
}
});
}
};
}
Aggregations