Exemplo n.º 1
0
  private void countCharacters(int input, TextBox tb) {

    int ilen = tb.getText().length();
    String len = Integer.toString(ilen);

    switch (input) {
      case 3: // secret 1
        pSecretCount1.clear();
        pSecretCount1.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount1.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount1.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
      case 4: // secret 2
        pSecretCount2.clear();
        pSecretCount2.add(new HTML(len));
        if (ilen > consumerSecret_Len) {
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountPass");
        } else {
          pSecretCount2.setStyleName("core-CreateUserAccount-CharCountError");
          pSecretCount2.removeStyleName("core-CreateUserAccount-CharCountPass");
        }
        break;
    }
  }
Exemplo n.º 2
0
  /**
   * Updates the plot panel. Adds/removes additional panels as needed for the current selected plot.
   */
  private void updatePlotPanelLayout() {

    metaPlotPanel.clear();
    plotPanelSouth.clear();
    plotPanelNorth.clear();

    metaPlotPanel.add(plotPanel.getComponent());
    getModel().updatePlotPanelLayout();
  }
Exemplo n.º 3
0
 public void drawSecretNotify(boolean bol, int error) {
   pSecretError.clear();
   if (bol == true) {
     pSecret.setStyleName("core-CreateUserAccount-ErrorInput");
     if (error > 0) {
       pSecretError.add(new HTML(UserData.getError(error)));
     }
   } else {
     pSecret.removeStyleName("core-CreateUserAccount-ErrorInput");
     pSecretError.clear();
   }
 }
Exemplo n.º 4
0
  public void updateScatterPlot() {
    if (!daModel.isRegressionMode()) {
      return;
    }
    metaPlotPanel.clear();
    plotPanelNorth.clear();
    plotPanelSouth.clear();

    plotPanelSouth.add(LayoutUtil.panelRow(lblTitleX, fldTitleX));
    plotPanelNorth.add(LayoutUtil.panelRow(lblTitleY, fldTitleY));

    metaPlotPanel.add(plotPanelNorth);
    metaPlotPanel.add(plotPanel.getComponent());
    metaPlotPanel.add(plotPanelSouth);
  }
  @Override
  public void showResults(Job job) {
    disclosurePanel.setOpen(true);
    Set<PairwiseComparison> comparisons = job.getComparison();
    comparisonsPanel.clear();
    List<PairwiseComparison> ordered = new ArrayList<PairwiseComparison>(comparisons);
    Collections.sort(
        ordered,
        new Comparator<PairwiseComparison>() {

          @Override
          public int compare(PairwiseComparison o1, PairwiseComparison o2) {
            if (o1.getSimilarity() != null & o2.getSimilarity() != null) {
              double parseDouble = o1.getSimilarity();
              double parseDouble2 = o2.getSimilarity();
              if (parseDouble > parseDouble2) {
                return -1;
              } else if (parseDouble < parseDouble2) {
                return 1;
              } else {
                return 0;
              }
            } else {
              return 0;
            }
          }
        });
    for (PairwiseComparison comparison : ordered) {
      HorizontalPanel pairwiseComparisonPanel = new HorizontalPanel();
      String firstId = comparison.getFirstDataset().getUri();
      PreviewWidget previewWidget =
          new PreviewWidget(firstId, GetPreviews.SMALL, "dataset?id=" + firstId, dispatchAsync);
      previewWidget.addStyleName("thumbnail");
      pairwiseComparisonPanel.add(previewWidget);
      pairwiseComparisonPanel.setCellVerticalAlignment(
          previewWidget, HasVerticalAlignment.ALIGN_MIDDLE);
      String secondId = comparison.getSecondDataset().getUri();
      PreviewWidget previewWidget2 =
          new PreviewWidget(secondId, GetPreviews.SMALL, "dataset?id=" + secondId, dispatchAsync);
      previewWidget.addStyleName("thumbnail");
      pairwiseComparisonPanel.add(previewWidget2);
      pairwiseComparisonPanel.setCellVerticalAlignment(
          previewWidget2, HasVerticalAlignment.ALIGN_MIDDLE);

      String text = " = ";

      ComparisonStatus comparisonStatus = job.getComparisonStatus().get(comparison.getUri());
      if (comparisonStatus == ComparisonStatus.ENDED) {
        text += "<b>" + comparison.getSimilarity() + "</b>";
      } else {
        text += "<b>" + comparisonStatus + "</b>";
      }
      HTML similarity = new HTML(text);
      pairwiseComparisonPanel.add(similarity);
      pairwiseComparisonPanel.setCellVerticalAlignment(
          similarity, HasVerticalAlignment.ALIGN_MIDDLE);

      comparisonsPanel.add(pairwiseComparisonPanel);
    }
  }
  void repaint() {
    files.clear();
    for (final String key : idOrdering) {
      files.add(
          new LinkButton(
              "icon-remove",
              id2name.get(key),
              "",
              new ClickHandler() {
                HandlerRegistration handler;

                @Override
                public void onClick(ClickEvent event) {
                  deleteName.setText(key);
                  handler =
                      deleteForm.addSubmitCompleteHandler(
                          new SubmitCompleteHandler() {
                            @Override
                            public void onSubmitComplete(SubmitCompleteEvent event) {
                              handler.removeHandler();
                              idOrdering.remove(key);
                              id2name.remove(key);
                              repaint();
                            }
                          });
                  deleteForm.submit();
                }
              }));
      files.add(new InlineLabel(" "));
    }
    if (id2name.size() > 0) files.add(new HTML("<br/>"));
  }
