setImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.ELCL_MERGESESSIONS));
setDisabledImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.DLCL_MERGESESSIONS));
}
public void run() {
ISessionManager sm = CoverageTools.getSessionManager();
ICoverageSession[] sessions = sm.getSessions();
String descr = UIMessages.MergeSessionsDialogDescriptionDefault_value;
descr = MessageFormat.format(descr, new Object[] { new Date() });
MergeSessionsDialog d = new MergeSessionsDialog(window.getShell(), sessions, descr);
if (d.open() == IDialogConstants.OK_ID) {
Object[] result = d.getResult();
ICoverageSession merged = (ICoverageSession) result[0];
for (int i = 1; i < result.length; i++) {
merged = merged.merge((ICoverageSession) result[i], d.getDescription());
}
sm.addSession(merged, true, null);
for (int i = 0; i < result.length; i++) {
sm.removeSession((ICoverageSession) result[i]);
}
}
}