final Host dcHost,
final String drbdId,
final Application.RunMode runMode) {
final Point2D p = null;
final CrmGraph crmg = getBrowser().getCrmGraph();
final LinbitDrbdInfo ldi =
(LinbitDrbdInfo) getBrowser().getServicesInfo().addServicePanel(
getBrowser().getCrmXml().getLinbitDrbdResourceAgent(),
p,
true,
drbdId,
null,
runMode);
application.waitForSwing();
ldi.setGroupInfo(fi.getGroupInfo());
getBrowser().addToHeartbeatIdList(ldi);
fi.setLinbitDrbdInfo(ldi);
/* it adds coloation only to the graph. */
final CloneInfo ci = ldi.getCloneInfo();
final GroupInfo giFi = fi.getGroupInfo();
if (giFi == null) {
crmg.addColocation(null, fi, ci);
crmg.addOrder(null, ci, fi);
} else {
crmg.addColocation(null, giFi, ci);
crmg.addOrder(null, ci, giFi);
}
/* this must be executed after the getInfoPanel is executed. */
ldi.waitForInfoPanel();
ldi.getWidget("drbd_resource", null).setValueAndWait(new StringValue(getDrbdResourceInfo().getName()));
/* apply gets parents from graph and adds colocations. */
application.waitForSwing();
ldi.apply(dcHost, runMode);
ldi.getResource().setNew(false);
application.invokeInEdt(new Runnable() {
@Override
public void run() {
ldi.setApplyButtons(null, ldi.getParametersFromXML());
}
});
}