use of org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement in project netxms by netxms.
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 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);
}
use of org.netxms.ui.eclipse.objectview.objecttabs.elements.OverviewPageElement in project netxms by netxms.
the class ObjectOverview method objectChanged.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#objectChanged(org.netxms.client.objects.AbstractObject)
*/
@Override
public void objectChanged(AbstractObject object) {
viewArea.setRedraw(false);
for (OverviewPageElement element : elements) {
if ((object != null) && element.isApplicableForObject(object)) {
element.setObject(object);
} else {
element.dispose();
}
}
for (OverviewPageElement element : elements) element.fixPlacement();
viewArea.layout(true, true);
viewArea.setRedraw(true);
Rectangle r = scroller.getClientArea();
scroller.setMinSize(viewArea.computeSize(r.width, SWT.DEFAULT));
Point s = viewArea.getSize();
viewArea.redraw(0, 0, s.x, s.y, true);
}
Aggregations