Exemplo n.º 7
0
  private void newGame() {
    // das Panel ist unser Spielbrett

    panel.clear();

    // Karten-Array erstellen
    int[] feld = new int[karten * 2];
    for (int i = 0; i < karten; i++) {
      feld[i] = i;
      // 6 Felder weiter das Gleiche
      feld[i + karten] = i;
      // dadurch haben wir ein Array mit dem Muster
      // {1,2,3,4,5,6,1,2,3,4,5,6}
      //
    }
    // jetzt die "Karten" mischen
    for (int i = 0; i < 100; i++) {
      // 2 Zufallszahlen
      int a = (int) Math.round(Math.random() * ((karten * 2) - 1));
      int b = (int) Math.round(Math.random() * ((karten * 2) - 1));
      GWT.log("Tausche " + a + " mit " + b);
      // Mischalgorithmus
      int c = feld[a];
      feld[a] = feld[b];
      feld[b] = c;
    }

    // Karten initialisieren und aufs Spielbrett packen
    for (int i = 0; i < karten * 2; i++) {
      Karte karte = new Karte("card" + (feld[i] + 1) + ".png");
      panel.add(karte);
      // jetzt den Handler verwenden - wir rufen eine Methosde darau auf
      karte.addMouseDownHandler(onCardClick(karte));
    }
  }
Exemplo n.º 8
0
  /**
   * Render the cell located at <code>column</code>, <code>row</code>
   *
   * @param row
   * @param column
   * @param date
   * @param currentMonth
   */
  private void drawCell(int row, int column, Date date, int currentMonth) {
    final Label header = new Label(dayFormatter.format(date));
    header.addStyleName("calendar-cell-header");

    final FlexTable grid = (FlexTable) getWidget();

    grid.getCellFormatter().setStyleName(row, column, "calendar-cell");

    FlowPanel cell = (FlowPanel) grid.getWidget(row, column);
    if (cell == null) {
      // New cell
      cell = new FlowPanel();
      cell.setWidth("100%");

      grid.setWidget(row, column, cell);

    } else {
      // Reusing an existing cell
      cell.clear();
    }

    if (currentMonth != date.getMonth())
      grid.getCellFormatter().addStyleName(row, column, "calendar-cell-other-month");
    if (date.equals(today))
      grid.getCellFormatter().addStyleName(row, column, "calendar-cell-today");

    cell.add(header);
  }
Exemplo n.º 9
0
  /**
   * Re-initializes the additional infos.
   *
   * <p>
   *
   * @param infoBean the info bean
   */
  public void reInitAdditionalInfo(CmsListInfoBean infoBean) {

    m_additionalInfo.clear();
    if (m_openClose != null) {
      m_openClose.removeFromParent();
      m_openClose = null;
    }
    initAdditionalInfo(infoBean);
  }
Exemplo n.º 10
0
 @Override
 public void setTaxonomies(JsArray<TaxonomyDto> taxonomies) {
   this.taxonomies = taxonomies;
   if (taxonomies.length() == 0) {
     panel.clear();
   } else {
     redraw();
   }
 }
Exemplo n.º 11
0
 @Override
 public void dispose() {
   mainPanel.clear();
   mainPanel.removeFromParent();
   mainPanel = null;
   composantPropertiesWidget = null;
   viewListWidget = null;
   save = null;
 }
 @Override
 public void setupContent(LayoutTemplate layoutTemplate) {
   container.clear();
   layoutEditorWidget.setup(container, layoutTemplate);
   for (LayoutRow row : layoutTemplate.getRows()) {
     container.add(createRowView(row));
   }
   container.add(createDropRowPanel());
 }
 private void recreateChosen() {
   if (chosen != null) chosenPlace.clear();
   chosen = new ChosenListBox(false);
   chosenPlace.add(chosen);
   chosen.addChosenChangeHandler(getNewHandler());
   chosen.setEnabled(enabled);
   if (dataProvider.isDataGroupable()) updateChosenMap(dataProvider.getLastLoadedFilteredMap());
   else updateChosenList(dataProvider.getLastLoadedFilteredList());
   updateSelection(dataProvider.getSelectedIndex());
 }
