コード例 #1
0
ファイル: GusListView.java プロジェクト: hvidsten/guslist-gae
  private HorizontalPanel makePostRow(final PostData post, final VerticalPanel mainPanel) {
    HorizontalPanel row = new HorizontalPanel();
    Label titleLabel = new Label("Title: " + post.getTitle() + " ");
    titleLabel.addStyleName("postLabel");
    Label descrLabel = new Label(post.getDescription() + " ");
    descrLabel.addStyleName("postLabel");
    Label priceLabel = new Label("Price: $" + post.getPrice() + " ");
    priceLabel.addStyleName("postLabel");
    Label nameLabel = new Label("Seller Name: " + post.getSellerName() + " ");
    nameLabel.addStyleName("postLabel");
    Anchor link = new Anchor("Uploaded File", post.getURL());
    link.setTarget("_blank");
    Button addressButton = new Button("Address");
    addressButton.addStyleName("postInfoButton");
    addressButton.setText("Address");
    // add a clickListener to the button
    addressButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            doMapPopup(post);
          }
        });

    Button deleteButton = new Button("Delete");
    deleteButton.addStyleName("postInfoButton");
    deleteButton.setText("Delete");
    // add a clickListener to the button
    deleteButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            control.handleDeleteRequest(post);
          }
        });
    Button editButton = new Button("Edit");
    editButton.addStyleName("postInfoButton");
    editButton.setText("Edit");
    // add a clickListener to the button
    editButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            viewPostEditForm(post);
          }
        });

    row.add(titleLabel);
    row.add(descrLabel);
    row.add(priceLabel);
    row.add(nameLabel);
    row.add(link);
    row.add(new Label("  "));
    row.add(addressButton);
    row.add(new Label("  "));
    row.add(editButton);
    row.add(new Label("  "));
    row.add(deleteButton);
    return row;
  }
コード例 #2
0
  public SliderScrollPanel(EditorPanel ed) {

    this.editor = ed;

    sinkEvents(Event.ONCONTEXTMENU | Event.ONCLICK);
    contextMenu = ContextMenu.getInstance();

    menu = new VerticalPanel();
    Anchor editLabel = new Anchor("Edit");
    editLabel.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (clickedElement != null) {
              ContextMenu.hide();
              MapView mapView = MapView.getInstance();
              //					mapView.saveMap();
              Jq.hide(mapView.getElement().getId(), "slow");
              AddMapObjectView view = AddMapObjectView.getInstance();
              if (!view.isAttached()) {
                view.setVisible(false);
                BattleMap.add(view);
              }
              Jq.show(view.getElement().getId(), "slow");

              MapObject mo = editor.getMapObjectById(clickedElement.getId());
              EditorPanel.setSelected(clickedElement, mo, editor.getDimensions());
              view.setSelectedObject(mo);
            }
          }
        });
    menu.add(editLabel);
  }
コード例 #3
0
 private void initialize() {
   String identifier = stableIdentifier.getDisplayName();
   Anchor link = new Anchor(identifier, "/cgi-bin/control_panel_st_id?ST_ID=" + identifier);
   link.setTarget("_blank");
   link.setTitle("Go to REACTOME control panel for " + identifier);
   initWidget(link);
 }
コード例 #4
0
  /**
   * Constructor.
   *
   * @param inOrgName Org Name.
   * @param inOrgEntityId Org id.
   * @param inAvatarId Avatar id.
   * @param inOrgUrl Org url.
   * @param inOrgDescription Org description.
   */
  public OrgAboutPanel(
      final String inOrgName,
      final long inOrgEntityId,
      final String inAvatarId,
      final String inOrgUrl,
      final String inOrgDescription) {
    add(
        new AvatarWidget(
            inOrgEntityId, inAvatarId, EntityType.ORGANIZATION, AvatarWidget.Size.Normal));

    Label title = new Label(inOrgName);
    title.addStyleName("profile-org-title");
    this.add(title);

    Anchor url = new Anchor("Website", inOrgUrl, "_NEW");
    url.addStyleName("profile-website");
    if (inOrgUrl == null) {
      url.addStyleName("no-value");
    }
    this.add(url);

    if (inOrgDescription != null && !inOrgDescription.equals("")) {
      Label subheader = new Label("");
      subheader.addStyleName("profile-subheader");
      this.add(subheader);

      Label mission = new Label(inOrgDescription);
      mission.addStyleName("profile-mission");
      this.add(mission);
    }
  }
