Пример #1
0
  /**
   * Sets the question for this widget.
   *
   * @param questionDef the question definition object.
   */
  public void setQuestion(QuestionDef questionDef) {
    this.questionDef = questionDef;

    if (questionDef != null) fieldHyperlink.setText(questionDef.getText());
    else {
      horizontalPanel.remove(fieldHyperlink);
      horizontalPanel.remove(sgstField);

      // Removing and adding of fieldHyperlink is to prevent a wiered bug from
      // happening where focus is taken off, brought back and the hyperlink
      // displays no more text.
      horizontalPanel.add(fieldHyperlink);
      fieldHyperlink.setText("");
    }
  }
  public void setImage(PreloadedImage image, String imageUrl) {

    System.out.println("PICTURE CLIENT 3: " + imageUrl);
    pictureUploadPanel.remove(defaultUploader);
    pictureUploadPanel.add(image);
    this.imageUrl = imageUrl;
  }
Пример #3
0
  public void stopSelection() {
    if (horizontalPanel.getWidgetIndex(fieldHyperlink) != -1) return;

    String val = sgstField.getText();
    if (val.trim().length() == 0) val = EMPTY_VALUE;
    fieldHyperlink.setText(val);
    horizontalPanel.remove(sgstField);
    horizontalPanel.add(fieldHyperlink);
    QuestionDef qtn = formDef.getQuestionWithText(txtField.getText());
    if (qtn != null) itemSelectionListener.onItemSelected(this, qtn);
  }
Пример #4
0
 public void setSubtitles(List<String> artistList) {
   subtitlePanel.clear();
   for (String artistId : artistList) {
     final Hyperlink artistLink = new Hyperlink();
     Label commaLabel = new Label(",");
     commaLabel.getElement().addClassName(style.space());
     Cache<String, ArtistInfo> artistCache = Controller.INSTANCE.getModel().getArtistCache();
     artistCache.addHandler(
         artistId,
         new CacheHandler<String, ArtistInfo>() {
           @Override
           public void onCacheUpdated(String k, ArtistInfo v) {
             artistLink.setText(v.getName());
             artistLink.setTargetHistoryToken(v.getTargetHistoryToken());
           }
         });
     artistCache.obtain(artistId);
     subtitlePanel.add(artistLink);
     subtitlePanel.add(commaLabel);
   }
   subtitlePanel.remove(subtitlePanel.getWidgetCount() - 1);
   subtitlePanel.setVisible(true);
 }
Пример #5
0
 private void removeAllWidgets(HorizontalPanel panel) {
   for (int i = panel.getWidgetCount() - 1; i >= 0; i--) panel.remove(i);
 }
Пример #6
0
 /**
  * Remove a tab by identifier.
  *
  * @param identifier the identifier.
  */
 public void removeTab(final String identifier) {
   tabDropZone.remove(tabs.get(identifier));
   tabs.remove(identifier);
 }
Пример #7
0
 /**
  * Removes a tool.
  *
  * @param tool the tool to remove
  */
 public void removeTool(Widget tool) {
   tools.remove(tool);
   widgetPanel.remove(tool);
 }
Пример #8
0
  public void setImage(PreloadedImage image, String imageUrl) {

    pictureUploadPanel.remove(defaultUploader);
    pictureUploadPanel.add(image);
    this.imageUrl = imageUrl;
  }
 public void setImageUrl(String imageUrl) {
   pictureUploadPanel.remove(defaultUploader);
   this.imageUrl = imageUrl;
 }