Search in sources :

Example 1 with Connection

use of org.netxms.ui.eclipse.objectview.objecttabs.elements.Connection in project netxms-ocilib by stevemqeen.

the class ObjectOverview method createTabContent.

/* (non-Javadoc)
	 * @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#createTabContent(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected void createTabContent(Composite parent) {
    scroller = new ScrolledComposite(parent, SWT.V_SCROLL);
    scroller.setExpandVertical(true);
    scroller.setExpandHorizontal(true);
    // FIXME: scroller.getVerticalBar().setIncrement(20);
    scroller.addControlListener(new ControlAdapter() {

        public void controlResized(ControlEvent e) {
            Rectangle r = scroller.getClientArea();
            scroller.setMinSize(viewArea.computeSize(r.width, SWT.DEFAULT));
            objectChanged(getObject());
        }
    });
    viewArea = new Composite(scroller, SWT.NONE);
    viewArea.setBackground(SharedColors.getColor(SharedColors.OBJECT_TAB_BACKGROUND, parent.getDisplay()));
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    viewArea.setLayout(layout);
    scroller.setContent(viewArea);
    leftColumn = new Composite(viewArea, SWT.NONE);
    leftColumn.setLayout(createColumnLayout());
    leftColumn.setBackground(SharedColors.getColor(SharedColors.OBJECT_TAB_BACKGROUND, parent.getDisplay()));
    GridData gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    leftColumn.setLayoutData(gd);
    rightColumn = new Composite(viewArea, SWT.NONE);
    rightColumn.setLayout(createColumnLayout());
    rightColumn.setBackground(SharedColors.getColor(SharedColors.OBJECT_TAB_BACKGROUND, parent.getDisplay()));
    gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.LEFT;
    gd.grabExcessHorizontalSpace = true;
    gd.minimumWidth = SWT.DEFAULT;
    rightColumn.setLayoutData(gd);
    OverviewPageElement e = new GeneralInfo(leftColumn, null, this);
    elements.add(e);
    e = new LastValues(leftColumn, e, this);
    elements.add(e);
    e = new Commands(leftColumn, e, this);
    elements.add(e);
    e = new AvailabilityChart(leftColumn, e, this);
    elements.add(e);
    e = new Comments(leftColumn, e, this);
    elements.add(e);
    e = new Capabilities(rightColumn, null, this);
    elements.add(e);
    e = new Connection(rightColumn, e, this);
    elements.add(e);
}
Also used : AvailabilityChart(org.netxms.ui.eclipse.objectview.objecttabs.elements.AvailabilityChart) ControlAdapter(org.eclipse.swt.events.ControlAdapter) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) OverviewPageElement(org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement) Comments(org.netxms.ui.eclipse.objectview.objecttabs.elements.Comments) Rectangle(org.eclipse.swt.graphics.Rectangle) Connection(org.netxms.ui.eclipse.objectview.objecttabs.elements.Connection) GeneralInfo(org.netxms.ui.eclipse.objectview.objecttabs.elements.GeneralInfo) GridLayout(org.eclipse.swt.layout.GridLayout) Capabilities(org.netxms.ui.eclipse.objectview.objecttabs.elements.Capabilities) GridData(org.eclipse.swt.layout.GridData) LastValues(org.netxms.ui.eclipse.objectview.objecttabs.elements.LastValues) Commands(org.netxms.ui.eclipse.objectview.objecttabs.elements.Commands) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ControlEvent(org.eclipse.swt.events.ControlEvent)

Example 2 with Connection

use of org.netxms.ui.eclipse.objectview.objecttabs.elements.Connection in project netxms by netxms.

the class ObjectOverview method createTabContent.

/**
 * @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#createTabContent(org.eclipse.swt.widgets.Composite)
 */
