Ejemplo n.º 1
0
  /**
   * This method constructs the application user interface by instantiating controls and hooking up
   * event handler.
   */
  public void init() {
    // Inject global styles.
    GWT.<GlobalResources>create(GlobalResources.class).css().ensureInjected();

    // Create the UI defined in Mail.ui.xml.
    DockLayoutPanel outer = binder.createAndBindUi(this);

    // Get rid of scrollbars, and clear out the window's built-in margin,
    // because we want to take advantage of the entire client area.
    Window.enableScrolling(false);
    Window.setMargin("0px");

    // Special-case stuff to make topPanel overhang a bit.
    Element topElem = outer.getWidgetContainerElement(topPanel);
    topElem.getStyle().setZIndex(2);
    topElem.getStyle().setOverflow(Overflow.VISIBLE);

    // Listen for item selection, displaying the currently-selected item in
    // the detail area.
    //    mailList.setListener(new MailList.Listener() {
    //      public void onItemSelected(MailItem item) {
    //        mailDetail.setItem(item);
    //      }
    //    });

    // Add the outer panel to the RootLayoutPanel, so that it will be
    // displayed.

    // MenuMain PRINCIPAL
    RootLayoutPanel.get().add(outer);
  }
Ejemplo n.º 2
0
  private void addAdminPanel() {
    DockLayoutPanel adminDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    AdministrationTree deploymentTreeItem = new AdministrationTree();
    ScrollPanel adminTreeItemPanel = new ScrollPanel(deploymentTreeItem);

    adminDockLayoutPanel.add(adminTreeItemPanel);

    add(adminDockLayoutPanel, deploymentTreeItem.getHeaderHTML(), 2);
  }
Ejemplo n.º 3
0
  private void addQAPanel() {
    DockLayoutPanel qaDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    QATree qaTreeItem = new QATree();
    ScrollPanel qaTreeItemPanel = new ScrollPanel(qaTreeItem);

    qaDockLayoutPanel.add(qaTreeItemPanel);

    add(qaDockLayoutPanel, qaTreeItem.getHeaderHTML(), 2);
  }
Ejemplo n.º 4
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%");
  }
Ejemplo n.º 5
0
  private void addAdminPanel() {
    DockLayoutPanel browseDockLayoutPanel = new DockLayoutPanel(Unit.EM);

    AdminTree tree = new AdminTree();
    tree.setStyleName("lhs-Tree");
    ScrollPanel treePanel = new ScrollPanel(tree);
    browseDockLayoutPanel.add(treePanel);

    layout.add(browseDockLayoutPanel, Util.getHeaderHTML(images.config(), constants.admin()), 2);
  }
Ejemplo n.º 6
0
  private void addCategoriesPanel() {
    DockLayoutPanel browseDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    BrowseTree categoriesTreeItem = new BrowseTree();
    ScrollPanel categoriesTreeItemPanel = new ScrollPanel(categoriesTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      browseDockLayoutPanel.addNorth(RulesNewMenu.getMenu(categoriesTreeItem), 2);
    }
    browseDockLayoutPanel.add(categoriesTreeItemPanel);

    add(browseDockLayoutPanel, categoriesTreeItem.getHeaderHTML(), 2);
  }
  protected void initDockLayoutPanel() {
    if (dockLayoutPanel != null) return;
    if (leftPanel == null) leftPanel = new LeftPanel(this, businessService);

    RootPanel.get().clear();
    dockLayoutPanel = new DockLayoutPanel(Unit.PX);

    dockLayoutPanel.addNorth(new TopBar(this), 25);
    dockLayoutPanel.addWest(leftPanel, 225);
    mainPanel = new MainPanel(this);
    dockLayoutPanel.add(mainPanel);
  }
Ejemplo n.º 8
0
  public ShellView() {
    shell = new DockLayoutPanel(Style.Unit.PX);

    header = new SimpleLayoutPanel();
    navigation = new SimpleLayoutPanel();
    content = new SimpleLayoutPanel();

    shell.addNorth(header, 75);
    shell.addWest(navigation, 275);
    shell.add(content);

    initWidget(shell);
  }
