use of org.netxms.client.objects.Cluster in project netxms by netxms.
the class AddClusterNode method selectionChanged.
/**
* @see IActionDelegate#selectionChanged(IAction, ISelection)
*/
public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof IStructuredSelection) {
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof Cluster) {
action.setEnabled(true);
clusterId = ((AbstractObject) obj).getObjectId();
} else {
action.setEnabled(false);
clusterId = 0;
}
} else {
action.setEnabled(false);
clusterId = 0;
}
}
use of org.netxms.client.objects.Cluster in project netxms by netxms.
the class ObjectStatusMap method buildFlatView.
/**
* Build flat view - all nodes in one group
*/
private void buildFlatView() {
AbstractObject root = session.findObjectById(rootObjectId);
if ((root == null) || !((root instanceof Container) || (root instanceof ServiceRoot) || (root instanceof Cluster)))
return;
List<AbstractObject> objects = new ArrayList<AbstractObject>(root.getAllChilds(new int[] { AbstractObject.OBJECT_NODE, AbstractObject.OBJECT_CLUSTER, AbstractObject.OBJECT_MOBILEDEVICE }));
filterObjects(objects);
Collections.sort(objects, new Comparator<AbstractObject>() {
@Override
public int compare(AbstractObject o1, AbstractObject o2) {
return o1.getObjectName().compareToIgnoreCase(o2.getObjectName());
}
});
final Composite clientArea = new Composite(dataArea, SWT.NONE);
clientArea.setBackground(getBackground());
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
clientArea.setLayoutData(gd);
RowLayout clayout = new RowLayout();
clayout.marginBottom = 0;
clayout.marginTop = 0;
clayout.marginLeft = 0;
clayout.marginRight = 0;
clayout.type = SWT.HORIZONTAL;
clayout.wrap = true;
clayout.pack = false;
clientArea.setLayout(clayout);
sections.add(clientArea);
for (AbstractObject o : objects) {
if (!isLeafObject(o))
continue;
addObjectElement(clientArea, o);
}
}
Aggregations