Esempio n. 1
0
  /** Redraws app for GUI (with menu) */
  public static void redrawGuiWithMenu() {

    bodySplitter.clear();
    bodySplitter.addSouth(ft, 23);
    bodySplitter.addWest(leftMenu, 280);
    bodySplitter.add(contentPanel);
    leftMenu.setHeight("100%");
    contentPanel.setHeight("100%");
  }
Esempio n. 2
0
    public UI() {
      DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.PX);

      LayoutPanel northPanel = new LayoutPanel();

      this.topLabel = new Label();
      topLabel.setStyleName("cc-problemName", true);
      northPanel.add(topLabel);
      northPanel.setWidgetTopHeight(topLabel, 0.0, Unit.PX, 22.0, Unit.PX);
      northPanel.setWidgetLeftRight(topLabel, 0.0, Unit.PX, PageNavPanel.WIDTH_PX, Unit.PX);

      this.pageNavPanel = new PageNavPanel();
      northPanel.add(pageNavPanel);
      northPanel.setWidgetTopHeight(pageNavPanel, 0.0, Unit.PX, PageNavPanel.HEIGHT_PX, Unit.PX);
      northPanel.setWidgetRightWidth(pageNavPanel, 0.0, Unit.PX, PageNavPanel.WIDTH_PX, Unit.PX);

      dockLayoutPanel.addNorth(northPanel, PageNavPanel.HEIGHT_PX);

      LayoutPanel southPanel = new LayoutPanel();

      this.statusMessageView = new StatusMessageView();
      southPanel.add(statusMessageView);
      southPanel.setWidgetTopBottom(statusMessageView, 0.0, Unit.PX, 0.0, Unit.PX);
      southPanel.setWidgetLeftRight(statusMessageView, 0.0, Unit.PX, 0.0, Unit.PX);

      dockLayoutPanel.addSouth(southPanel, StatusMessageView.HEIGHT_PX);

      this.userProgressView = new UserProgressView();
      userProgressView.setViewSubmissionsCallback(
          new ICallback<Problem>() {
            @Override
            public void call(Problem value) {
              // Set the Problem. (The UserSelection should already be in the session.)
              getSession().add(value);

              // Switch to UserProblemSubmissionsPage
              getSession().get(PageStack.class).push(PageId.USER_PROBLEM_SUBMISSIONS);
            }
          });
      dockLayoutPanel.add(userProgressView);

      initWidget(dockLayoutPanel);
    }
    @Override
    protected void finalizeObject(DockLayoutPanel widget) {

      if (northWidget != null) {
        widget.addNorth(northWidget, northSize);
      }
      if (southWidget != null) {
        widget.addSouth(southWidget, southSize);
      }
      if (eastWidget != null) {
        widget.addEast(eastWidget, eastSize);
      }
      if (westWidget != null) {
        widget.addWest(westWidget, westSize);
      }
      for (Widget centerWidget : centerWidgets) {
        widget.add(centerWidget);
      }
    }