Ejemplo n.º 9
0
  private void addDeploymentPanel() {
    DockLayoutPanel deploymentDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    DeploymentTree deploymentTreeItem = new DeploymentTree();
    ScrollPanel deploymentTreeItemPanel = new ScrollPanel(deploymentTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      deploymentDockLayoutPanel.addNorth(DeploymentNewMenu.getMenu(deploymentTreeItem), 2);
    }

    deploymentDockLayoutPanel.add(deploymentTreeItemPanel);

    add(deploymentDockLayoutPanel, deploymentTreeItem.getHeaderHTML(), 2);
  }
Ejemplo n.º 10
0
  /**
   * Sets content widget.
   *
   * @param widget content widget
   */
  public final void setContentWidget(Widget widget) {
    container.add(widget);
    for (FocusWidget focusWidget : UIUtil.getFocusableChildren(widget)) {
      focusWidget.addBlurHandler(blurHandler);
    }

    focusView();
  }
  /** Initialize the UI */
  private void buildUi() {
    // Create a textbox and set default port
    _text = new TextBox();
    _text.setText(String.valueOf(DEFAULT_PORT));
    // Create button to change default port
    _button = new Button("Change Emulator Port");
    // Create the info/status label
    _info = new InlineLabel();

    // register the button action
    _button.addClickHandler(
        new ClickHandler() {
          public void onClick(final ClickEvent event) {
            final int port = Integer.valueOf(_text.getText());
            new PortAsyncCallback(port).execute();
          }
        });

    // Open a map centered on Cawker City, KS USA
    final LatLng cawkerCity = LatLng.newInstance(39.509, -98.434);
    final MapWidget map = new MapWidget(cawkerCity, 2);
    map.setSize("100%", "100%");

    // Workaround for bug with click handler & setUItoDefaults() - see issue 260
    final MapUIOptions opts = map.getDefaultUI();
    opts.setDoubleClick(false);
    map.setUI(opts);

    // Register map click handler
    map.addMapClickHandler(this);

    // Create panel for textbox, button and info label
    final FlowPanel div = new FlowPanel();
    div.add(_text);
    div.add(_button);
    div.add(_info);
    // Dock the map
    final DockLayoutPanel dock = new DockLayoutPanel(Unit.PX);
    dock.addNorth(map, 500);

    // Add the map dock to the div panel
    div.add(dock);
    RootLayoutPanel.get().add(div);
  }
    @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);
      }
    }
Ejemplo n.º 13
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);
    }
Ejemplo n.º 14
0
  private void addPackagesPanel() {
    DockLayoutPanel packageDockLayoutPanel = new DockLayoutPanel(Unit.EM);
    final PackagesTree packagesTreeItem = new PackagesTree();
    ScrollPanel packagesTreeItemPanel = new ScrollPanel(packagesTreeItem);

    if (CapabilitiesManager.getInstance().shouldShow(Capabilities.SHOW_CREATE_NEW_ASSET)) {
      packageDockLayoutPanel.addNorth(PackagesNewMenu.getMenu(packagesTreeItem), 2);
    }
    packageDockLayoutPanel.add(packagesTreeItemPanel);

    add(packageDockLayoutPanel, packagesTreeItem.getHeaderHTML(), 2);

    // lazy loaded to easy startup wait time.
    DeferredCommand.addCommand(
        new Command() {
          public void execute() {
            packagesTreeItem.loadPackageList();
          }
        });
  }
Ejemplo n.º 15
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 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;
  }
Ejemplo n.º 17
0
 /** Method to initialize our map */
 private void initializeMap() {
   // center the map around Paris
   LatLng parisCity = LatLng.newInstance(48.856614, 2.3522219);
   map = new MapWidget(parisCity, 5);
   map.setSize("100%", "100%");
   map.addControl(new LargeMapControl());
   map.setDoubleClickZoom(false);
   map.setCenter(parisCity);
   map.getInfoWindow().open(map.getCenter(), new InfoWindowContent("Paris, capitale de France"));
   addMapClickHandler();
   addMapDoubleClickHandler();
   layoutPanel.addNorth(map, 500);
 }
