* add it to the docking manager and the XML configuration.
*
* @param watchConfig
*/
private WatchDockableFrame createWatch(final WatchConfig wConfig) {
final WatchDockableFrame frame = new WatchDockableFrame(wConfig);
queueWatchFrames.put(wConfig.getId(), frame);
frame.addDockableFrameListener(new DockableFrameAdapter() {
public void dockableFrameHidden(DockableFrameEvent arg0) {
log.debug("watch frame " + wConfig.getId() + " removed, clearing up");
try {
getConfig().getWatch().remove(wConfig);
queueWatchFrames.remove(wConfig.getId());
} catch (HermesException ex) {
Hermes.ui.getDefaultMessageSink().add("Unable to remove watch " + wConfig.getId() + " from configuration: " + ex.getMessage());
}
getDockingManager().removeFrame(wConfig.getId());
frame.close();
}
});
getDockingManager().addFrame(frame);
frame.setVisible(true);
try {
getConfig().getWatch().add(wConfig);
} catch (HermesException ex) {
Hermes.ui.getDefaultMessageSink().add("Unable to add watch " + wConfig.getId() + " to configuration: " + ex.getMessage());
}
frame.updateNow();
return frame;
}