Ejemplo n.º 1
0
  /**
   * Send a message to an Object.
   *
   * @param engine The engine.
   * @param msg The message that is sent.
   * @param ob The object receiving the message.
   * @return The result of the message being sent.
   */
  public String sendMessageToObject(Engine engine, String msg, OObject ob) {
    if (msg.equalsIgnoreCase(UIKeyword.WINDOW_OPEN)) {
      this.run(engine, ob);
    } else if (msg.equalsIgnoreCase(UIKeyword.WINDOW_CLOSE)) {
      String title = this.getTitle(ob);

      OWindow w = WindowManager.getInstance().get(title);
      w.dispatchEvent(new WindowEvent(w, WindowEvent.WINDOW_CLOSING));
      WindowManager.getInstance().removeWindow(title);
    }

    return "";
  }
Ejemplo n.º 2
0
  /**
   * This type is runnable, so run it already! Running a window opens it.
   *
   * @param engine
   * @param ob
   * @return
   */
  public void run(Engine engine, OObject ob) {
    //		OWindow.openWindow( this.getTitle( ob ) );
    String title = this.getTitle(ob);

    OWindow w = new OWindow(engine, title);
    w.initFromSpec(ob);
    WindowManager.getInstance().addWindow(title, w);
    w.setVisible(true);

    engine.getEventManager().windowOpened(ob);
  }