Ejemplo n.º 18
0
 @Override
 protected void insert(Widget child, Direction direction, double size, Widget before) {
   super.insert(child, direction, size, before);
   recalcMargins();
   child.getElement().getStyle().clearRight();
   child.getElement().getStyle().clearBottom();
   child.getElement().getStyle().setWidth(100, Style.Unit.PCT);
   child.getElement().getStyle().setHeight(100, Style.Unit.PCT);
   com.bearsoft.gwt.ui.CommonResources.INSTANCE.commons().ensureInjected();
   child
       .getElement()
       .addClassName(com.bearsoft.gwt.ui.CommonResources.INSTANCE.commons().borderSized());
 }
Ejemplo n.º 19
0
  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);
  }
Ejemplo n.º 20
0
  public BaseView(PartStackUIResources resources) {
    container = new DockLayoutPanel(Style.Unit.PX);
    container.getElement().setAttribute("role", "part");
    container.setSize("100%", "100%");
    container.getElement().getStyle().setOutlineStyle(Style.OutlineStyle.NONE);
    initWidget(container);

    toolBar = new DockLayoutPanel(Style.Unit.PX);
    toolBar.addStyleName(resources.partStackCss().ideBasePartToolbar());
    toolBar.getElement().setAttribute("role", "toolbar");
    toolBar.addDomHandler(
        new MouseUpHandler() {
          @Override
          public void onMouseUp(MouseUpEvent event) {
            // activate last focused element if user clicked on part header
            if (lastFocused != null) {
              lastFocused.setFocus(true);
            }
          }
        },
        MouseUpEvent.getType());
    container.addNorth(toolBar, 23);

    // this hack used for adding box shadow effect to toolbar
    toolBar.getElement().getParentElement().getStyle().setOverflow(Style.Overflow.VISIBLE);

    toolbarHeader = new DockLayoutPanel(Style.Unit.PX);
    toolbarHeader.getElement().setAttribute("role", "toolbar-header");
    toolBar.addNorth(toolbarHeader, 22);

    titleLabel = new Label();
    titleLabel.setStyleName(resources.partStackCss().ideBasePartTitleLabel());
    toolbarHeader.addWest(titleLabel, 200);

    SVGImage minimize = new SVGImage(resources.collapseExpandIcon());
    minimize.getElement().setAttribute("name", "workBenchIconMinimize");
    minimizeButton = new ToolButton(minimize);

    minimizeButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            minimize();
          }
        });

    addToolButton(minimizeButton);

    if (minimizeButton.getElement() instanceof elemental.dom.Element) {
      Tooltip.create(
          (elemental.dom.Element) minimizeButton.getElement(),
          PositionController.VerticalAlign.BOTTOM,
          PositionController.HorizontalAlign.MIDDLE,
          "Hide");
    }
  }
  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;
  }
