Search in sources :

Example 1 with CompositeWithMessageBar

use of org.netxms.ui.eclipse.widgets.CompositeWithMessageBar 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 2 with CompositeWithMessageBar

use of org.netxms.ui.eclipse.widgets.CompositeWithMessageBar in project netxms by netxms.

the class ScriptEditorView 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());
    editorMessageBar = new CompositeWithMessageBar(parent, SWT.NONE);
    editor = new ScriptEditor(editorMessageBar, SWT.NONE, SWT.H_SCROLL | SWT.V_SCROLL, showLineNumbers);
    editorMessageBar.setContent(editor);
    editor.getTextWidget().addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            if (!modified) {
                modified = true;
                firePropertyChange(PROP_DIRTY);
                actionSave.setEnabled(true);
            }
        }
    });
    activateContext();
    createActions();
    contributeToActionBars();
    // createPopupMenu();
    reloadScript();
}
Also used : ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) CompositeWithMessageBar(org.netxms.ui.eclipse.widgets.CompositeWithMessageBar) FillLayout(org.eclipse.swt.layout.FillLayout) ScriptEditor(org.netxms.ui.eclipse.nxsl.widgets.ScriptEditor)

Aggregations

FillLayout (org.eclipse.swt.layout.FillLayout)2 CompositeWithMessageBar (org.netxms.ui.eclipse.widgets.CompositeWithMessageBar)2 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 NXCSession (org.netxms.client.NXCSession)1 AlarmList (org.netxms.ui.eclipse.alarmviewer.widgets.AlarmList)1 ScriptEditor (org.netxms.ui.eclipse.nxsl.widgets.ScriptEditor)1