Search in sources :

Example 1 with AlarmCategorySelectionDialog

use of org.netxms.ui.eclipse.alarmviewer.dialogs.AlarmCategorySelectionDialog in project netxms by netxms.

the class AlarmCategorySelector method selectionButtonHandler.

/*
    * (non-Javadoc)
    * 
    * @see org.netxms.ui.eclipse.widgets.AbstractSelector#selectionButtonHandler()
    */
@Override
protected void selectionButtonHandler() {
    AlarmCategorySelectionDialog dlg = new AlarmCategorySelectionDialog(getShell());
    if (dlg.open() == Window.OK) {
        categoryId.clear();
        AlarmCategory[] categories = dlg.getSelectedCategories();
        if ((categories != null) && (categories.length > 0)) {
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < categories.length; i++) {
                categoryId.add(categories[i].getId());
                sb.append(categories[i].getName() + "; ");
            }
            setText(sb.toString());
        } else {
            setText("<none>");
        }
    }
}
Also used : AlarmCategorySelectionDialog(org.netxms.ui.eclipse.alarmviewer.dialogs.AlarmCategorySelectionDialog) AlarmCategory(org.netxms.client.events.AlarmCategory)

Aggregations

AlarmCategory (org.netxms.client.events.AlarmCategory)1 AlarmCategorySelectionDialog (org.netxms.ui.eclipse.alarmviewer.dialogs.AlarmCategorySelectionDialog)1