Search in sources :

Example 1 with AlarmList

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;
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) AlarmList(org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList) GridData(org.eclipse.swt.layout.GridData)

Example 2 with AlarmList

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());
}
Also used : NXCSession(org.netxms.client.NXCSession) AlarmList(org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList) CompositeWithMessageBar(org.netxms.ui.eclipse.widgets.CompositeWithMessageBar) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 3 with AlarmList

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);
}
Also used : IPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) DisposeListener(org.eclipse.swt.events.DisposeListener) VisibilityValidator(org.netxms.ui.eclipse.tools.VisibilityValidator) PropertyChangeEvent(org.eclipse.jface.util.PropertyChangeEvent) Action(org.eclipse.jface.action.Action) IDialogSettings(org.eclipse.jface.dialogs.IDialogSettings) Command(org.eclipse.core.commands.Command) State(org.eclipse.core.commands.State) AlarmList(org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList) DisposeEvent(org.eclipse.swt.events.DisposeEvent) ICommandService(org.eclipse.ui.commands.ICommandService)

Example 4 with AlarmList

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());
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) AlarmList(org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

AlarmList (org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList)4 Command (org.eclipse.core.commands.Command)1 State (org.eclipse.core.commands.State)1 Action (org.eclipse.jface.action.Action)1 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)1 IPropertyChangeListener (org.eclipse.jface.util.IPropertyChangeListener)1 PropertyChangeEvent (org.eclipse.jface.util.PropertyChangeEvent)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 FormAttachment (org.eclipse.swt.layout.FormAttachment)1 FormData (org.eclipse.swt.layout.FormData)1 FormLayout (org.eclipse.swt.layout.FormLayout)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 ICommandService (org.eclipse.ui.commands.ICommandService)1 NXCSession (org.netxms.client.NXCSession)1 VisibilityValidator (org.netxms.ui.eclipse.tools.VisibilityValidator)1 CompositeWithMessageBar (org.netxms.ui.eclipse.widgets.CompositeWithMessageBar)1