use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmCategoryList in project netxms by netxms.
the class AlarmCategorySelectionDialog method createDialogArea.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.horizontalSpacing = WidgetHelper.OUTER_SPACING;
layout.numColumns = 2;
dialogArea.setLayout(layout);
// Create filter area
filterText = new FilterText(dialogArea, SWT.NONE, null, false);
filterText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onFilterModify();
}
});
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
filterText.setLayoutData(gd);
alarmCategoryList = new AlarmCategoryList(dialogArea, SWT.NONE, TABLE_CONFIG_PREFIX, false);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
gd.horizontalSpan = 2;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 350;
alarmCategoryList.setLayoutData(gd);
alarmCategoryList.getViewer().addDoubleClickListener(new IDoubleClickListener() {
@Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
return dialogArea;
}
use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmCategoryList 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