Esempio n. 4
0
  public Widget asWidget() {

    DockLayoutPanel wrapper = new DockLayoutPanel(Style.Unit.PX);

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("window-content");

    final Form<PropertyRecord> form = new Form<PropertyRecord>(PropertyRecord.class);

    TextBoxItem nameItem = new TextBoxItem("key", "Name");
    TextBoxItem valueItem = new TextBoxItem("value", "Value");
    CheckBoxItem bootItem = new CheckBoxItem("bootTime", "Boot-Time");

    if (Console.MODULES.getBootstrapContext().isStandalone() || !includeBootTime)
      form.setFields(nameItem, valueItem);
    else form.setFields(nameItem, valueItem, bootItem);

    DialogueOptions options =
        new DialogueOptions(
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // save
                PropertyRecord property = form.getUpdatedEntity();
                presenter.onCreateProperty(reference, property);
              }
            },
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // cancel
                presenter.closePropertyDialoge();
              }
            });

    panel.add(form.asWidget());

    wrapper.addSouth(options, 35);
    wrapper.add(panel);
    return wrapper;
  }
  public void onModuleLoad() {
    mainPanel = new DockLayoutPanel(Unit.EM);
    mainCenterPanel = new FlowPanel();
    headerPanel = new EmontoHeaderPanel();
    headerPanel.addClickHandler(this);
    searchPanel = new EmontoSearchPanel();
    aboutPanel = new EmontoAboutPanel();
    contactPanel = new EmontoContactPanel();
    footerPanel = new EmontoFooterPanel();
    browsePanel = new EmontoBrowsePanel();

    mainPanel.addNorth(headerPanel, 15);
    mainPanel.addSouth(footerPanel, 2);
    mainPanel.addEast(new HTML(""), 4);
    mainPanel.addWest(new HTML(""), 4);
    mainPanel.add(mainCenterPanel);
    setActivePage(ActivePage.ABOUT);

    // Attach the LayoutPanel to the RootLayoutPanel. The latter will listen for
    // resize events on the window to ensure that its children are informed of
    // possible size changes.
    RootLayoutPanel.get().add(mainPanel);

    // initialize the ontology knowledge base on the server side
    AsyncCallback<Void> callback =
        new AsyncCallback<Void>() {
          public void onFailure(Throwable caught) {
            // TODO: Do something with errors. (e.g. status message: not connected!)
          }

          public void onSuccess(Void result) {
            // TODO: Do something on success (e.g. status message: connected!)
          }
        };

    kbSvc.initializeKB(callback);
  }
 @Override
 public void add(DockLayoutPanel pnl, Widget widget, double size) {
   pnl.addSouth(widget, size);
 }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final com.testroo.client.scaffold.ScaffoldDesktopShell owner) {

    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle)
                GWT.create(
                    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenBundle.class);
    com.google.gwt.resources.client.ImageResource gwtLogo =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.gwtLogo();
    com.google.gwt.resources.client.ImageResource rooLogo =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.rooLogo();
    com.testroo.client.scaffold.ScaffoldDesktopShell_BinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    com.google.gwt.dom.client.DivElement error = null;
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
    java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.requestfactory.ui.client.LoginWidget loginWidget =
        (com.google.gwt.requestfactory.ui.client.LoginWidget)
            GWT.create(com.google.gwt.requestfactory.ui.client.LoginWidget.class);
    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel2 =
        new com.google.gwt.user.client.ui.HTMLPanel(
            "<div class='"
                + ""
                + style.banner()
                + ""
                + "'> <div class='"
                + ""
                + style.error()
                + ""
                + "' id='"
                + domId0
                + "'></div> <span class='"
                + ""
                + style.title()
                + ""
                + "'><h2>Data Browser</h2></span> <span id='"
                + domId1
                + "'></span> </div>");
    com.google.gwt.user.client.ui.HTML f_HTML3 =
        (com.google.gwt.user.client.ui.HTML) GWT.create(com.google.gwt.user.client.ui.HTML.class);
    com.google.gwt.user.client.ui.ValuePicker placesBox = owner.placesBox;
    com.google.gwt.user.client.ui.SimplePanel f_SimplePanel5 =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.NotificationMole mole =
        (com.google.gwt.user.client.ui.NotificationMole)
            GWT.create(com.google.gwt.user.client.ui.NotificationMole.class);
    com.google.gwt.user.client.ui.SimplePanel master =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.FlowPanel f_FlowPanel6 =
        (com.google.gwt.user.client.ui.FlowPanel)
            GWT.create(com.google.gwt.user.client.ui.FlowPanel.class);
    com.google.gwt.user.client.ui.SimplePanel details =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.FlowPanel f_FlowPanel4 =
        (com.google.gwt.user.client.ui.FlowPanel)
            GWT.create(com.google.gwt.user.client.ui.FlowPanel.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.EM);

    loginWidget.setStyleName("" + style.login() + "");
    f_HTMLPanel2.setStyleName("" + style.centered() + "");
    f_DockLayoutPanel1.addNorth(f_HTMLPanel2, 6);
    f_HTML3.setHTML(
        "<div class='"
            + ""
            + style.logos()
            + ""
            + "'> <span>Powered by: </span> <a href='http://code.google.com/webtoolkit/'><div class='"
            + ""
            + style.gwtLogo()
            + ""
            + "'></div></a> <a href='http://www.springsource.org/roo/'><div class='"
            + ""
            + style.rooLogo()
            + ""
            + "'></div></a> </div>");
    f_DockLayoutPanel1.addSouth(f_HTML3, 2);
    placesBox.setStyleName("" + style.entitiesList() + "");
    placesBox.setWidth("100%");
    placesBox.setPageSize(100);
    f_SimplePanel5.add(placesBox);
    f_SimplePanel5.setStyleName("" + style.entities() + "");
    f_FlowPanel4.add(f_SimplePanel5);
    mole.setMessage("loading...");
    mole.setAnimationDuration(0);
    f_FlowPanel6.add(mole);
    master.setStyleName("" + style.entityDetails() + "");
    f_FlowPanel6.add(master);
    f_FlowPanel4.add(f_FlowPanel6);
    details.setStyleName("" + style.entityDetails() + "");
    f_FlowPanel4.add(details);
    f_FlowPanel4.setStyleName("" + style.content() + " " + style.centered() + "");
    f_DockLayoutPanel1.add(f_FlowPanel4);

    UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(f_HTMLPanel2.getElement());
    error = com.google.gwt.dom.client.Document.get().getElementById(domId0).cast();
    error.removeAttribute("id");
    com.google.gwt.user.client.Element domId1Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId1).cast();
    attachRecord0.detach();
    f_HTMLPanel2.addAndReplaceElement(loginWidget, domId1Element);

    owner.details = details;
    owner.error = error;
    owner.loginWidget = loginWidget;
    owner.master = master;
    owner.mole = mole;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_DockLayoutPanel1;
  }