コード例 #5
0
ファイル: UsersView.java プロジェクト: Pacane/TDD-GWTP
  @Override
  public void displayUsers(Map<Integer, String> users) {
    usersList.clear();

    for (Integer userId : users.keySet()) {
      HTMLPanel panel = new HTMLPanel("");

      Anchor linkToEdit = new Anchor();

      linkToEdit.setText(users.get(userId));

      PlaceRequest placeToGo =
          new PlaceRequest.Builder()
              .nameToken(NameTokens.USER)
              .with(NameTokens.PARAM_ID, String.valueOf(userId))
              .build();
      linkToEdit.setHref("#" + tokenFormatter.toPlaceToken(placeToGo));

      Button deleteButton = new Button();
      deleteButton.setText("X");
      deleteButton.addClickHandler(clickEvent -> getUiHandlers().deleteUser(userId));

      panel.add(linkToEdit);
      panel.add(deleteButton);

      usersList.add(panel);
    }
  }
コード例 #6
0
ファイル: DeviceDiskViewImpl.java プロジェクト: sosilent/euca
 private void updateSearchResultButtonStatus() {
   int size = selection.getSelectedSet().size();
   buttonAddDisk.setEnabled(true);
   buttonDeleteDisk.setEnabled(size != 0 && presenter.canDeleteDisk());
   buttonModifyDisk.setEnabled(size == 1 && presenter.canModifyDisk());
   buttonClearSelection.setEnabled(size != 0);
 }
コード例 #7
0
  protected Widget createCurrentSelectionWidget() {
    if (!displayerSettings.isFilterEnabled()) return null;

    Set<String> columnFilters = filterColumns();
    if (columnFilters.isEmpty()) return null;

    HorizontalPanel panel = new HorizontalPanel();
    panel.getElement().setAttribute("cellpadding", "2");

    for (String columnId : columnFilters) {
      List<Interval> selectedValues = filterIntervals(columnId);
      DataColumn column = dataSet.getColumnById(columnId);
      for (Interval interval : selectedValues) {
        String formattedValue = formatInterval(interval, column);
        panel.add(new Label(formattedValue));
      }
    }

    Anchor anchor = new Anchor(GoogleDisplayerConstants.INSTANCE.googleDisplayer_resetAnchor());
    panel.add(anchor);
    anchor.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            filterReset();

            // Update the chart view in order to reflect the current selection
            // (only if not has already been redrawn in the previous filterUpdate() call)
            if (!displayerSettings.isFilterSelfApplyEnabled()) {
              updateVisualization();
            }
          }
        });
    return panel;
  }
コード例 #8
0
 public void setResourcePlayLink() {
   Anchor resourceAnchor = new Anchor();
   resourceAnchor.setHref(getResourceLink());
   resourceAnchor.setStyleName("");
   resourceAnchor.getElement().appendChild(resourceImageContainer.getElement());
   resourceThumbContainer.insert(resourceAnchor, 0);
 }
コード例 #9
0
    void addOne(final AgreementInfo info, final String k) {
      final int row = table.getRowCount();
      table.insertRow(row);
      applyDataRowStyle(row);

      final ContributorAgreement cla = info.agreements.get(k);
      final String statusName;
      if (cla == null) {
        statusName = Util.C.agreementStatus_EXPIRED();
      } else {
        statusName = Util.C.agreementStatus_VERIFIED();
      }
      table.setText(row, 1, statusName);

      if (cla == null) {
        table.setText(row, 2, "");
        table.setText(row, 3, "");
      } else {
        final String url = cla.getAgreementUrl();
        if (url != null && url.length() > 0) {
          final Anchor a = new Anchor(cla.getName(), url);
          a.setTarget("_blank");
          table.setWidget(row, 2, a);
        } else {
          table.setText(row, 2, cla.getName());
        }
        table.setText(row, 3, cla.getDescription());
      }
      final FlexCellFormatter fmt = table.getFlexCellFormatter();
      for (int c = 1; c < 4; c++) {
        fmt.addStyleName(row, c, Gerrit.RESOURCES.css().dataCell());
      }

      setRowItem(row, cla);
    }
コード例 #10
0
ファイル: Kirin.java プロジェクト: luozengbin/aki-live
 private void loadLogin() {
   // Assemble login panel.
   Anchor loginLink = new Anchor("Sign In");
   loginLink.setHref(loginInfo.getLoginUrl());
   loginInfoPanel.add(new Label("Please sign in to your Google Account."));
   loginInfoPanel.add(loginLink);
   RootPanel.get("authInfo").add(loginInfoPanel);
 }