@Override
protected void createTabContent(Composite parent) {
    scroller = new ScrolledComposite(parent, SWT.V_SCROLL);
    scroller.setExpandVertical(true);
    scroller.setExpandHorizontal(true);
    // FIXME: scroller.getVerticalBar().setIncrement(20);
    scroller.addControlListener(new ControlAdapter() {

        public void controlResized(ControlEvent e) {
            Rectangle r = scroller.getClientArea();
            scroller.setMinSize(viewArea.computeSize(r.width, SWT.DEFAULT));
            objectChanged(getObject());
        }
    });
    viewArea = new Composite(scroller, SWT.NONE);
    viewArea.setBackground(ThemeEngine.getBackgroundColor("Dashboard"));
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    viewArea.setLayout(layout);
    scroller.setContent(viewArea);
    leftColumn = new Composite(viewArea, SWT.NONE);
    leftColumn.setLayout(createColumnLayout());
    leftColumn.setBackground(viewArea.getBackground());
    GridData gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    leftColumn.setLayoutData(gd);
    rightColumn = new Composite(viewArea, SWT.NONE);
    rightColumn.setLayout(createColumnLayout());
    rightColumn.setBackground(viewArea.getBackground());
    gd = new GridData();
    gd.verticalAlignment = SWT.TOP;
    gd.horizontalAlignment = SWT.LEFT;
    gd.grabExcessHorizontalSpace = true;
    gd.minimumWidth = SWT.DEFAULT;
    rightColumn.setLayoutData(gd);
    OverviewPageElement e = new GeneralInfo(leftColumn, null, this);
    elements.add(e);
    e = new LastValues(leftColumn, e, this);
    elements.add(e);
    e = new Commands(leftColumn, e, this);
    elements.add(e);
    e = new ExternalResources(leftColumn, e, this);
    elements.add(e);
    e = new Comments(leftColumn, e, this);
    elements.add(e);
    e = new Capabilities(rightColumn, null, this);
    elements.add(e);
    e = new Connection(rightColumn, e, this);
    elements.add(e);
    VisibilityValidator validator = new // $NON-NLS-1$
    VisibilityValidator() {

        @Override
        public boolean isVisible() {
            return isActive();
        }
    };
    refreshController = new ViewRefreshController(getViewPart(), -1, new Runnable() {

        @Override
        public void run() {
            if (viewArea.isDisposed())
                return;
            IViewPart viewPart = getViewPart();
            if (viewPart instanceof TabbedObjectView)
                ((TabbedObjectView) getViewPart()).refreshCurrentTab();
        }
    }, validator);
    refreshController.setInterval(30);
    viewArea.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            refreshController.dispose();
        }
    });
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) IViewPart(org.eclipse.ui.IViewPart) ControlAdapter(org.eclipse.swt.events.ControlAdapter) Composite(org.eclipse.swt.widgets.Composite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) OverviewPageElement(org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement) Comments(org.netxms.ui.eclipse.objectview.objecttabs.elements.Comments) Rectangle(org.eclipse.swt.graphics.Rectangle) Connection(org.netxms.ui.eclipse.objectview.objecttabs.elements.Connection) DisposeEvent(org.eclipse.swt.events.DisposeEvent) GeneralInfo(org.netxms.ui.eclipse.objectview.objecttabs.elements.GeneralInfo) GridLayout(org.eclipse.swt.layout.GridLayout) VisibilityValidator(org.netxms.ui.eclipse.tools.VisibilityValidator) TabbedObjectView(org.netxms.ui.eclipse.objectview.views.TabbedObjectView) Capabilities(org.netxms.ui.eclipse.objectview.objecttabs.elements.Capabilities) GridData(org.eclipse.swt.layout.GridData) LastValues(org.netxms.ui.eclipse.objectview.objecttabs.elements.LastValues) Commands(org.netxms.ui.eclipse.objectview.objecttabs.elements.Commands) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ViewRefreshController(org.netxms.ui.eclipse.tools.ViewRefreshController) ControlEvent(org.eclipse.swt.events.ControlEvent) ExternalResources(org.netxms.ui.eclipse.objectview.objecttabs.elements.ExternalResources)

Aggregations

ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)2 ControlAdapter (org.eclipse.swt.events.ControlAdapter)2 ControlEvent (org.eclipse.swt.events.ControlEvent)2 Rectangle (org.eclipse.swt.graphics.Rectangle)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 Capabilities (org.netxms.ui.eclipse.objectview.objecttabs.elements.Capabilities)2 Commands (org.netxms.ui.eclipse.objectview.objecttabs.elements.Commands)2 Comments (org.netxms.ui.eclipse.objectview.objecttabs.elements.Comments)2 Connection (org.netxms.ui.eclipse.objectview.objecttabs.elements.Connection)2 GeneralInfo (org.netxms.ui.eclipse.objectview.objecttabs.elements.GeneralInfo)2 LastValues (org.netxms.ui.eclipse.objectview.objecttabs.elements.LastValues)2 OverviewPageElement (org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement)2 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 IViewPart (org.eclipse.ui.IViewPart)1 AvailabilityChart (org.netxms.ui.eclipse.objectview.objecttabs.elements.AvailabilityChart)1 ExternalResources (org.netxms.ui.eclipse.objectview.objecttabs.elements.ExternalResources)1 TabbedObjectView (org.netxms.ui.eclipse.objectview.views.TabbedObjectView)1