Package hermes.browser.components

Examples of hermes.browser.components.WatchDockableFrame


   *
   * @param watchId
   * @param hermes
   */
  public synchronized void addOrCreateWatch(String watchId, Hermes hermes) {
    WatchDockableFrame frame = null;

    if (queueWatchFrames.containsKey(watchId)) {
      frame = queueWatchFrames.get(watchId);
    } else {
      WatchConfig wConfig = HermesBrowser.getConfigDAO().createWatchConfig();
      wConfig.setId(watchId);

      frame = createWatch(wConfig);
    }

    frame.addWatch(hermes);
  }
View Full Code Here


   * @param watchId
   * @param hermes
   * @param destination
   */
  public synchronized void addOrCreateWatch(String watchId, Hermes hermes, DestinationConfig destination) {
    WatchDockableFrame frame = null;

    if (queueWatchFrames.containsKey(watchId)) {
      frame = queueWatchFrames.get(watchId);
    } else {
      WatchConfig wConfig = HermesBrowser.getConfigDAO().createWatchConfig();
      wConfig.setId(watchId);

      frame = createWatch(wConfig);
    }

    DestinationConfig dConfig = HermesBrowser.getConfigDAO().duplicateForWatch(destination, hermes);

    frame.addWatch(hermes.getId(), dConfig);
  }
View Full Code Here

  /**
   * Close all the watch panel.
   */
  private void closeWatches() {
    for (final Map.Entry<String, WatchDockableFrame> entry : queueWatchFrames.entrySet()) {
      final WatchDockableFrame frame = entry.getValue();
      frame.close();
      getDockingManager().removeFrame(entry.getKey());
    }
  }
View Full Code Here

   * 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;
  }
View Full Code Here

TOP

Related Classes of hermes.browser.components.WatchDockableFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.