use of org.netxms.ui.eclipse.alarmviewer.widgets.helpers.AlarmCategoryListFilter in project netxms by netxms.
the class AlarmCategoryConfigurator method createPartControl.
@Override
public void createPartControl(Composite parent) {
FormLayout formLayout = new FormLayout();
parent.setLayout(formLayout);
// Create filter area
filterText = new FilterText(parent, SWT.NONE, null, true);
filterText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onFilterModify();
}
});
filterText.setCloseAction(new Action() {
@Override
public void run() {
enableFilter(false);
actionShowFilter.setChecked(false);
}
});
dataView = new AlarmCategoryList(this, parent, SWT.NONE, TABLE_CONFIG_PREFIX, true);
filter = new AlarmCategoryListFilter();
dataView.getViewer().addFilter(filter);
// Setup layout
FormData fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(filterText);
fd.right = new FormAttachment(100, 0);
fd.bottom = new FormAttachment(100, 0);
dataView.setLayoutData(fd);
fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
filterText.setLayoutData(fd);
dataView.getViewer().addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
dataView.editCategory();
}
});
// Get filter settings
final IDialogSettings ds = Activator.getDefault().getDialogSettings();
initShowfilter = safeCast(ds.get(TABLE_CONFIG_PREFIX + "initShowfilter"), ds.getBoolean(TABLE_CONFIG_PREFIX + "initShowfilter"), initShowfilter);
// Set initial focus to filter input line
if (initShowfilter)
filterText.setFocus();
else
// Will hide filter area correctly
enableFilter(false);
createActions();
contributeToActionBars();
activateContext();
}
Aggregations