コード例 #1
0
  public void terminate() {
    ViewContainer container = ((PortalViewVisualizer) getViewVisualizer()).getPortalContainer();
    ViewManager viewManager = getViewManager();

    Object[] openViews = container.getComponents().toArray();

    for (int i = 0; i < openViews.length; i++) {
      View view = (View) openViews[i];
      System.out.println("closed view " + view);
      container.closeView(view, new Keywords());
    }

    viewManager.delistContainer(container);

    ViewTransaction viewTransaction = viewManager.beginTransaction();

    try {
      getContainer()
          .performCommand(
              ViewContainer.CANCEL_ACTIVE_VIEW,
              new Keywords("viewtransaction", viewTransaction, "force", Boolean.TRUE));
      viewManager.commitTransaction(viewTransaction);
    } catch (ComponentException e) {
      viewManager.rollbackTransaction(viewTransaction);
    }
  }
コード例 #2
0
  public void closeOpenViews() {
    ViewContainer container = ((MenueVisualizer) getViewVisualizer()).getPortalContainer();
    Object[] openViews = container.getComponents().toArray();

    for (int i = 0; i < openViews.length; i++) {
      View view = (View) openViews[i];

      try {
        container.closeView(view, new Keywords());
      } catch (Throwable t) {
        t.printStackTrace();
      }
    }
  }