use of org.eclipse.linuxtools.systemtap.graphing.core.filters.IDataSetFilter in project linuxtools by eclipse.
the class DataGrid method initMenus.
private Menu initMenus() {
Menu menu = new Menu(table.getShell(), SWT.POP_UP);
Menu formatMenu = new Menu(menu);
formatMenuItem = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
formatMenuItem.setText(Localization.getString("DataGrid.FormatAs"));
formatMenuItem.setMenu(formatMenu);
filterMenu = new Menu(menu);
MenuItem item = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
item.setText(Localization.getString("DataGrid.AddFilter"));
item.addSelectionListener(new AddFilterSelection());
removeFiltersMenuItem = new MenuItem(menu, SWT.CASCADE);
// $NON-NLS-1$
removeFiltersMenuItem.setText(Localization.getString("DataGrid.RemoveFilter"));
removeFiltersMenuItem.setMenu(filterMenu);
IDataSetFilter[] filters = filteredDataSet.getFilters();
if (filters != null && filters.length > 0) {
for (int i = 0; i < filters.length; i++) {
item = new MenuItem(filterMenu, SWT.CASCADE);
item.setText(AvailableFilterTypes.getFilterName(filters[i].getID()));
item.setData(filters[i]);
item.addSelectionListener(new RemoveFilterSelection());
}
} else {
removeFiltersMenuItem.setEnabled(false);
}
autoResizeMenuItem = new MenuItem(menu, SWT.CHECK);
// $NON-NLS-1$
autoResizeMenuItem.setText(Localization.getString("DataGrid.AutoResize"));
autoResizeMenuItem.setSelection(prefs.getBoolean(GraphingPreferenceConstants.P_AUTO_RESIZE));
jumpToEntryMenuItem = new MenuItem(menu, SWT.CHECK);
// $NON-NLS-1$
jumpToEntryMenuItem.setText(Localization.getString("DataGrid.JumpToEntry"));
jumpToEntryMenuItem.setSelection(prefs.getBoolean(GraphingPreferenceConstants.P_JUMP_NEW_TABLE_ENTRY));
for (int i = 0; i < IFormattingStyles.FORMAT_TITLES.length; i++) {
item = new MenuItem(formatMenu, SWT.RADIO);
item.setText(IFormattingStyles.FORMAT_TITLES[i]);
item.addSelectionListener(new MenuFormatSelection());
}
formatMenuItem.setEnabled(filteredDataSet.getRowCount() > 0);
formatMenu.addMenuListener(new FormatMenuListener());
return menu;
}
use of org.eclipse.linuxtools.systemtap.graphing.core.filters.IDataSetFilter in project linuxtools by eclipse.
the class FilteredRowDataSetTest method testGetFilters.
@Test
public void testGetFilters() {
assertEquals(0, fdata.getFilters().length);
RangeFilter filter1 = new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
SortFilter filter2 = new SortFilter(2, SortFilter.ASCENDING);
fdata.addFilter(filter1);
fdata.addFilter(filter2);
IDataSetFilter[] filters = fdata.getFilters();
assertEquals(2, filters.length);
}
use of org.eclipse.linuxtools.systemtap.graphing.core.filters.IDataSetFilter in project linuxtools by eclipse.
the class FilteredTableDataSetTest method testGetFilters.
@Test
public void testGetFilters() {
assertEquals(0, dataSet.getFilters().length);
RangeFilter filter1 = new RangeFilter(0, 3, 5, RangeFilter.INCLUSIVE | RangeFilter.INSIDE_BOUNDS);
SortFilter filter2 = new SortFilter(2, SortFilter.ASCENDING);
dataSet.addFilter(filter1);
dataSet.addFilter(filter2);
IDataSetFilter[] filters = dataSet.getFilters();
assertEquals(2, filters.length);
}
Aggregations