@Override
 public void setPresenter(final Presenter presenter) {
   this.presenter = presenter;
   header.clear();
   header.add(headerWidget.asWidget());
   footer.clear();
   footer.add(footerWidget.asWidget());
   headerWidget.refresh();
   Window.scrollTo(0, 0); // scroll user to top of page
 }
  public void show(final Pair<Product, String> productPair) {
    this.product = productPair.getEntity1();
    if (null != product.getDescription()) description.setHTML(product.getDescription());
    else description.setText("");
    tags.setValues(product.getTags());
    name.setValue(product.getName());
    versionNumber.setValue(product.getVersionNumber());
    organization.setValue(product.getOrganizationName());
    webpageUrl.setValue(product.getWebsiteUrl());
    wikiUrl.setValue(product.getWikiUrl());
    downloadUrl.setValue(product.getDownloadUrl());
    showcaseUrl.setValue(product.getDemoUrl());
    forumUrl.setValue(product.getForumUrl());
    issueTrackerUrl.setValue(product.getIssueTrackerUrl());
    newsfeedUrl.setValue(product.getNewsUrl());
    WidgetUtil.selectValue(license.getComponent(), product.getLicense());
    WidgetUtil.selectValue(status.getComponent(), product.getStatus());
    WidgetUtil.selectValue(category.getComponent(), product.getCategoryId());
    new GetProductCategoriesCommand() {

      @Override
      public void onSuccess(ArrayList<Category> result) {
        WidgetUtil.selectValue(category.getComponent(), product.getCategoryId());
      }
    }.execute();
    resetIcon();
    uploaderContainer.clear();
    if (null != product && null != product.getId()) {
      uploaderContainer.add(new ProductImageUploadPanel(product, this));
    }
  }
 @Override
 protected void onLoad() {
   super.onLoad();
   if (histogram != null) {
     histogramPanel.clear();
     histogramPanel.add(histogram.createChart(translations.histogram(), translations.density()));
   }
   if (qqPlot != null) {
     normalProbability.clear();
     normalProbability.add(
         qqPlot.createChart(
             translations.normalProbability(),
             translations.theoreticalQuantiles(),
             translations.sampleQuantiles()));
   }
 }
Beispiel #4
0
  @Override
  public void add(
      final WorkbenchPanelView newPanel,
      final WorkbenchPanelView targetPanel,
      final Integer preferredSize,
      final Integer preferredMinSize) {

    final Widget parent = targetPanel.asWidget().getParent();

    if (parent instanceof SimplePanel) {

      final SimplePanel sp = (SimplePanel) parent;
      final HorizontalSplitterPanel hsp =
          factory.newHorizontalSplitterPanel(
              newPanel, targetPanel, Position.EAST, preferredSize, preferredMinSize);

      sp.clear();
      sp.setWidget(hsp);

      // Adding an additional embedded ScrollPanel can cause scroll-bars to disappear
      // so ensure we set the sizes of the new Panel and it's children after the
      // browser has added the new DIVs to the HTML tree. This does occasionally
      // add slight flicker when adding a new Panel.
      scheduleResize(hsp);
    }
  }
 protected final void loadDataFromServer() {
   asWidgetWrapper.clear();
   asWidgetWrapper.add(
       new BuilderPanel()
           .setStyleCard()
           .addWithPadding(Widgets.waitinfo("Daten werden abgerufen")));
   DataForClientLoaderHelper.load((DataForClientLoader) this);
 }
 @Override
 public void onSubmitComplete(SubmitCompleteEvent event) {
   String key = event.getResults();
   if (null != key && key.length() > 0) {
     product.setIconKey(key);
     resetIcon();
   }
   uploaderContainer.clear();
   uploaderContainer.add(new ProductImageUploadPanel(product, this));
 }
 @Override
 public void reset() {
   super.reset();
   this.collectionDo = null;
   collectionMetaDataSimPanel.clear();
   editFolderDescSaveButton.getElement().getStyle().setDisplay(Display.NONE);
   editFolderDescSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
   editFolderSaveButton.getElement().getStyle().setDisplay(Display.NONE);
   editFolderSaveButtonCancel.getElement().getStyle().setDisplay(Display.NONE);
   folderDescription.switchToDescCancelLabel();
   folderTitle.switchToTitleCancelLabel();
 }