Ejemplo n.º 22
0
  /**
   * constructor TabGeographic
   *
   * @return the widget composed by the Geographic Tab
   */
  public TabGeographic() {
    queryButton.setText(constants.runQuery());
    // set style
    titleLabel.removeStyleName("gwt-Label");
    // set form names
    setFormName();

    // initialize widget
    initWidget(uiBinder.createAndBindUi(this));

    // add scroll bars
    dock.getWidgetContainerElement(dock.getWidget(0)).addClassName("auto");
    dock.getWidgetContainerElement(dock.getWidget(0)).getStyle().clearOverflow();
    Element myTable = dock.getElement().getElementsByTagName("table").getItem(0);
    @SuppressWarnings("unused")
    String txt = myTable.getInnerHTML();
    myTable.getStyle().clearPosition();

    if (summaryHTML.getHTML().isEmpty()) summaryHTML.removeFromParent();

    // HTML matchFound = new HTML("<div style=\"height:300px;overflow:auto;\"><div
    // id=\"responseCount\" style=\"display:none;\"><span style=\"font-weight: bold;\">Matches
    // found:</span><span id=\"matchCount\" style=\"display:none;\"></span><div
    // id=\"matches\"></div></div>");

    // Workaround to the problem of the map position
    // Issue 366: Google Map widget does not initialize correctly inside a LayoutPanel
    if (EUOSMEGWT.apiMapstraction.equalsIgnoreCase("google")) {
      map = new com.google.gwt.maps.client.MapWidget();
      nativeMakeMap(
          map.getElement(),
          geoBoundsObj.newTextBoxNorth.getElement(),
          geoBoundsObj.newTextBoxEast.getElement(),
          geoBoundsObj.newTextBoxSouth.getElement(),
          geoBoundsObj.newTextBoxWest.getElement(),
          queryTextBox.getElement());
      mapPanel.add(map);
      // google.maps.event.trigger(map, 'resize');
      // mapPanel.add(matchFound);
      // Event.trigger(mapWidget.getMap(), "resize");
    } else if (EUOSMEGWT.apiMapstraction.equalsIgnoreCase("gwt-ol")) {
      queryPanel.removeFromParent();
      if (mapWidget == null) {
        initMapGwtOl();
        mapPanel.add(mapWidget);
        mapWidget
            .getElement()
            .getFirstChildElement()
            .getStyle()
            .setZIndex(0); // force the map to fall behind popups MG 06.05.2015
      }
    } else {
      queryPanel.removeFromParent();
      sinkEvents(Event.ONMOUSEUP);
      Element map_el = DOM.getElementById("mapstraction");
      mxnMakeMap(map_el, EUOSMEGWT.apiMapstraction);
      mapPanel.getElement().insertFirst(map_el);
    }

    preferredObj.add(country);
    country.myListBox.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent event) {
            String selValue = country.myListBox.getValue(country.myListBox.getSelectedIndex());
            if (!selValue.isEmpty()) {
              // selValue contains a value like S:-21.39;W:55.84;N:51.09;E:-63.15
              String[] coordinates = selValue.split(";");
              String south = "";
              String west = "";
              String north = "";
              String east = "";
              for (int i = 0; i < coordinates.length; i++) {
                if (coordinates[i].startsWith("S:")) south = coordinates[i].substring(2);
                if (coordinates[i].startsWith("W:")) west = coordinates[i].substring(2);
                if (coordinates[i].startsWith("N:")) north = coordinates[i].substring(2);
                if (coordinates[i].startsWith("E:")) east = coordinates[i].substring(2);
              }
              if (!north.isEmpty() && !east.isEmpty() && !south.isEmpty() && !west.isEmpty()) {
                geoBoundsObj.newTextBoxSouth.setValue(south);
                geoBoundsObj.newTextBoxWest.setValue(west);
                geoBoundsObj.newTextBoxNorth.setValue(north);
                geoBoundsObj.newTextBoxEast.setValue(east);
                geoBoundsObj.newButton.click();

                // zoom to the country bound
                if (EUOSMEGWT.apiMapstraction.equalsIgnoreCase("gwt-ol")) {
                  Map map = mapWidget.getMap();
                  map.zoomToExtent(
                      new Bounds(
                          Double.parseDouble(west),
                          Double.parseDouble(south),
                          Double.parseDouble(east),
                          Double.parseDouble(north)));
                } else
                  setBoundsMapstraction(
                      Double.parseDouble(south),
                      Double.parseDouble(west),
                      Double.parseDouble(north),
                      Double.parseDouble(east));
              } else Window.alert(constants.geoCodeListError());
            }
          }
        });

    geoBoundsObj.myListBox.addBlurHandler(
        new BlurHandler() {
          @Override
          public void onBlur(BlurEvent event) {
            // refresh the map to avoid shifting cursor
            if (EUOSMEGWT.apiMapstraction.equalsIgnoreCase("gwt-ol")) {
              mapWidget.getMap().setCenter(mapWidget.getMap().getCenter());
            }
          }
        });

    geoBoundsObj.newButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            // refresh the map to avoid shifting cursor
            if (EUOSMEGWT.apiMapstraction.equalsIgnoreCase("gwt-ol")) {
              mapWidget.getMap().setCenter(mapWidget.getMap().getCenter());
            }
          }
        });
  }