Exemplo n.º 14
0
 /** Update the UI. */
 protected void update() {
   // Either the form content is available or it will be computed
   // asynchronously.
   if (isOverviewVisible) {
     // We already have the content to display.
     buildIframeAndInsertIt(myProcess.getApplicationUrl());
   } else {
     mySecondRowPanel.clear();
   }
 }
Exemplo n.º 15
0
 /** Clears all shown rows and all {@link UserItem}s. */
 public void clear() {
   flowPanel.clear();
   rows = new HashMap<Key, RowWidget>();
   head = new ArrayList<UserItem>();
   tail = new ArrayList<UserItem>();
   headKeys = new HashSet<Key>();
   tailKeys = new HashSet<Key>();
   selected = null;
   endReached = false;
 }
Exemplo n.º 16
0
  private void handleProjects() {
    iconMap.clear();
    projectIconsFlowPanel.clear();

    HashMap<String, Project> projects = clientFactory.getProjects();

    for (Project project : projects.values()) {
      addProjectIcon(project);
    }
  }
Exemplo n.º 17
0
  public void onSuccess(UserListModel model) {

    if (!GwtClientUtils.preSuccessCheck(model, null)) {
      // just simple display message on panel
      msgLabel.clear();
      msgLabel.add(ErrorCode.getMessage(model.errorCode, model.errorCode));
      return;
    }
    // show all users in this space group in table;
    fillPanel(model.getUserModelList());
  }
Exemplo n.º 18
0
 @Override
 public void setInSlot(Object slot, IsWidget content) {
   if (slot == MainTabBasicListPresenterWidget.TYPE_VmListContent) {
     vmPanel.clear();
     if (content != null) {
       vmPanel.add(content);
     }
   } else {
     super.setInSlot(slot, content);
   }
 }
Exemplo n.º 19
0
  /**
   * Selects and activates a given tab, if possible.
   *
   * @param tab the tab name/identifier to activate
   */
  private void activateTab(final String tab) {
    if (activeTab != null) {
      activeTab.unSelect();
    }

    activeTab = tabs.get(tab);
    activeTab.select();

    tabContents.clear();
    tabContents.add(activeTab.getContents());
  }
Exemplo n.º 20
0
 public void update() {
   commentContainer.clear();
   List<Entry> tmp = new ArrayList<Entry>();
   for (Entry e : commentList) {
     tmp.add(e);
   }
   commentList.clear();
   for (Entry e : tmp) {
     addComment(e);
   }
 }
 /** Put the widget in list mode. */
 private void setListMode() {
   titlePanel.setVisible(true);
   postContent.setVisible(true);
   stream.setVisible(true);
   sortPanel.setVisible(true);
   searchStatusWidget.setVisible(true);
   searchBoxWidget.setVisible(true);
   feedLinkWidget.setVisible(true);
   sortSearchRow.setVisible(true);
   activityDetailPanel.clear();
   EventBus.getInstance().notifyObservers(new ChangeActivityModeEvent(false));
 }
Exemplo n.º 22
0
 /**
  * Replace the list displayed with the given one.
  *
  * @param pDisplayWidgets the new list of items to display
  */
 protected void setDisplayWidgets(final List<W> pDisplayWidgets) {
   iGuiList.clear();
   int i = 0;
   for (W w : pDisplayWidgets) {
     CbGenericListItem<W> newRow =
         new CbGenericListItem<W>(getSelectorCallback(), getMoreArrowCallback());
     newRow.setDisplayWidget(w);
     newRow.setRowIdx(i++);
     iGuiList.add(newRow);
   }
   checkEmptyListHint();
 }
Exemplo n.º 23
0
  @Override
  public void doShowPage() {
    // table.setStyleName("permission-grant-table");
    mainPanel.clear();
    mainPanel.add(new Label(administrationConstants.loading()));

    AbstractCallback callback =
        new AbstractCallback(errorPanel) {
          public void onCallSuccess(Object permissions) {
            receivePermissions((Collection) permissions);
          }
        };
    getPermissions(callback);
  }
