private void renderDBfillers() {

    descriptionEditor.clear();

    richTextEditor = new RichTextEditor();
    richTextEditor.setHeight(200);
    richTextEditor.setWidth("600px");
    richTextEditor.setBorder("1px solid green");

    richTextEditor.setZIndex(0);

    // richTextEditor.setOverflow(Overflow.HIDDEN);
    richTextEditor.setCanDragResize(true);
    //  richTextEditor.setZIndex(-99900);
    // richTextEditor.setShowEdges(true);

    // Standard control group options include
    // "fontControls", "formatControls", "styleControls" and "colorControls"
    // richTextEditor.setControlGroups(new String[]{"fontControls", "styleControls"});
    richTextEditor.setValue(dto.getDesctiption());

    descriptionEditor.add(richTextEditor);
    // layout.addMember();

    elasticDBfields.clear();
    _db_.setDesc("Метаданные исследования");
    mv = new MultiValuedField(_db_, null, dto.getFilling(), "");
    elasticDBfields.add(mv);
  }
 @Override
 public void showProgressBar(boolean b) {
   if (b) {
     offersPanel.add(new ProgressIndicatorPanel());
     placesPanel.add(new ProgressIndicatorPanel());
     friendsPanel.add(new ProgressIndicatorPanel());
   } else {
     offersPanel.clear();
     placesPanel.clear();
     friendsPanel.clear();
   }
 }
Example #3
0
 public void onDisplayMessage(String message, Boolean clear) {
   if (clear) {
     vp.clear();
   }
   vp.add(new Label(message));
   RootPanel.get("messages").add(vp);
 }
  public int load(Topic topic) {
    super.load(topic);
    childPanel.clear();

    int childCount = 0;
    for (Iterator iterator = topic.getInstances().iterator(); iterator.hasNext(); ) {

      TopicTypeConnector conn = (TopicTypeConnector) iterator.next();

      Topic child = conn.getTopic();
      if (manager.isEdittable() || child.isPublicVisible()) {
        childPanel.add(new TopicLink(child));
      }

      childCount++;
    }

    if (childCount < 1) {
      childPanel.add(new Label(" "));
    }
    int scrollH = childCount * HEIGHT_PER_ENTRY;
    scrollH = (scrollH < MAX_HEIGHT) ? scrollH : MAX_HEIGHT;
    scroll.setHeight(scrollH + "px");
    System.out.println("ChildGadg scroll heigh " + scrollH);

    return childCount;
  }
Example #5
0
  private void showAddNewComment() {
    newCommentLayout.clear();
    final TextArea comment = new TextArea();
    comment.setWidth("100%");
    newCommentLayout.add(comment);

    Button ok = new Button(constants.OK());
    Button cancel = new Button(constants.Cancel());

    ok.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent sender) {
            sendNewComment(comment.getText());
          }
        });

    cancel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent sender) {
            showNewCommentButton();
          }
        });

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(ok);
    hp.add(cancel);

    newCommentLayout.add(hp);

    comment.setFocus(true);
  }
 private void findAll() {
   resultsPanel.clear();
   final Label l = new Label("All Clients:");
   l.setStyleName("title");
   resultsPanel.add(l);
   getService().findAllClients(updateSearchResultsCallback);
 }
  @Override
  protected void onAttach() {
    super.onAttach();
    Image img =
        new Image(
            getBaseImageUrl()
                + "?merchant_id="
                + getMerchantId()
                + "&w="
                + getWidth()
                + "&h="
                + getHeight()
                + "&style="
                + getStyle()
                + "&variant="
                + getVariant()
                + "&loc="
                + getLoc());
    img.setTitle("Fast checkout through Google");

    PushButton pb = new PushButton(img);
    pb.addClickHandler(this);
    vpanel.clear();
    vpanel.add(pb);
  }
Example #8
0
 private void showEditForm(
     String nameStr, String userStr, String passStr, String deptStr, boolean editing) {
   VerticalPanel editPanel = new VerticalPanel();
   HorizontalPanel row1 = new HorizontalPanel();
   Label nameLabel = new Label("Name: ");
   row1.add(nameLabel);
   row1.add(nameBox);
   nameBox.setText(nameStr);
   editPanel.add(row1);
   HorizontalPanel row2 = new HorizontalPanel();
   Label userLabel = new Label("Username: "******"Password: "******"Department: ");
   row4.add(deptLabel);
   row4.add(deptBox);
   deptBox.setText(deptStr);
   editPanel.add(row4);
   if (editing) {
     editPanel.add(editSubmitButton);
   } else {
     editPanel.add(addSubmitButton);
   }
   mainPanel.clear();
   mainPanel.add(editPanel);
 }