コード例 #11
0
ファイル: Kirin.java プロジェクト: luozengbin/aki-live
 private void loadLogout() {
   // Assemble logout panel.
   Anchor logoutLink = new Anchor("Sign Out");
   logoutLink.setHref(loginInfo.getLogoutUrl());
   loginInfoPanel.add(new Label(loginInfo.getEmailAddress()));
   loginInfoPanel.add(logoutLink);
   RootPanel.get("authInfo").add(loginInfoPanel);
 }
コード例 #12
0
 /** Init the actions button */
 private void init() {
   // Delete button
   delete = new Anchor();
   delete.setHref("#");
   delete.addStyleName("delete_icon");
   delete.setTitle("Supprimer");
   this.add(delete);
 }
コード例 #13
0
 @Override
 public void setHasMoreStories(boolean hasMore) {
   if (!hasMore) {
     aLoadMore.setText("No more stories to load");
   } else {
     aLoadMore.setText("Load more");
   }
 }
コード例 #14
0
 protected Anchor createTriggerAnchor(String jobName) {
   Anchor anchor = new Anchor("Run this job now");
   anchor.addStyleName("TriggerJob");
   ClickHandler clickHandler =
       new TriggerJobClickHandler(schedulingService, getTenant(), _scheduleDefinitionForJob);
   clickHandler = new RemoveWizardClickHandler(clickHandler, JobWizardController.this, jobName);
   anchor.addClickHandler(clickHandler);
   return anchor;
 }
コード例 #15
0
 @Override
 public void setLoading(boolean isLoading) {
   if (isLoading) {
     aLoadMore.addStyleName("hide");
     divPreloader.removeClassName("hide");
   } else {
     divPreloader.addClassName("hide");
     aLoadMore.removeStyleName("hide");
   }
 }
コード例 #16
0
  @Override
  public void setSelectedVariableName(
      VariableDto variable, VariableDto previousVariable, VariableDto nextVariable) {
    variableNameSuggestBox.setText(variable == null ? null : variable.getName());
    previous.setTitle(previousVariable == null ? null : previousVariable.getName());
    next.setTitle(nextVariable == null ? null : nextVariable.getName());

    previous.setEnabled(previousVariable != null);
    next.setEnabled(nextVariable != null);
  }
コード例 #17
0
 protected Anchor createSchedulingAnchor(String jobName) {
   final Anchor anchor = new Anchor("Set up a job schedule");
   anchor.addStyleName("ScheduleJob");
   ClickHandler clickHandler =
       new CustomizeScheduleClickHandler(
           null, schedulingService, getTenant(), _scheduleDefinitionForJob);
   clickHandler = new RemoveWizardClickHandler(clickHandler, JobWizardController.this, jobName);
   anchor.addClickHandler(clickHandler);
   return anchor;
 }
コード例 #18
0
 @Override
 public void addFilterReset() {
   Anchor anchor = new Anchor(ChartJsDisplayerConstants.INSTANCE.chartjsDisplayer_resetAnchor());
   filterPanel.add(anchor);
   anchor.addClickHandler(
       new ClickHandler() {
         public void onClick(ClickEvent event) {
           getPresenter().onFilterResetClicked();
         }
       });
 }
コード例 #19
0
ファイル: StoreListItem.java プロジェクト: geniusit/errai
 @Override
 public void setModel(final Store model) {
   link.setText(model.getName());
   link.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           groceryListWidget.filterOn(model);
         }
       });
 }
コード例 #20
0
ファイル: StoryverseHeader.java プロジェクト: ktg/storyverse
 @Override
 public void onFailure(final Throwable error) {
   if (error instanceof HTTPException) {
     final HTTPException exception = (HTTPException) error;
     if (exception.getCode() == 401) {
       anchor.setText("Login");
       anchor.setHref(exception.getMessage());
       login = exception.getMessage();
     }
   }
 }
コード例 #21
0
 @Override
 public void addProperty(EntryDto dto) {
   if (dto.getValue().toLowerCase().startsWith("http")) {
     Anchor a = new Anchor();
     a.setTarget("_blank");
     a.setHref(dto.getValue());
     a.setText(dto.getValue());
     properties.addProperty(new Label(dto.getKey()), a.asWidget());
   } else {
     properties.addProperty(dto.getKey(), dto.getValue());
   }
 }
コード例 #22
0
 @Override
 public void updatePathLink() {
   if (presenter.currentCMSContentSummary != null) {
     String path = presenter.currentCMSContentSummary.getPath();
     if (path != null && !path.equals("")) {
       pathLink.setText(path);
     } else {
       pathLink.setText("/");
     }
   } else {
     pathLink.setText("/");
   }
 }