Beispiel #8
0
  @Override
  public void setInSlot(Object slot, IsWidget content) {

    if (slot == ProjectPresenter.PROJECT_POSTERS_SLOT) {
      c("ProjectV - setInSlot +++");
      //			Window.alert("clean");
      projectSlot.clear();
      //						projectSlot.add(content);
      if (content != null) {
        projectSlot.add(content);
      }
    } else if (slot == ProjectPresenter.MAP_SLOT) {
      c("ProjectV - setInSlot pour MAP = RARE NORMALEMENT+++");
      mapSlot.clear();
      if (content != null) {
        //				Window.alert("3 - add map widget to project");
        mapSlot.setWidget(content);
      }
    }
  }
 /**
  * if sensor is set to ON the SensorLogger starts logging data for this sensor.
  *
  * @param flag {@code true} to turn sensor ON
  */
 public void setOn(boolean flag) {
   this.sensorIsOn = flag;
   sensorOnOff.clear();
   setRealFreqVisible(flag);
   if (flag) {
     sensorOnOff.add(sensorON);
     for (GeoListBox listbox : listBoxes) {
       if (listbox.getSelection() != null) {
         ((AppWFull) app)
             .getDataCollection()
             .registerGeo(listbox.getType().toString(), listbox.getSelection());
       }
     }
   } else {
     sensorOnOff.add(sensorOFF);
     for (GeoListBox listbox : listBoxes) {
       ((AppWFull) app).getDataCollection().removeRegisteredGeo(listbox.getType());
     }
   }
 }
  private void fillPanel(UserModel model) {
    if (model == null) return;

    resetTitle(model.getLoginname());
    // if it's login user, refresh navbar user name
    if (model.isLogin()) BaseEntryPoint.I.resetLoginUser(model.getFullname());

    //		set display info on left part
    fullname.setText(model.getFullname());

    contacts.setUser(model);
    statusText.setText(StringUtil.trimToEmpty(model.getStatus()));
    this.userUid = model.getUid();

    if (model.getPortrait() != null) {
      // while user update Profile, the portrait won't refresh. See userPortraitUpdated() method
      portrait.clear();
      portrait.setWidget(GwtClientUtils.createUserPortrait(model.getPortrait()));
    }
  }
  @Override
  public final Updatable update() {
    log.debug("update()");

    table = null;
    wrapper = null;
    rows = null;
    columns = new ArrayList<AColumn>();

    table = new FlexTable();
    table.getElement().setId(getId() + "_table");
    table.setStyleName("goon-ObjectTable");

    wrapper = new BuilderPanel();
    if (isCardStyle()) wrapper.setStyleCard();
    wrapper.setId(getId());
    // wrapper.setSpacing(0);
    if (getColorForMarker() != null) wrapper.addColorMarker(getColorForMarker());
    init(wrapper);
    wrapper.add(table);
    initWrapperAfterTable(wrapper);

    for (AColumn column : columns) {
      column.formatColumn(table.getColumnFormatter());
    }

    onTableAdded(wrapper, table);

    reverseSort = isReverseSort();
    try {
      onUpdate();
    } catch (Exception ex) {
      throw new RuntimeException(Str.getSimpleName(getClass()) + ".onUpdate() failed", ex);
    }

    asWidgetWrapper.clear();
    asWidgetWrapper.add(wrapper);

    return this;
  }
  @Override
  public void setData(BookSelectList data) {
    selectionPanel.clear();

    final SingleSelectionModel<BookInfo> selectionModel = new SingleSelectionModel<>();
    TreeViewModel browserModel =
        new BookSelectionTreeViewModel(data, data.getCategory(), selectionModel);

    BookSelectionBrowserResources css = GWT.create(BookSelectionBrowserResources.class);
    final RosaCellBrowser browser =
        new RosaCellBrowser(
            new CellBrowser.Builder<>(browserModel, null)
                .pageSize(Integer.MAX_VALUE)
                .resources(css));

    browser.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.BOUND_TO_SELECTION);
    browser.setSize("100%", "100%");

    int parent_width = getParent() == null ? DEFAULT_WIDTH : getParent().getOffsetWidth() - 30;
    browser.setDefaultColumnWidth(parent_width / 2);
    browser.setMinimumColumnWidth(300);

    // Open 2nd tier of browser by selecting first item
    browser.getRootTreeNode().setChildOpen(0, true, false);

    // Add cell browser to view
    selectionPanel.setWidget(browser);

    browser.setFirstColumnWidth(400.0);
    browser.hideLastDivider();

    selectionModel.addSelectionChangeHandler(
        new Handler() {
          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            presenter.goToDescription(selectionModel.getSelectedObject().id);
          }
        });
  }
 @Override
 public void addSummaryTabWidget(Widget summaryTabWidget) {
   summaryTabPanel.clear();
   summaryTabPanel.add(summaryTabWidget);
 }
 /** Display MeasurePackage Workspace. */
 private void displayMeasurePackageWorkspace() {
   panel.clear();
   panel.add(view.asWidget());
   // view.setTabIndex();
 }