Example #9
0
 private void showWorkersCellTable(String json) {
   jsonData = getJSONData(json);
   workers = new ArrayList<MyWorker>();
   Worker worker = null;
   for (int i = 1; i < jsonData.length(); i++) {
     worker = jsonData.get(i);
     String name = worker.getName();
     String username = worker.getUsername();
     String department = worker.getDepartment();
     int id = worker.getId();
     MyWorker w = new MyWorker(name, username, department, id);
     workers.add(w);
   }
   TextColumn<MyWorker> nameCol =
       new TextColumn<MyWorker>() {
         @Override
         public String getValue(MyWorker worker) {
           return worker.name;
         }
       };
   TextColumn<MyWorker> usernameCol =
       new TextColumn<MyWorker>() {
         @Override
         public String getValue(MyWorker worker) {
           return worker.username;
         }
       };
   TextColumn<MyWorker> deptCol =
       new TextColumn<MyWorker>() {
         @Override
         public String getValue(MyWorker worker) {
           return worker.department;
         }
       };
   CellTable<MyWorker> table = new CellTable<MyWorker>();
   final SingleSelectionModel<MyWorker> selectionModel = new SingleSelectionModel<MyWorker>();
   table.setSelectionModel(selectionModel);
   selectionModel.addSelectionChangeHandler(
       new SelectionChangeEvent.Handler() {
         public void onSelectionChange(SelectionChangeEvent e) {
           MyWorker choice = selectionModel.getSelectedObject();
           if (choice != null) {
             selectedWorker = choice;
           }
         }
       });
   table.addColumn(nameCol, "Name");
   table.addColumn(usernameCol, "Username");
   table.addColumn(deptCol, "Department");
   table.setRowCount(workers.size(), true);
   table.setRowData(0, workers);
   HorizontalPanel buttonPanel = new HorizontalPanel();
   buttonPanel.add(addButton);
   buttonPanel.add(editButton);
   buttonPanel.add(deleteButton);
   mainPanel.clear();
   mainPanel.add(buttonPanel);
   mainPanel.add(table);
 }
  private void draw() {

    pWidget.clear();

    pWidget.add(new HTML("<br>ElevationService. Click for elevation:"));

    drawMap();
  }
 private void setScoreBoxes(int sets) {
   player1Score.clear();
   player2Score.clear();
   scorePanel.clear();
   for (int i = 0; i < sets; i++) {
     scorePanel.add(createScoreRow());
   }
   setMode = sets;
 }
  private void draw() {

    pWidget.clear();

    pWidget.add(new HTML("<br>Advanced Map Layers Example"));

    drawMap();
    drawLayerControls();
  }
Example #13
0
 private void updateCommentList(List<DiscussionRecord> ls) {
   if (ls.size() == lastCount) return; // don't want to over do it boys...
   commentList.clear();
   lastCount = ls.size();
   for (int rcdCounter = lastCount - 1; rcdCounter >= 0; rcdCounter--) {
     DiscussionRecord dr = ls.get(rcdCounter);
     appendComment(dr);
   }
 }
 private void search() {
   resultsPanel.clear();
   final Label l = new Label("Search Results:");
   l.setStyleName("title");
   resultsPanel.add(l);
   int selectedCategory = categoriesList.getSelectedIndex();
   int sc = Integer.valueOf(categoriesList.getValue(selectedCategory));
   getService().findClientsByCriteria(searchBox.getText(), sc, updateSearchResultsCallback);
 }
Example #15
0
 public void redraw() {
   tableModel.setRows(resultRows);
   pagingScrollTable = builder.build(tableModel);
   pagingScrollTable.setResizePolicy(ResizePolicy.FILL_WIDTH);
   layout.clear();
   layout.add(pagingScrollTable);
   pagingScrollTable.reloadPage();
   pagingScrollTable.fillWidth();
 }
Example #16
0
  private void showNewCommentButton() {
    newCommentLayout.clear();

    HorizontalPanel hp = new HorizontalPanel();

    Button createNewComment = new Button(constants.AddADiscussionComment());
    createNewComment.setEnabled(!this.readOnly);
    hp.add(createNewComment);

    if (UserCapabilities.INSTANCE.hasCapability(Capability.SHOW_ADMIN)) {
      Button adminClearAll = new Button(constants.EraseAllComments());
      adminClearAll.setEnabled(!readOnly);
      hp.add(adminClearAll);
      adminClearAll.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent sender) {
              if (Window.confirm(constants.EraseAllCommentsWarning())) {
                assetService.clearAllDiscussionsForAsset(
                    artifact.getUuid(),
                    new GenericCallback<java.lang.Void>() {
                      public void onSuccess(Void v) {
                        updateCommentList(new ArrayList<DiscussionRecord>());
                      }
                    });
              }
            }
          });
    }

    final String feedURL =
        GWT.getModuleBaseURL()
            + "feed/discussion?package="
            + ((Asset) artifact).getMetaData().getModuleName()
            + "&assetName="
            + URL.encode(artifact.getName())
            + "&viewUrl="
            + Util.getSelfURL();
    Image image = new Image(images.feed());
    image.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent arg0) {
            Window.open(feedURL, "_blank", null);
          }
        });
    hp.add(image);

    newCommentLayout.add(hp);

    newCommentLayout.setCellHorizontalAlignment(hp, HasHorizontalAlignment.ALIGN_RIGHT);
    createNewComment.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent sender) {
            showAddNewComment();
          }
        });
  }
  public static void init(
      final String ID, final String group, final String search, final String field) {

    InitializeUniqueIDAppllication.initRootPanel();

    vpMain.clear();
    vpMain.add(new LoadingPanel());

    if (ID != null) {

      GetUniqueID.getFromID(ID, group, true);

    } else if (search != null) {

      SearchField.doSearch(search, field);

    } else {

      vpMain.clear();
      vpMain.add(new Home());
    }
  }
