use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList in project netxms by netxms.
the class AlarmReminderDialog 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;
dialogArea.setLayout(layout);
// $NON-NLS-1$
AlarmList list = new AlarmList(null, dialogArea, SWT.BORDER, "AlarmReminderDialog", null);
list.setStateFilter(Alarm.STATE_OUTSTANDING);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
list.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList in project netxms by netxms.
the class ObjectAlarmBrowser method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
content = new CompositeWithMessageBar(parent, SWT.NONE);
// $NON-NLS-1$
alarmView = new AlarmList(this, content.getContent(), SWT.NONE, "ObjectAlarmBrowser", null);
alarmView.setRootObjects(objects);
if (objects.size() == 1) {
NXCSession session = (NXCSession) ConsoleSharedData.getSession();
setPartName(String.format(Messages.get().ObjectAlarmBrowser_Title, session.getObjectName(objects.get(0))));
// content.hideMessage();
} else {
setPartName(Messages.get().ObjectAlarmBrowser_TitleMultipleObjects);
showObjectList();
}
createActions();
contributeToActionBars();
getSite().setSelectionProvider(alarmView.getSelectionProvider());
}
use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList in project netxms by netxms.
the class AlarmTab method createTabContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#createTabContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createTabContent(Composite parent) {
final IDialogSettings settings = Activator.getDefault().getDialogSettings();
initShowFilter = settings.getBoolean("AlarmTab.showFilter");
alarmList = new AlarmList(getViewPart(), parent, SWT.NONE, getConfigPrefix(), new VisibilityValidator() {
@Override
public boolean isVisible() {
return isActive();
}
});
alarmList.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
settings.put("AlarmTab.showFilter", alarmList.isFilterEnabled());
}
});
// Force update of "show colors" menu item in object tabbed view
// when settings changes in any alarm viewer
propertyChangeListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (// $NON-NLS-1$
event.getProperty().equals("SHOW_ALARM_STATUS_COLORS")) {
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
service.refreshElements("org.netxms.ui.eclipse.alarmviewer.commands.show_status_colors", null);
}
}
};
Activator.getDefault().getPreferenceStore().addPropertyChangeListener(propertyChangeListener);
alarmList.setFilterCloseAction(new Action() {
@Override
public void run() {
alarmList.enableFilter(false);
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
// $NON-NLS-1$
Command command = service.getCommand("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_list");
// $NON-NLS-1$
State state = command.getState("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_list.state");
state.setValue(false);
service.refreshElements(command.getId(), null);
}
});
alarmList.enableFilter(initShowFilter);
}
use of org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList in project netxms by netxms.
the class AlarmBrowser method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
FormLayout formLayout = new FormLayout();
parent.setLayout(formLayout);
// $NON-NLS-1$
alarmView = new AlarmList(this, parent, SWT.NONE, "AlarmBrowser", null);
FormData fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(0, 0);
fd.right = new FormAttachment(100, 0);
fd.bottom = new FormAttachment(100, 0);
alarmView.setLayoutData(fd);
createActions();
contributeToActionBars();
activateContext();
getSite().setSelectionProvider(alarmView.getSelectionProvider());
}
Aggregations