Exemplo n.º 24
0
 @Override
 public void resetQuestionView() {
   openEndedQuestionText.setHTML("");
   hintsButton.setText(i18n.GL0667());
   hintsButton.getElement().setAttribute("alt", i18n.GL0667());
   hintsButton.getElement().setAttribute("title", i18n.GL0667());
   hintsButton.setStyleName(oeStyle.hintsActiveButton());
   explanaionButton.setStyleName(oeStyle.hintsActiveButton());
   explanationContainer.removeStyleName(oeStyle.explanationTextBorder());
   hintsContainer.clear();
   explanationContainer.clear();
   clearAnswerOptionsContainer();
   openEndedQuestionImage.getElement().removeAttribute("src");
 }
Exemplo n.º 25
0
  // TODO
  private void drawLoggedIn() {
    hideLoading();

    pUi.clear();

    hAccountSettings = new Hyperlink("My Account", "account_Profile");
    hAccountLogout = new Hyperlink("Logout", "account_Logout");

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(hAccountSettings);
    hp.add(new HTML("&nbsp;&nbsp;"));
    hp.add(hAccountLogout);

    pUi.add(hp);
  }
Exemplo n.º 26
0
  /**
   * Navigation between pages
   *
   * @param activePage
   */
  private void setActivePage(ActivePage activePage) {
    this.activePage = activePage;

    switch (activePage) {
      case ABOUT:
        mainCenterPanel.clear();
        mainCenterPanel.add(aboutPanel);
        break;
      case SEARCH:
        mainCenterPanel.clear();
        mainCenterPanel.add(searchPanel);
        break;
      case BROWSE:
        mainCenterPanel.clear();
        mainCenterPanel.add(browsePanel);
        break;
      case CONTACT:
        mainCenterPanel.clear();
        mainCenterPanel.add(contactPanel);
        break;
      default:
        break;
    }
  }
Exemplo n.º 27
0
  private void downloadData() {
    content.clear();
    content.add(new HTMLPanel("<h1>Download data</h1>"));
    final DownloadData download = new DownloadData();

    switch (parameters.state) {
      case SUSPENDED:
      case ACTIVE:
        download.dateFrom.setValue(new Date(parameters.startDate), true);
        download.dateTo.setValue(new Date(parameters.endDate), true);
        break;
      case NOT_INITIALISED:
        break;
    }
    content.add(download);
  }
Exemplo n.º 28
0
  /** Update toolbars. */
  public void updateToolbarPanel() {
    toolBPanel.clear();
    for (ToolBarW toolbar : toolbars) {
      if (toolbar != null) {
        toolbar.buildGui();
        // TODO
        // toolbarPanel.add(toolbar, Integer.toString(getViewId(toolbar)));
        toolBPanel.add(toolbar);
      }
    }

    // TODO
    // toolbarPanel.show(Integer.toString(activeToolbar));
    onResize();
    toolBPanel.setVisible(true);
  }
Exemplo n.º 29
0
 /** Average star ratings widget will get integrated. */
 private void setAvgRatingWidget() {
   ratingWidgetView = new RatingWidgetView();
   if (collectionItemDo.getResource().getRatings() != null) {
     if (collectionItemDo.getResource().getRatings().getCount() != null
         && collectionItemDo.getResource().getRatings().getCount() != 0) {
       ratingWidgetView.getRatingCountOpenBrace().setText(i18n.GL_SPL_OPEN_SMALL_BRACKET());
       ratingWidgetView
           .getRatingCountLabel()
           .setText(collectionItemDo.getResource().getRatings().getCount().toString());
       ratingWidgetView.getRatingCountCloseBrace().setText(i18n.GL_SPL_CLOSE_SMALL_BRACKET());
       ratingWidgetView.setAvgStarRating(collectionItemDo.getResource().getRatings().getAverage());
       ratingWidgetPanel.getElement().setId("fpnlRatingWidgetPanel");
     }
   }
   ratingWidgetPanel.clear();
   ratingWidgetPanel.add(ratingWidgetView);
 }
Exemplo n.º 30
0
  private void updateCommentList() {
    for (CommentWidget widget : widgets.values()) {
      if (widget.isEditMode()) return;
    }
    commentListPanel.clear();
    List<Comment> comments = parent.getComments();
    Collections.sort(comments, Comment.REVERSE_DATEANDTIME_COMPARATOR);
    List<Comment> pageComments = filterCurrentPageComments(comments);
    for (Comment comment : pageComments) {
      CommentWidget widget = getWidget(comment);
      commentListPanel.add(widget);
    }

    if (comments.size() > COMMENTS_PER_PAGE) {
      commentListPanel.add(createPageNavigator(comments.size()));
    }
  }