Ejemplo n.º 23
0
 /**
  * Sets new height of the toolbar.
  *
  * @param height new toolbar height
  */
 @Deprecated
 public final void setToolbarHeight(int height) {
   container.setWidgetSize(toolBar, height);
 }
Ejemplo n.º 24
0
 /**
  * Sets button visible on part toolbar.
  *
  * @param button button
  */
 public final void showToolButton(@NotNull IsWidget button) {
   if (button != null) {
     toolbarHeader.setWidgetHidden(button.asWidget(), false);
   }
 }
Ejemplo n.º 25
0
 /**
  * Hides button on part toolbar.
  *
  * @param button button
  */
 public final void hideToolButton(@NotNull IsWidget button) {
   if (button != null) {
     toolbarHeader.setWidgetHidden(button.asWidget(), true);
   }
 }
Ejemplo n.º 26
0
 /**
  * Removes button from part toolbar.
  *
  * @param button button
  */
 public void removeToolButton(@NotNull IsWidget button) {
   if (button != null) {
     toolbarHeader.remove(button);
   }
 }
Ejemplo n.º 27
0
 /**
  * Add a button on part toolbar,
  *
  * @param button button
  */
 public final void addToolButton(@NotNull IsWidget button) {
   if (button != null) {
     toolbarHeader.addEast(button, 22);
   }
 }
  public Widget draw() {

    // contentWidget.setSize("100%", "100%");

    DockLayoutPanel ft = new DockLayoutPanel(Style.Unit.PX);
    contentWidget.setWidget(ft);

    final DataGrid gridTable = new DataGrid();
    gridTable.setSize("100%", "100%");

    final ArrayList<Attribute> vosList = new ArrayList<Attribute>();
    final GetAttributesV2 getVos =
        new GetAttributesV2(
            new JsonCallbackEvents() {
              public void onFinished(JavaScriptObject jso) {
                vosList.addAll(
                    new TableSorter<Attribute>()
                        .sortByAttrNameTranslation(JsonUtils.<Attribute>jsoAsList(jso)));
                gridTable.setRowData(vosList);
                gridTable.redraw();
              }
            });
    getVos.getUserAttributes(3411);
    getVos.retrieveData();

    gridTable.setSelectionModel(
        new MultiSelectionModel<Attribute>(new GeneralKeyProvider<Attribute>()));
    final SelectionModel<Attribute> selectionModel = gridTable.getSelectionModel();
    gridTable.setKeyboardSelectionPolicy(
        HasKeyboardSelectionPolicy.KeyboardSelectionPolicy.DISABLED);

    Column<Attribute, Boolean> checkBoxColumn =
        new Column<Attribute, Boolean>(new CheckboxCell(true, true)) {
          @Override
          public Boolean getValue(Attribute object) {
            // Get the value from the selection model.
            return selectionModel.isSelected(object);
          }
        };
    checkBoxColumn.setFieldUpdater(
        new FieldUpdater<Attribute, Boolean>() {
          @Override
          public void update(int i, Attribute Attribute, Boolean aBoolean) {
            selectionModel.setSelected(Attribute, aBoolean);
          }
        });

    // Checkbox column header
    CheckboxCell cb = new CheckboxCell();
    Header<Boolean> checkBoxHeader =
        new Header<Boolean>(cb) {
          public Boolean getValue() {
            return false; // return true to see a checked checkbox.
          }
        };
    checkBoxHeader.setUpdater(
        new ValueUpdater<Boolean>() {
          public void update(Boolean value) {
            // sets selected to all, if value = true, unselect otherwise
            for (Attribute obj : vosList) {
              selectionModel.setSelected(obj, value);
            }
          }
        });

    gridTable.addColumn(checkBoxColumn, checkBoxHeader, checkBoxHeader);
    gridTable.setColumnWidth(checkBoxColumn, 40.0, Style.Unit.PX);

    TextColumn<Attribute> idColumn =
        new TextColumn<Attribute>() {
          @Override
          public String getValue(Attribute object) {
            return String.valueOf(object.getId());
          }
        };

    if (JsonUtils.isExtendedInfoVisible()) {
      gridTable.addColumn(idColumn, "Id", "Id");
      gridTable.setColumnWidth(idColumn, "90px");
    }

    // Name column
    Column<Attribute, Attribute> nameColumn = JsonUtils.addColumn(new PerunAttributeNameCell());

    // Description column
    Column<Attribute, Attribute> descriptionColumn =
        JsonUtils.addColumn(new PerunAttributeDescriptionCell());

    // Value column
    Column<Attribute, Attribute> valueColumn =
        JsonUtils.addColumn(
            new PerunAttributeValueCell(),
            new FieldUpdater<Attribute, Attribute>() {
              public void update(int index, Attribute object, Attribute value) {
                object = value;
                selectionModel.setSelected(object, object.isAttributeValid());
              }
            });

    ColumnSortEvent.ListHandler<Attribute> columnSortHandler =
        new ColumnSortEvent.ListHandler<Attribute>(vosList);
    gridTable.addColumnSortHandler(columnSortHandler);

    // Sorting name column
    nameColumn.setSortable(true);
    columnSortHandler.setComparator(
        nameColumn, new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_NAME));

    // Sorting description column
    descriptionColumn.setSortable(true);
    columnSortHandler.setComparator(
        descriptionColumn,
        new AttributeComparator<Attribute>(AttributeComparator.Column.TRANSLATED_DESCRIPTION));

    // Add sorting
    gridTable.addColumnSortHandler(columnSortHandler);

    // updates the columns size
    gridTable.setColumnWidth(nameColumn, 200.0, Style.Unit.PX);
    gridTable.setColumnWidth(valueColumn, 420.0, Style.Unit.PX);

    gridTable.addColumn(nameColumn, "Name");
    gridTable.addColumn(valueColumn, "Value");
    gridTable.addColumn(descriptionColumn, "Description");

    TabMenu tabMenu = new TabMenu();

    tabMenu.addWidget(
        TabMenu.getPredefinedButton(
            ButtonType.ADD,
            "",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent clickEvent) {
                session.getTabManager().addTabToCurrentTab(new TestDataGridTabItem(), true);
              }
            }));

    ft.addNorth(tabMenu, 50);
    ft.add(gridTable);

    return getWidget();
  }
 @Override
 public void add(DockLayoutPanel pnl, Widget widget, double size) {
   pnl.addNorth(widget, size);
 }