Example #18
0
 private void sendNewComment(String text) {
   newCommentLayout.clear();
   newCommentLayout.add(new Image(images.spinner()));
   assetService.addToDiscussionForAsset(
       artifact.getUuid(),
       text,
       new GenericCallback<List<DiscussionRecord>>() {
         public void onSuccess(List<DiscussionRecord> result) {
           showNewCommentButton();
           updateCommentList(result);
         }
       });
 }
 private void updatePanel() {
   if ((loggedInPlayer == null)
       || (league == null)
       || (!league.getPlayers().contains(loggedInPlayer))) {
     mainPanel.clear();
     panelIsVisible = false;
     return;
   } else if (!panelIsVisible) {
     populatePanel();
     panelIsVisible = true;
   }
   populatePlayerBox(player1Box);
   populatePlayerBox(player2Box);
 }
  @Override
  public void init() {
    body.clear();

    HashMap<String, String> params = new HashMap<String, String>();
    params.put(MGenericResource.PARAM_URI_READONLY, "true");
    params.put(MGenericResource.TITLE_URI_READONLY, "false");
    params.put(LOnlineResourceCardPanel.KNOWN_RESOURCE, "false");

    //		Widget w = _application.getResourcePanelsManager().getResourcePanel(
    //				((IDomeo)_application).getPersistenceManager().getCurrentResource().getClass().getName());
    //
    //		((IResourceLensComponent)w).initializeLens(((IDomeo)_application)
    //				.getPersistenceManager().getCurrentResource(), params);
  }
  private void getNotes() {

    notesPanel.clear();

    service.getNotes(
        new AsyncCallback() {
          public void onFailure(Throwable throwable) {
            notesPanel.add(new HTML("No notes stored so far."));
            Window.alert("Could not retrieve notes: " + throwable.getMessage());
          }

          public void onSuccess(Object o) {
            ArrayList notesList = (ArrayList) o;
            for (int i = 0; i < notesList.size(); i++) {
              final Note note = (Note) notesList.get(i);

              final HorizontalPanel noteEntry = new HorizontalPanel();
              noteEntry.setStyleName("noteEntry");

              final HTML noteTitle = new HTML(note.getTitle());
              noteTitle.setStyleName("noteTitle");

              final HTML noteText = new HTML(note.getText());
              noteText.setStyleName("noteText");

              final Button delButton = new Button("Delete");
              delButton.setStyleName("noteControls");
              delButton.addClickListener(
                  new ClickListener() {

                    public void onClick(Widget widget) {
                      deleteNote(note.getPath());
                    }
                  });

              noteEntry.add(noteTitle);
              noteEntry.add(noteText);
              noteEntry.add(delButton);

              notesPanel.add(noteEntry);
            }

            if (notesList.size() == 0) {
              notesPanel.add(new HTML("No notes stored so far."));
            }
          }
        });
  }
Example #22
0
  private void updateMessagePanel() {

    messagePanel.clear();
    messageTextPanel.clear();

    updateIcon();
    if (icon != null) {
      messagePanel.add(icon);
    }

    String[] lines = message.split("\n");
    for (String item : lines) {
      messageTextPanel.add(new Label(item));
    }
    messagePanel.add(messageTextPanel);
  }
Example #23
0
 private void showLoginForm() {
   VerticalPanel editPanel = new VerticalPanel();
   HorizontalPanel row1 = new HorizontalPanel();
   Label userLabel = new Label("Username: "******"Password: ");
   row2.add(passLabel);
   row2.add(passBox);
   editPanel.add(row2);
   editPanel.add(loginButton);
   mainPanel.clear();
   mainPanel.add(editPanel);
 }
