示例#1
0
  /**
   * Draws the panels and their children that compose the basic WMT GUI.
   *
   * @param data the DataManager object for the WMT session
   */
  public Perspective(DataManager data) {

    super(Unit.PX);
    this.data = data;
    this.data.setPerspective(this);
    this.addStyleName("wmt-DockLayoutPanel");
    if (data.isDevelopmentMode()) {
      this.addStyleDependentName("devmode");
    }

    // Determine initial view sizes based on browser window dimensions.
    browserWindowWidth = Window.getClientWidth();
    Integer viewEastInitialWidth =
        (int) Math.round(Constants.VIEW_EAST_FRACTION * browserWindowWidth);
    Integer headerHeight = 50; // TODO diagnose from largest header elt

    // The Perspective has two children, a header in the north panel
    // and a SplitLayoutPanel below.
    viewNorth = new ViewNorth();
    this.addNorth(viewNorth, headerHeight);
    SplitLayoutPanel splitter = new SplitLayoutPanel(Constants.SPLITTER_SIZE);
    splitter.addStyleName("wmt-SplitLayoutPanel");
    this.add(splitter);

    // The SplitLayoutPanel defines panels which translate to the West
    // and East views of WMT.
    viewEast = new ViewEast();
    splitter.addEast(viewEast, viewEastInitialWidth);
    viewWest = new ViewWest();
    splitter.add(viewWest); // must be last
  }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final PolyakovGWT.client.view.MailboxViewImpl owner) {

    PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle)
                GWT.create(PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenBundle.class);
    PolyakovGWT.client.view.MailboxViewImpl_MyUiBinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    PolyakovGWT.client.view.widgets.CurrentPathWidget currentPathWidget =
        (PolyakovGWT.client.view.widgets.CurrentPathWidget)
            GWT.create(PolyakovGWT.client.view.widgets.CurrentPathWidget.class);
    PolyakovGWT.client.view.widgets.toolbar.ButtonsHolderWidget buttonsWidget = owner.buttonsWidget;
    com.google.gwt.user.client.ui.VerticalPanel f_VerticalPanel2 =
        (com.google.gwt.user.client.ui.VerticalPanel)
            GWT.create(com.google.gwt.user.client.ui.VerticalPanel.class);
    PolyakovGWT.client.view.widgets.FolderTreeWidget folderTree = owner.folderTree;
    com.google.gwt.user.client.ui.SimpleLayoutPanel containerPanel =
        (com.google.gwt.user.client.ui.SimpleLayoutPanel)
            GWT.create(com.google.gwt.user.client.ui.SimpleLayoutPanel.class);
    com.google.gwt.user.client.ui.SplitLayoutPanel f_SplitLayoutPanel3 =
        (com.google.gwt.user.client.ui.SplitLayoutPanel)
            GWT.create(com.google.gwt.user.client.ui.SplitLayoutPanel.class);
    com.google.gwt.user.client.ui.DockLayoutPanel f_DockLayoutPanel1 =
        new com.google.gwt.user.client.ui.DockLayoutPanel(com.google.gwt.dom.client.Style.Unit.PX);

    f_VerticalPanel2.add(currentPathWidget);
    f_VerticalPanel2.add(buttonsWidget);
    f_DockLayoutPanel1.addNorth(f_VerticalPanel2, 85);
    f_SplitLayoutPanel3.addWest(folderTree, 135);
    containerPanel.addStyleName("" + style.container() + "");
    f_SplitLayoutPanel3.add(containerPanel);
    f_SplitLayoutPanel3.addStyleName("" + style.data_container() + "");
    f_DockLayoutPanel1.add(f_SplitLayoutPanel3);

    owner.containerPanel = containerPanel;
    owner.currentPathWidget = currentPathWidget;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_DockLayoutPanel1;
  }