use of org.eclipse.swt.widgets.MenuItem in project translationstudio8 by heartsome.
the class MenuItemProviders method clearToggleFilterRowMenuItemProvider.
public static IMenuItemProvider clearToggleFilterRowMenuItemProvider(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("toggle_filter"));
menuItem.setEnabled(true);
menuItem.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new ToggleFilterRowCommand());
}
});
}
};
}
use of org.eclipse.swt.widgets.MenuItem in project translationstudio8 by heartsome.
the class MenuItemProviders method columnStyleEditorMenuItemProvider.
public static IMenuItemProvider columnStyleEditorMenuItemProvider(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);
columnStyleEditor.setImage(GUIHelper.getImage("preferences"));
columnStyleEditor.setEnabled(true);
columnStyleEditor.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
int rowPosition = getNatEventData(event).getRowPosition();
int columnPosition = getNatEventData(event).getColumnPosition();
natTable.doCommand(new DisplayColumnStyleEditorCommand(natTable, natTable.getConfigRegistry(), columnPosition, rowPosition));
}
});
}
};
}
use of org.eclipse.swt.widgets.MenuItem in project translationstudio8 by heartsome.
the class MenuItemProviders method categoriesBasedColumnChooserMenuItemProvider.
public static IMenuItemProvider categoriesBasedColumnChooserMenuItemProvider(final String menuLabel) {
return new IMenuItemProvider() {
public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
MenuItem columnChooser = new MenuItem(popupMenu, SWT.PUSH);
columnChooser.setText(menuLabel);
columnChooser.setImage(GUIHelper.getImage("column_categories_chooser"));
columnChooser.setEnabled(true);
columnChooser.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new ChooseColumnsFromCategoriesCommand(natTable));
}
});
}
};
}
use of org.eclipse.swt.widgets.MenuItem in project translationstudio8 by heartsome.
the class MenuItemProviders method ungroupColumnsMenuItemProvider.
public static IMenuItemProvider ungroupColumnsMenuItemProvider() {
return new IMenuItemProvider() {
public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
MenuItem columnStyleEditor = new MenuItem(popupMenu, SWT.PUSH);
columnStyleEditor.setText("Ungroup columns");
columnStyleEditor.setEnabled(true);
columnStyleEditor.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
natTable.doCommand(new UngroupColumnCommand());
}
});
}
};
}
use of org.eclipse.swt.widgets.MenuItem in project translationstudio8 by heartsome.
the class MenuItemProviders method autoResizeRowMenuItemProvider.
public static IMenuItemProvider autoResizeRowMenuItemProvider() {
return new IMenuItemProvider() {
public void addMenuItem(final NatTable natTable, final Menu popupMenu) {
MenuItem autoResizeRows = new MenuItem(popupMenu, SWT.PUSH);
autoResizeRows.setText("Auto resize row");
autoResizeRows.setEnabled(true);
autoResizeRows.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
int rowPosition = getNatEventData(event).getRowPosition();
natTable.doCommand(new InitializeAutoResizeRowsCommand(natTable, rowPosition, natTable.getConfigRegistry(), new GC(natTable)));
}
});
}
};
}
Aggregations