Ejemplo n.º 30
0
  @Inject
  public SelectPathViewImpl(CoreLocalizationConstant locale, SelectPathViewImplUiBinder uiBinder) {
    setTitle(locale.selectPathWindowTitle());

    Widget widget = uiBinder.createAndBindUi(this);
    setWidget(widget);

    UniqueKeyProvider<Node> uniqueKeyProvider =
        new NodeUniqueKeyProvider() {
          @NotNull
          @Override
          public String getKey(@NotNull Node item) {
            if (item instanceof HasStorablePath) {
              return ((HasStorablePath) item).getStorablePath();
            } else {
              return String.valueOf(item.hashCode());
            }
          }
        };
    FolderNodeInterceptor interceptor = new FolderNodeInterceptor();
    Set<NodeInterceptor> interceptors = new HashSet<>();
    interceptors.add(interceptor);
    NodeLoader loader = new NodeLoader(interceptors);
    NodeStorage nodeStorage = new NodeStorage(uniqueKeyProvider);

    tree = new Tree(nodeStorage, loader);
    tree.setAutoSelect(true);
    tree.getSelectionModel().setSelectionMode(SINGLE);
    treeContainer.add(tree);

    KeyboardNavigationHandler handler =
        new KeyboardNavigationHandler() {
          @Override
          public void onEnter(NativeEvent evt) {
            evt.preventDefault();
            acceptButtonClicked();
          }
        };

    handler.bind(tree);

    cancelButton =
        createButton(
            locale.cancel(),
            "select-path-cancel-button",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                hide();
              }
            });

    acceptButton =
        createPrimaryButton(
            locale.ok(),
            "select-path-ok-button",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                acceptButtonClicked();
              }
            });

    addButtonToFooter(acceptButton);
    addButtonToFooter(cancelButton);
  }