コード例 #23
0
ファイル: HomePage.java プロジェクト: OSLL/geo2tag-web
 @Override
 protected List<Anchor> getLinks() {
   Anchor loginLink = new Anchor(LOC.login());
   loginLink.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           GTShell.Instance.setContent(LoginWidget.Instance());
         }
       });
   List<Anchor> links = super.getLinks();
   links.add(loginLink);
   return links;
 }
コード例 #24
0
ファイル: RheaViewer.java プロジェクト: reactome-pwp/rhea
  private void showReaction(Reaction r) {
    this.container.clear();

    Anchor anchor =
        new Anchor(
            r.getIdentifier(),
            "http://www.ebi.ac.uk/rhea/reaction.xhtml?id=" + r.getIdentifier(),
            "_blank");
    anchor.setTitle(r.getName());
    this.container.add(anchor);

    this.container.add(new RheaTable(r));
    fireEvent(new ReactionStructureLoadedEvent());
  }
コード例 #25
0
  public ImageAnchorLabel(String text, String imageUrl, TEXT_POSITION position) {

    contentPanel = new FlexTable();
    initWidget(contentPanel);
    contentPanel.setSize("100%", "25px");

    anchor = new Anchor(text);

    image = new Image(imageUrl);
    image.setSize("16px", "16px");

    setOrientation(position);
    anchor.getElement().getStyle().setPadding(3.0, Unit.PX);
    anchor.setStyleName("dashboard-locationPanel-normalText");
  }
コード例 #26
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("");
    }
  }
コード例 #27
0
 public AppointmentFormPage() {
   popupPanel = new PopupPanel(true);
   popupPanel.add(uiBinder.createAndBindUi(this));
   close.addClickHandler(closeHandler());
   cancel.addClickHandler(closeHandler());
   submit.addClickHandler(createSaveHandler());
 }
コード例 #28
0
ファイル: DeviceDiskViewImpl.java プロジェクト: sosilent/euca
  @Override
  public void showSearchResult(SearchResult result) {
    if (table == null) {
      table = new DeviceSearchResultTable(result.getDescs(), selection);
      table.setRangeChangeHandler(presenter);
      table.setClickHandler(presenter);
      table.load();
      resultPanel.add(table);
      final DeviceColumnPopupPanel panel =
          new DeviceColumnPopupPanel(
              new DeviceColumnPopupPanel.Presenter() {

                @Override
                public void onValueChange(int column, boolean value) {
                  if (table != null) {
                    table.setVisible(column, value);
                  }
                }
              });
      columnButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              panel.popup(columnButton);
            }
          });
      initColumnPanel(result.getDescs(), panel);
    }
    table.setData(result);
    if (table.getPageSize() != DevicePageSize.getPageSize()) {
      table.setPageSize(DevicePageSize.getPageSize());
      pageSizeList.setSelectedIndex(DevicePageSize.getPageSizeSelectedIndex());
    }
  }
コード例 #29
0
ファイル: DeviceUc.java プロジェクト: chittik2702/Gooru-Web
  public DeviceUc(SimplePanel wrapperPanel, HeaderUc headerUc) {
    initWidget(uiBinder.createAndBindUi(this));
    this.headerUc = headerUc;
    this.wrapperPanel = wrapperPanel;

    androidSectiondiv.getElement().setId("pnlAndroidSectiondiv");
    ipadSectiondiv.getElement().setId("pnlIpadSectiondiv");

    msglinkPanel.getElement().setId("pnlMsglinkPanel");
    msgPanel.getElement().setId("pnlMsgPanel");
    closeAndriodBtn.getElement().setId("imgCloseAndriodBtn");

    closeIpadBtn.getElement().setId("imgCloseIpadBtn");
    gooruPanel.getElement().setId("pnlGooruPanel");
    ednovoPanel.getElement().setId("pnlEdnovoPanel");
    appstorePanel.getElement().setId("pnlAppstorePanel");
    viewAnchor.getElement().setId("lnkViewAnchor");

    setUiText();

    if (isIpad && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(true);
      androidSectiondiv.setVisible(false);
      ipadSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    } else if (isAndriod && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(false);
      androidSectiondiv.setVisible(true);
      androidSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    }
  }
コード例 #30
0
ファイル: Agenda.java プロジェクト: kitnhiks/Agenda
 private void loadLogin() {
   // Assemble login panel.
   signInLink.setHref(loginInfo.getLoginUrl());
   loginPanel.add(loginLabel);
   loginPanel.add(signInLink);
   RootPanel.get("tasksList").add(loginPanel);
 }