Example #24
0
  private void openDocumentationOption(String chartOption) {

    MetricsOptions.untoggleOptions();
    vpMetricsChart.clear();

    if (chartOption != null && chartOption.equals(OPTION_TOTALS_CHART)) {

      MetricsOptions.radioTotals.setValue(true);

      vpMetricsChart.add(new CurrentProductivityColumnsChart());

    } else {

      MetricsOptions.radioProductivity.setValue(true);

      vpMetricsChart.add(new ProductivityTimelineChart());
    }
  }
Example #25
0
  public boolean setInput(ArrayList<Ob> objetos) {
    if ((objetos == null) || (parser == null)) {
      return false;
    }

    formularios.clear();
    painelWidgets.clear();

    T buffer;
    for (Ob objeto : objetos) {
      buffer = parser.set(objeto);
      if (buffer != null) {
        formularios.add(buffer);
        painelWidgets.add(buffer);
      }
    }
    return true;
  }
Example #26
0
  private void doViews() {

    viewsPanel.clear();
    ruleViews.clear();
    final LazyStackPanel panel = new LazyStackPanel();

    // the first row will be expanded
    int rowNumber = 1;
    for (final MultiViewRow row : rows) {

      panel.add(
          row.getName(),
          new LoadContentCommand() {

            public Widget load() {
              final SimplePanel content = new SimplePanel();

              if (assets.containsKey(row.getUuid())) {
                addRuleViewInToSimplePanel(row, content, assets.get(row.getUuid()));
              } else {
                RepositoryServiceFactory.getAssetService()
                    .loadRuleAsset(
                        row.getUuid(),
                        new GenericCallback<Asset>() {

                          public void onSuccess(final Asset asset) {
                            assets.put(asset.getUuid(), asset);

                            addRuleViewInToSimplePanel(row, content, asset);
                          }
                        });
              }
              return content;
            }
          },
          rowNumber == 1);

      rowNumber++;
    }

    viewsPanel.add(panel);
  }
Example #27
0
  public void onSuccess(PageItemListModel model) {
    if (!GwtClientUtils.preSuccessCheck(model, message)) {
      return;
    }

    pagesPanel.clear();
    for (PageItemModel item : model.itemList) {
      Hyperlink link =
          new Hyperlink(item.title, GwtUtils.getSpacePageToken(item.spaceUname, item.title));
      link.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              TagPopup.this.hide();
            }
          });
      pagesPanel.add(link);
    }

    resized();
  }
  public void drawError(String error) {
    hideLoading();

    pError.clear();
    pError.setVisible(true);

    error = Global_String.removeHtmlTags(error);
    HTML htmlError = new HTML(error);

    pError.add(htmlError);

    // hide error shortly after fire
    Timer t =
        new Timer() {
          public void run() {
            pError.setVisible(false);
          }
        };
    t.schedule(3000);
  }
  private void setNewAgentSelected(IAgent newagent) {
    currentAgent = newagent;
    propertyPanel.clear();
    propertyPanel.add(new Label(newagent.getAgentDescription()));

    messagesFromAgent = new ArrayList<EsbHistoryItem>();
    for (EsbHistoryItem currentHistoryItem : Esb.getHistory()) {
      if (currentHistoryItem.senderAgent == newagent) {
        messagesFromAgent.add(currentHistoryItem);
      }
    }

    messagesToAgent = new ArrayList<EsbHistoryItem>();
    for (EsbHistoryItem currentHistoryItem : Esb.getHistory()) {
      for (IAgent receiverAgent : currentHistoryItem.receiverAgents) {
        if (receiverAgent == newagent) {
          messagesToAgent.add(currentHistoryItem);
        }
      }
    }
  }
Example #30
0
  public VerticalPanel createMenu() {
    menu.clear();

    AsyncCallback<ArrayList<Product>> callback =
        new AsyncCallback<ArrayList<Product>>() {
          @Override
          public void onFailure(Throwable caught) {
            // caught.printStackTrace();
            System.out.println(caught.getCause());
          }

          public void onSuccess(ArrayList<Product> result) {
            if (result.size() == 0) {
              menu.add(new Label("Geen categori\u00EBn gevonden"));
            }
            if (lijstNamen.size() == 0) {
              categorie.addItem("-- Alle Categori\u00EBn --");
              lijstNamen = new ArrayList<String>();
              for (Product p : result) {
                String categorieNaam = p.getCategorie();
                if (!lijstNamen.contains(categorieNaam)) {
                  if (categorieNaam != "") {
                    lijstNamen.add(categorieNaam);
                    categorie.addItem(categorieNaam);
                  }
                }
              }
            }

            ft.setWidget(0, 0, box);
            ft.setWidget(0, 1, categorie);
            ft.setWidget(0, 2, btnFilter);
            menu.add(ft);
          }
        };
    Zwendelaar.get().getProducts(callback);
    return menu;
  }