use of org.netxms.ui.eclipse.dashboard.dialogs.helpers.ObjectIdMatchingData in project netxms by netxms.
the class TableValueConfig method remapObjects.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.dashboard.widgets.internal.DashboardElementConfig#remapObjects(java.util.Map)
*/
@Override
public void remapObjects(Map<Long, ObjectIdMatchingData> remapData) {
super.remapObjects(remapData);
ObjectIdMatchingData md = remapData.get(objectId);
if (md != null)
objectId = md.dstId;
}
use of org.netxms.ui.eclipse.dashboard.dialogs.helpers.ObjectIdMatchingData in project netxms by netxms.
the class ImportDashboard method readSourceObjects.
/**
* Read source objects from XML document
*
* @param root
* @return
*/
private Map<Long, ObjectIdMatchingData> readSourceObjects(Element root) {
Map<Long, ObjectIdMatchingData> objects = new HashMap<Long, ObjectIdMatchingData>();
// $NON-NLS-1$
NodeList objectsRoot = root.getElementsByTagName("objectMap");
for (int i = 0; i < objectsRoot.getLength(); i++) {
if (objectsRoot.item(i).getNodeType() != Node.ELEMENT_NODE)
continue;
// $NON-NLS-1$
NodeList elements = ((Element) objectsRoot.item(i)).getElementsByTagName("object");
for (int j = 0; j < elements.getLength(); j++) {
Element e = (Element) elements.item(j);
// $NON-NLS-1$
long id = getAttributeAsLong(e, "id", 0);
// $NON-NLS-1$
objects.put(id, new ObjectIdMatchingData(id, e.getTextContent(), (int) getAttributeAsLong(e, "class", 0)));
}
}
return objects;
}
use of org.netxms.ui.eclipse.dashboard.dialogs.helpers.ObjectIdMatchingData in project netxms by netxms.
the class IdMatchingDialog method okPressed.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@Override
protected void okPressed() {
// check if all elements have a match
boolean ok = true;
for (ObjectIdMatchingData o : objects.values()) if (o.dstId == 0) {
ok = false;
break;
}
for (DciIdMatchingData d : dcis.values()) if ((d.dstNodeId == 0) || (d.dstDciId == 0)) {
ok = false;
break;
}
if (!ok) {
if (!MessageDialogHelper.openQuestion(getShell(), Messages.get().IdMatchingDialog_MatchingErrors, Messages.get().IdMatchingDialog_ConfirmationText))
return;
}
super.okPressed();
}
Aggregations