Пример #1
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");
    }
  }
  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);
  }
Пример #3
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);
  }
Пример #4
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);
  }
Пример #5
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);
 }
Пример #6
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);
  }
  /** 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);
  }
Пример #8
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);
      }
    }
Пример #10
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();
          }
        });
  }
  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;
  }
Пример #12
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);
  }
  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);
 }
  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;
  }
Пример #16
0
  public void layout() {

    // clear any backgrounded processes.
    for (Timer t : bgList) {
      t.cancel();
    }

    table = new FlexTable();
    mainPanel.clear();
    if (!StringUtils.isEmpty(name) || !StringUtils.isEmpty(helpId)) {

      String n = StringUtils.isEmpty(name) ? "" : name.trim();
      HorizontalPanel h = new HorizontalPanel();
      h.setWidth("100%");
      HTML lname = new HTML("<b>" + n + "</b>");
      if (shortDesc != null) {
        lname.setTitle(shortDesc);
      }
      GwtUtil.setStyles(lname, "textAlign", "center");
      h.add(lname);
      h.setCellWidth(lname, "100%");

      if (!StringUtils.isEmpty(helpId)) {
        final Widget helpIcon = HelpManager.makeHelpIcon(helpId);
        h.add(helpIcon);
        GwtUtil.setStyles(helpIcon, "marginRight", "11px");
      }
      mainPanel.addNorth(h, 20);
    }

    // setup group by selection
    if (groupByCols != null && groupByCols.size() > 1) {
      EnumFieldDef gb = new EnumFieldDef("groupBy");
      gb.setLabel("Group By");
      gb.setDesc("Select a group by column to update the data table");
      gb.setPreferWidth(200);
      gb.setDefaultValue(curGroupByName);
      for (TableDataView.Column item : headers) {
        if (groupByCols.contains(item.getName())) {
          gb.addItem(item.getName(), item.getTitle());
        }
      }
      final SimpleInputField sif = SimpleInputField.createByDef(gb);
      mainPanel.addNorth(sif, 28);
      sif.getField()
          .addValueChangeHandler(
              new ValueChangeHandler() {
                public void onValueChange(ValueChangeEvent ve) {
                  curGroupByName = sif.getValue();
                  layout();
                }
              });
    }

    ScrollPanel sp = new ScrollPanel();
    sp.add(table);

    mainPanel.add(sp);

    table.setStyleName("firefly-summary-table");
    table.setSize("100%", "100%");
    iconColIdx = headers.size();
    String titleCol = null;

    // render headers
    int colIdx = 0;
    for (int i = 0; i < headers.size(); i++) {
      TableDataView.Column col = headers.get(i);
      if (curGroupByName == null || !curGroupByName.equals(col.getName())) {
        table.setText(0, colIdx, col.getTitle());
        table.getCellFormatter().setStyleName(0, colIdx, "title-bar");
        colIdx++;
        if (titleCol == null) {
          titleCol = col.getName();
        }
      }
    }
    table.setText(0, headers.size(), "");
    table.getCellFormatter().setWidth(0, headers.size(), "100%");

    ArrayList<SearchSummaryItem> itemList = searchItems;

    if (!StringUtils.isEmpty(curGroupByName)) {
      itemList = new ArrayList<SearchSummaryItem>();

      GroupFinder finder = new GroupFinder("");
      List<GroupedSummaryItem> groupList = new ArrayList<GroupedSummaryItem>();
      for (int i = 0; i < searchItems.size(); i++) {
        SearchSummaryItem dsi = searchItems.get(i);
        String cGroupValue = dsi.getValue(curGroupByName);
        GroupedSummaryItem cGroup =
            CollectionUtil.findFirst(groupList, finder.setName(cGroupValue));
        if (cGroup == null) {
          cGroup = new GroupedSummaryItem(cGroupValue);
          groupList.add(cGroup);
          itemList.add(cGroup);
        }
        cGroup.addChild(dsi);
      }
    }

    for (SearchSummaryItem ssi : itemList) {
      ssi.setTitleCol(titleCol);
      layout(ssi, 0);
    }
  }