Beispiel #15
0
 public void switchToCreate() {
   verticalCell.clear();
   createAccount.resetInput();
   verticalCell.add(createAccount);
 }
Beispiel #16
0
 public void switchToLogin() {
   verticalCell.clear();
   loginView.resetFields();
   verticalCell.add(loginView);
 }
 private static void setWidget(SimplePanel simple, WidgetProvider provider) {
   simple.clear();
   simple.add(provider.getWidget());
 }
  public void userPortraitUpdated(String portraitUuid) {
    portrait.clear();
    portrait.setWidget(GwtClientUtils.createUserPortrait(portraitUuid));

    editDeck.showWidget(0);
  }
  private void updateRecords() {
    records.clear();

    if (displayFields.isEmpty()) {
      records.setWidget(new HTML(""));
      return;
    }

    List<StructureHolder> holders = oneToMany.getSelected();
    if (holders.isEmpty()) {
      records.setWidget(new HTML(""));
      return;
    }

    List<String> descs = holders.get(0).getStructure().extractDescriptions();

    Grid grid = new Grid(holders.size() + 1, displayFields.size());
    grid.setCellSpacing(0);
    grid.setCellPadding(8);
    grid.addStyleName("page_assessment_classScheme_grid");

    int row = 0;
    int column = 0;
    for (Integer value : displayFields) {
      try {
        grid.setHTML(
            row,
            column,
            "<span class=\"page_assessment_classScheme_grid_th\">" + descs.get(value) + "</span>");
      } catch (IndexOutOfBoundsException e) {
        grid.setHTML(row, column, "<span class=\"page_assessment_classScheme_grid_th\">-</span>");
      } finally {
        column++;
      }
    }

    row++;

    for (StructureHolder holder : holders) {
      final ArrayList<String> raw = new ArrayList<String>(), pretty = new ArrayList<String>();

      final Structure<Object> structure = holder.getStructure();

      final Map<String, String> map = new LinkedHashMap<String, String>();

      for (Object obj : structure.getClassificationInfo()) {
        ClassificationInfo info = (ClassificationInfo) obj;
        map.put(info.getDescription(), info.getData());
        raw.add(info.getData());
      }

      try {
        structure.getDisplayableData(raw, pretty, 0);
      } catch (Exception e) {
        continue;
      }

      column = 0;
      for (Integer value : displayFields) {
        try {
          grid.setHTML(
              row,
              column,
              "<span class=\"page_assessment_classScheme_content\">"
                  + pretty.get(value)
                  + "</span>");
        } catch (IndexOutOfBoundsException e) {
          grid.setHTML(row, column, "<span class=\"page_assessment_classScheme_content\">-</span>");
        } finally {
          column++;
        }
      }

      row++;
    }

    for (int i = 0; i < grid.getColumnCount(); i++) grid.getColumnFormatter().setWidth(i, "150px");

    records.setWidget(grid);
  }
 /**
  * Get Widget.
  *
  * @return Panel.
  */
 @Override
 public final Widget getWidget() {
   panel.clear();
   panel.add(view.asWidget());
   return panel;
 }
 /** Display Empty. */
 private void displayEmpty() {
   panel.clear();
   panel.add(emptyPanel);
 }
  @UiHandler("search")
  public void onSearchClick(final ClickEvent e) {
    errorPanel.clear();
    formGroup.setValidationState(ValidationState.NONE);
    final Map<String, Object> metadata = new HashMap<String, Object>();
    if (!sourceTextBox.getText().trim().isEmpty()) {
      metadata.put("dcore.source[0]", sourceTextBox.getText().trim());
    }

    if (!createdByTextBox.getText().trim().isEmpty()) {
      metadata.put("createdBy", createdByTextBox.getText().trim());
    }

    if (!descriptionByTextBox.getText().trim().isEmpty()) {
      metadata.put("dcore.description[0]", descriptionByTextBox.getText().trim());
    }

    if (!formatTypeahead.getText().trim().isEmpty()) {
      final String pattern =
          clientTypeRegistry.resolveWildcardPattern(formatTypeahead.getText().trim());
      metadata.put("filename", pattern);
    }

    if (!subjectTextBox.getText().trim().isEmpty()) {
      metadata.put("dcore.subject[0]", subjectTextBox.getText().trim());
    }

    if (!typeTextBox.getText().trim().isEmpty()) {
      metadata.put("dcore.type[0]", typeTextBox.getText().trim());
    }

    if (!lastModifiedByTextBox.getText().trim().isEmpty()) {
      metadata.put("lastModifiedBy", lastModifiedByTextBox.getText().trim());
    }

    if (!externalLinkTextBox.getText().trim().isEmpty()) {
      metadata.put("dcore.relation[0]", externalLinkTextBox.getText().trim());
    }

    if (!checkinCommentTextBox.getText().trim().isEmpty()) {
      metadata.put("checkinComment", checkinCommentTextBox.getText().trim());
    }

    boolean hasSomeDateValue = false;

    if (createdAfter.getValue() != null) {
      hasSomeDateValue = true;
    }

    if (createdBefore.getValue() != null) {
      hasSomeDateValue = true;
    }

    if (lastModifiedAfter.getValue() != null) {
      hasSomeDateValue = true;
    }

    if (lastModifiedBefore.getValue() != null) {
      hasSomeDateValue = true;
    }

    if (metadata.size() == 0 && !hasSomeDateValue) {
      formGroup.setValidationState(ValidationState.ERROR);
      Alert alert = new Alert(Constants.INSTANCE.AtLeastOneFieldMustBeSet(), AlertType.DANGER);
      alert.setVisible(true);
      alert.setDismissable(true);
      errorPanel.add(alert);
      return;
    }

    final SearchResultTable queryTable =
        new SearchResultTable(
            new QueryMetadataPageRequest(
                metadata,
                createdAfter.getValue(),
                createdBefore.getValue(),
                lastModifiedAfter.getValue(),
                lastModifiedBefore.getValue(),
                0,
                null));
    simplePanel.clear();

    simplePanel.add(queryTable);

    formAccordionCollapse.setIn(false);
    resultAccordionCollapse.setIn(true);
  }
  public void refresh() {
    Resources _resources = Domeo.resources;

    try {
      init();
      uriField.setValue(_resource.getUrl());
      // sourceField.add(new HTML("<img src='" + Domeo.resources.externalLinkIcon().getURL() + "'/>
      // <a href='" +
      //	_resource.getSource().getHomepage() + "' target='_blank'>"+_resource.getSource().getName()
      // + "</a> "));

      String synonyms = _resource.getIsAbout().getSynonyms();
      aboutField.add(
          new HTML(
              _resource.getIsAbout().getLabel()
                  + " "
                  + (_resource.getIsAbout().getSynonyms() != null ? synonyms : "")));

      if (_domeo.getExtractorsManager().isExtractorDefined()) {
        urlImage.setResource(_resources.checkIcon());
        urlImage.setTitle(
            "Known resource, executed extractor '"
                + _domeo.getExtractorsManager().getExtractorLabel()
                + "'");
        urlImage.setVisible(true);
      } else {
        urlImage.setVisible(false);
      }

      if (_resource != null) {
        extractionProvenanceImage.setUrl(
            Domeo.resources.pluginsGrayLittleIcon().getSafeUri().asString());
        extractionProvenanceImage.setTitle(_resource.getCreator().getName());
        extractorProvenanceDetails.setText("Extracted by " + _resource.getCreator().getName());
        extractionSourceDetails.setHTML(
            "Source <a href='"
                + _resource.getSource().getHomepage()
                + "' target='_blank'> <img src='"
                + Domeo.resources.externalLinkIcon().getSafeUri().asString()
                + "'/> "
                + _resource.getSource().getName()
                + "</a>");
        extractionDateDetails.setText("On " + _resource.getFormattedCreationDate());
      }
    } catch (Exception e) {
      _domeo
          .getLogger()
          .exception(this, "Exception while rendering OpenTrials resource info " + e.getMessage());
      body.clear();
      body.add(
          new HTML(
              "<img src='"
                  + _resources.crossLittleIcon().getSafeUri().asString()
                  + "'/> Exception while rendering OpenTrials resource info "
                  + e.getMessage()));
    }

    // References
    try {
      CitationReferencesPanel p = new CitationReferencesPanel(_domeo, false);
      referencesPanel.clear();
      referencesPanel.add(p);
    } catch (Exception e) {
      _domeo
          .getLogger()
          .exception(this, "Exception while rendering resource info " + e.getMessage());
      referencesPanel.clear();
      referencesPanel.add(
          new HTML(
              "<img src='"
                  + _resources.crossLittleIcon().getSafeUri().asString()
                  + "'/> Exception while rendering PubMed resource info "
                  + e.getMessage()));
    }

    // Generic Document Resource
    try {
      LDocumentResourceCardPanel d = new LDocumentResourceCardPanel(_domeo);
      d.initializeLens(_resource, _parameters);
      contentPanel.clear();
      contentPanel.add(d);
    } catch (Exception e) {
      _domeo
          .getLogger()
          .exception(this, "Exception while rendering resource info " + e.getMessage());
      body.clear();
      body.add(
          new HTML(
              "<img src='"
                  + _resources.crossLittleIcon().getSafeUri().asString()
                  + "'/> Exception while rendering OpenTrials resource info "
                  + e.getMessage()));
    }
  }