Ejemplo n.º 1
0
  @Override
  public void setStories(List<StoryDto> stories, String searchTerm, boolean append) {
    if (!stories.isEmpty()) {
      initScroller();
    }

    if (!append) {
      clearStories();
    }

    if (stories.isEmpty()) {
      String text =
          searchTerm == null ? "No stories to load" : "No stories march your search terms";

      panelStories.add(
          new HTMLPanel(
              "<div class='col s10'>"
                  + "<div style=''>"
                  + "<h4><blockquote> "
                  + text
                  + " </blockquote></h4>"
                  + "</div>"
                  + "</div> "));
    }

    for (StoryDto dto : stories) {
      panelStories.add(new StoryItemView(dto));
    }
  }
Ejemplo n.º 2
0
 @Override
 public void setInSlot(Object slot, IsWidget content) {
   if (slot == DetailsPresenter.IMAGE) {
     img.clear();
     img.add(content);
   }
 }
  public TransferElementPanel() {

    mainPnl = new FlowPanel();
    nodeList = new ArrayList<String>();
    container = new FlowPanel();
    container.setStyleName("trnsfrElmt-containerPnl");

    closeBtn = new Button();
    closeBtn.setStyleName("endpt-list-pnl-close-btn");

    HTMLPanel hdr = new HTMLPanel("Transfer Element");
    hdr.setStyleName("trnsfrElmnt-list-hdr");
    hdr.add(closeBtn);

    trnsfrElmntOkBtn = new SwitchButton("OK");
    trnsfrElmntOkBtn.setStyleName("priLvl-btn");
    FlowPanel btnPnl = new FlowPanel();
    btnPnl.setStyleName("trnsfrElem-btnPnl");
    btnPnl.add(trnsfrElmntOkBtn);

    nodeContainer = new FlowPanel();
    nodeContainer.setStyleName("node-wdgt-cntr");
    container.add(hdr);
    container.add(nodeContainer);
    container.add(btnPnl);

    mainPnl.setStyleName("endpt-list-pnl");
    mainPnl.add(container);
    // mainPnl.add(btnPnl);

    hide();

    initWidget(mainPnl);
  }
Ejemplo n.º 4
0
  @Override
  protected IsWidget body(final ApplyContext context) {
    FlowPanel body = new FlowPanel();
    body.add(new HTML(TEMPLATES.errorPanel(Console.CONSTANTS.patch_manager_apply_error_body())));

    errorDetails =
        new ErrorDetails(
            Console.CONSTANTS.patch_manager_show_details(),
            Console.CONSTANTS.patch_manager_hide_details());
    body.add(errorDetails);

    body.add(
        new HTML(
            "<h3 class=\"patch-followup-header\">"
                + Console.CONSTANTS.patch_manager_possible_actions()
                + "</h3>"));
    HTMLPanel actions =
        new HTMLPanel(
            TEMPLATES.appliedFailed(
                Console.CONSTANTS.patch_manager_apply_error_cancel_title(),
                Console.CONSTANTS.patch_manager_apply_error_cancel_body(),
                Console.CONSTANTS.patch_manager_apply_error_select_title(),
                Console.CONSTANTS.patch_manager_apply_error_select_body()));
    selectPatch = new DefaultButton(Console.CONSTANTS.patch_manager_select_patch_title());
    selectPatch.getElement().setAttribute("style", "min-width:60px;");
    selectPatch.addStyleName("primary");
    actions.add(selectPatch, "select-different-patch");
    body.add(actions);

    return body;
  }
Ejemplo n.º 5
0
  public PersonSearchPanel() {
    rootElement = uiBinder.createAndBindUi(this);
    searchBox.setVisibleLength(40);
    searchBox.addKeyPressHandler(
        new EnterKeyHandler(
            new HandlerAction() {
              public void actionPerformed() {
                personServiceAsync.getPersons(
                    new AsyncCallback<List<Person>>() {
                      public void onFailure(Throwable caught) {
                        Window.alert("What? An error has occured. Message: " + caught.getMessage());
                        caught.printStackTrace();
                      }

                      public void onSuccess(List<Person> result) {
                        populatePersonResult(result);
                        resultPanel.setVisible(true);
                      }
                    });
              }
            }));
    resultPanel.setVisible(false);
    resultPanel.add(new Label("Search Result:"));
    searchResult = new Grid(0, 2);
    resultPanel.add(searchResult);
  }
  @Override
  public void setErrors(Set<ErrorDisplay> errors) {
    HashSet<ErrorDisplay> errorsToRemove = new HashSet<ErrorDisplay>(containedErrros);
    errorsToRemove.removeAll(errors);
    for (ErrorDisplay errorDisplay : errorsToRemove) {
      Widget widget = widgets.get(errorDisplay);
      errorsList.remove(widget);
      widgets.remove(widget);
    }

    HashSet<ErrorDisplay> errorsToAdd = new HashSet<ErrorView.ErrorDisplay>(errors);
    errorsToAdd.removeAll(containedErrros);
    String errorViewItemClass = ApplicationResources.INSTANCE.css().errorViewItemClass();
    String errorViewImageClass = ApplicationResources.INSTANCE.css().errorViewImageClass();
    for (ErrorDisplay errorDisplay : errorsToAdd) {
      SafeHtml html =
          template.errorDisplayTemplate(
              errorImageSafeUri, errorDisplay.getErrorInfo(), errorViewImageClass);
      HTML widget = new HTML(html);
      widget.setStyleName(errorViewItemClass);
      widgets.put(errorDisplay, widget);
      errorsList.add(widget);
    }
    containedErrros = new HashSet<ErrorView.ErrorDisplay>(errors);
    int height = 0;
    for (int i = 0; i < errorsList.getWidgetCount(); ++i) {
      Widget widget = errorsList.getWidget(i);
      widget.getElement().getStyle().setTop(height, Unit.PX);
      height += widget.getOffsetHeight() + 5;
    }
  }
Ejemplo n.º 7
0
  @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);
    }
  }
 /**
  * This method is used to display scored data
  *
  * @param scoredQuestionsData
  */
 void setScoredQuestionsData(ArrayList<UserDataDo> scoredQuestionsData) {
   teacherScoredData.clear();
   final SortTable sortableTable = new SortTable();
   sortableTable.setStyleName(res.css().tableMain());
   sortableTable.getElement().setId("results");
   sortableTable.setBorderWidth(1);
   sortableTable.setCellPadding(4);
   sortableTable.setCellSpacing(1);
   sortableTable.setWidth("800");
   sortableTable.addColumnHeader(i18n.GL3259(), 0);
   sortableTable.addColumnHeader(i18n.GL0308(), 1);
   sortableTable.addColumnHeader(i18n.GL3276(), 2);
   sortableTable.addColumnHeader(i18n.GL3277(), 3);
   sortableTable.addColumnHeader(i18n.GL2084(), 4);
   sortableTable.addColumnHeader(i18n.GL3261(), 5);
   sortableTable.getRowFormatter().addStyleName(0, res.css().tableHeader());
   teacherScoredData.add(sortableTable);
   if (scoredQuestionsData.size() != 0) {
     setSortedData(scoredQuestionsData, sortableTable, false);
   } else {
     Label erroeMsg = new Label();
     erroeMsg.setStyleName(res.css().displayMessageTextForScoredQuestions());
     erroeMsg.setText(i18n.GL3265());
     teacherScoredData.add(erroeMsg);
   }
 }
Ejemplo n.º 9
0
  private void initScroller() {
    String id = DOM.createUniqueId();
    HTMLPanel target = new HTMLPanel("");
    target.getElement().setId(id);
    panelLoadStories.add(target);

    initScroller(this, id);
  }
Ejemplo n.º 10
0
  @Override
  public void addAlert(Widget alertWidget) {
    alertsList.add(new InLineAlertWidget(resources, alertWidget));

    // Make the panel visible if it wasn't:
    if (!alertsPanel.isVisible()) {
      alertsPanel.setVisible(true);
    }
  }
 @Inject
 public InvoiceListView(final Binder binder) {
   widget = binder.createAndBindUi(this);
   SimplePager.Resources pagerResources = GWT.create(SimplePager.Resources.class);
   SimplePager pager = new SimplePager(TextLocation.CENTER, pagerResources, false, 0, true);
   pager.setDisplay(invoiceCellList);
   invoices.add(invoiceCellList);
   invoices.add(pager);
 }
Ejemplo n.º 12
0
 /** Class constructor */
 public CommunityView() {
   setWidget(uiBinder.createAndBindUi(this));
   libraryView = new LibraryView(PlaceTokens.DISCOVER);
   //		libraryView.getCourseTabs().setVisible(false);
   Window.scrollTo(0, 0);
   landingpagePanel.add(libraryView);
   landingpagePanel.getElement().setId("pnlPartnerPanel");
   // landingpagePanel.getElement().getStyle().setMarginTop(39, Unit.PX);
 }
Ejemplo n.º 13
0
  public void createTd(Widget widget, TextAlign align, String width) {
    HTMLPanel td = (HTMLPanel) getTd(widget);
    td.getElement().getStyle().setTextAlign(align);

    if (width != null) {
      td.setWidth(width);
    }
    row.add(td);
  }
Ejemplo n.º 14
0
 @UiHandler("explanaionButton")
 public void ClickOnExplanationButton(ClickEvent clickEvent) {
   if (explanaionButton.getStyleName().equals(oeStyle.hintsActiveButton())) {
     explanationContainer.add(getHTML(collectionItemDo.getResource().getExplanation()));
     explanationContainer.addStyleName(oeStyle.explanationTextBorder());
     explanaionButton.setStyleName(oeStyle.hintsInActiveButton());
     startExplanationDataLogEvent(collectionItemDo.getResource().getExplanation());
   }
 }
 /** This method is used to set default data. */
 void setData() {
   collectionSummaryText.setText(i18n.GL1587());
   collectionSummaryText.getElement().getStyle().setPaddingBottom(15, Unit.PX);
   collectionSummaryText.addStyleName("collectionSummaryText");
   printWidget.add(collectionSummaryText);
   teacherTabContainer =
       new AnalyticsTabContainer() {
         @Override
         public void onTabClick(String tabClicked) {
           if (SCORED.equalsIgnoreCase(tabClicked)) {
             hideAllPanels();
             teacherScoredDatapnl.setVisible(true);
           } else if (OPENENDED.equalsIgnoreCase(tabClicked)) {
             hideAllPanels();
             teacherOpenendedData.setVisible(true);
           } else if (BREAKDOWN.equalsIgnoreCase(tabClicked)) {
             hideAllPanels();
             teacherResourceBreakdownDatapnl.setVisible(true);
           } else if (PRINT.equalsIgnoreCase(tabClicked)) {
             Element printElement = collectionSummaryText.getElement();
             printElement.appendChild(collectionSummaryWidget.getElement());
             printElement.appendChild(scoredQuestionHeading.getElement());
             printElement.appendChild(scoredPrintWidget.getElement());
             printElement.appendChild(opendedQuestionHeading.getElement());
             printElement.appendChild(printOpendedData.getElement());
             printElement.appendChild(collectionOverViewWidget.getElement());
             printElement.appendChild(printResourceData.getElement());
             scoredPrintWidget.setVisible(true);
             Print.it(style, printElement);
             scoredPrintWidget.setVisible(false);
           } else {
             scoredPrintWidget.setVisible(true);
             Element printElement = collectionSummaryText.getElement();
             printElement.appendChild(collectionSummaryWidget.getElement());
             printElement.appendChild(scoredQuestionHeading.getElement());
             printElement.appendChild(scoredPrintWidget.getElement());
             printElement.appendChild(opendedQuestionHeading.getElement());
             printElement.appendChild(printOpendedData.getElement());
             printElement.appendChild(collectionOverViewWidget.getElement());
             printElement.appendChild(printResourceData.getElement());
             getUiHandlers()
                 .setHtmltopdf(
                     style.toString().replaceAll("'", "\\\\\"")
                         + printElement.getInnerHTML().toString().replaceAll("\"", "\\\\\""),
                     collectionMetaData.getTitle() != null ? collectionMetaData.getTitle() : "");
             scoredPrintWidget.setVisible(false);
           }
         }
       };
   teacherTabContainer.getEmailButton().setVisible(false);
   tabContainer.add(teacherTabContainer);
   filterDropDown.clear();
   filterDropDown.addItem("All", "All");
   filterDropDown.addItem("Questions", "Questions");
   filterDropDown.addItem("Resources", "Resources");
 }
 private void makeEditable(boolean editable) {
   if (editable) {
     editorPanel.setStylePrimaryName(style.editorPanelVisible());
     viewPanel.setStylePrimaryName(style.viewPanelHidden());
     clickToEdit.setText("Done");
   } else {
     editorPanel.setStylePrimaryName(style.editorPanelHidden());
     viewPanel.setStylePrimaryName(style.viewPanelVisible());
     clickToEdit.setText("Edit");
   }
 }
Ejemplo n.º 17
0
 @Override
 public void setInSlot(Object slot, IsWidget content) {
   if (slot == DataSourcePresenter.TABLE_SLOT) {
     tblRow.clear();
     if (content != null) {
       tblRow.add(content);
     }
   } else {
     super.setInSlot(slot, content);
   }
 }
Ejemplo n.º 18
0
 @UiHandler("closeAndriodBtn")
 public void onAndriodCloseClick(ClickEvent clickEvent) {
   ipadSectiondiv.setVisible(false);
   StringUtil.IPAD_MESSAGE_Close_Click = true;
   androidSectiondiv.setVisible(false);
   wrapperPanel.getElement().setAttribute("style", "margin-top:36px;");
   headerUc.getElement().getFirstChildElement().setAttribute("style", "position:fixed;");
   LibraryView.onClosingAndriodorIpaddiv();
   ShelfListView.onClosingAndriodorIpaddiv();
   ShelfView.onClosingAndriodorIpaddiv();
   DiscoverToolTip.onclickOfAndriodorIpadcloseDiv();
 }
Ejemplo n.º 19
0
  protected void addWidget(T wrapped, Widget widget) {
    if (HasWidgets.class.isInstance(wrapped)) {

      // hack for GWT 2.0.3
      if (wrapped instanceof HTMLPanel) {
        HTMLPanel htmlPanel = (HTMLPanel) wrapped;
        GwtReflectionUtils.callPrivateMethod(htmlPanel, "add", widget, htmlPanel.getElement());
      } else {
        ((HasWidgets) wrapped).add(widget);
      }
    }
  }
Ejemplo n.º 20
0
  @Override
  protected void onAttach() {
    super.onAttach();
    Element label = chkMineOnly.getElement().getElementsByTagName("label").getItem(0);
    label.getStyle().setTop(14, Unit.PX);

    canCreateStory = hasPermission(PermissionName.STORIES_CAN_CREATE_CONTENT.name());
    panelLoadStories.clear();
    if (!canCreateStory) {
      panelCreateStory.addStyleName("hide");
    }
  }
  @Override
  public void setInSlot(Object slot, Widget content) {

    if (content == null) filterPanel.clear();

    if (slot == InvoiceListPresenter.SLOT_filters) {
      filterPanel.clear();
      filterPanel.add(content);
    } else {
      super.setInSlot(slot, content);
    }
  }
Ejemplo n.º 22
0
  public void showCollectionAddImageWidget() {
    getAddToShelfCollectionButton().setText(i18n.GL0590());
    successMessageLabelText.setText(i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("alt", i18n.GL0547());
    successMessageLabelText.getElement().setAttribute("title", i18n.GL0547());
    addResourceInsteadLabelContainerInCollectionImage.clear();
    addResourceInsteadLabelContainerInCollectionImage.add(addResourceInsteadLabel);

    addResourceInsteadLabel.getElement().getStyle().clearMarginLeft();
    addResourceInsteadLabel.getElement().getStyle().clearMarginTop();
    collectionAddImageContainer.setVisible(true);
    collectionAddedSuccessMessageContainer.setVisible(false);
  }
Ejemplo n.º 23
0
 public FolderInfoWidget() {
   initWidget(uiBinder.createAndBindUi(this));
   folderInfo.getElement().setId("pnlCollectionInfo");
   folderInfo.getElement().getStyle().setHeight(Window.getClientHeight(), Unit.PX);
   titleDetailsPnl.getElement().setAttribute("style", "border-bottom: 0px solid #ddd;");
   Window.addResizeHandler(
       new ResizeHandler() {
         @Override
         public void onResize(ResizeEvent event) {
           folderInfo.getElement().getStyle().setHeight(Window.getClientHeight(), Unit.PX);
         }
       });
 }
Ejemplo 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");
 }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final com.google.gwt.requestfactory.ui.client.LoginWidget owner) {

    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle)
                GWT.create(
                    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenBundle.class);
    com.google.gwt.requestfactory.ui.client.LoginWidget_BinderImpl_GenCss_style style =
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    com.google.gwt.dom.client.SpanElement name = null;
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
    java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.user.client.ui.InlineLabel logoutLink =
        (com.google.gwt.user.client.ui.InlineLabel)
            GWT.create(com.google.gwt.user.client.ui.InlineLabel.class);
    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel1 =
        new com.google.gwt.user.client.ui.HTMLPanel(
            "<div> <span id='"
                + domId0
                + "'>Not logged in</span> | <span id='"
                + domId1
                + "'></span> </div>");

    logoutLink.setText("Sign out");
    logoutLink.addStyleName("" + style.link() + "");

    UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(f_HTMLPanel1.getElement());
    name = com.google.gwt.dom.client.Document.get().getElementById(domId0).cast();
    name.removeAttribute("id");
    com.google.gwt.user.client.Element domId1Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId1).cast();
    attachRecord0.detach();
    f_HTMLPanel1.addAndReplaceElement(logoutLink, domId1Element);

    final com.google.gwt.event.dom.client.ClickHandler
        handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1 =
            new com.google.gwt.event.dom.client.ClickHandler() {
              public void onClick(com.google.gwt.event.dom.client.ClickEvent event) {
                owner.handleClick(event);
              }
            };
    logoutLink.addClickHandler(handlerMethodWithNameVeryUnlikelyToCollideWithUserFieldNames1);

    owner.name = name;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return f_HTMLPanel1;
  }
Ejemplo n.º 26
0
  public UserPortalMainTab(TabData tabData, AbstractTabPanel tabPanel) {
    super(tabData, tabPanel);

    root = new HTMLPanel("li", ""); // $NON-NLS-1$ //$NON-NLS-2$
    hyperlink = new Anchor();
    hyperlink
        .getElement()
        .getStyle()
        .setProperty(
            "fontFamily",
            "'Open Sans', Helvetica, Arial, sans-serif !important"); //$NON-NLS-1$ //$NON-NLS-2$
    root.add(hyperlink);
    root.setVisible(true);
    accessible = true;
  }
Ejemplo n.º 27
0
 @Override
 public void show(Detail detail) {
   ImageResource res = detail.imageResource();
   if (res.getWidth() > IMG_MAX_WIDTH || res.getHeight() > IMG_MAX_HEIGHT) {
     setInSlot(
         DetailsPresenter.IMAGE,
         new FitImage(res.getSafeUri().asString(), IMG_MAX_WIDTH, IMG_MAX_HEIGHT));
   } else {
     setInSlot(DetailsPresenter.IMAGE, new Image(res));
   }
   main.clear();
   main.add(detail.main());
   side.clear();
   side.add(detail.side());
   title.setText(detail.title());
 }
Ejemplo n.º 28
0
 @Override
 public void enableUserOptions(CurrentUser currentUser) {
   userOptions.setVisible(true);
   menuBar.setVisible(true);
   UserDto userDto = currentUser.getUser();
   name.setText(userDto.getFirstName());
 }
  /**
   * @function setLabelsAndIds
   * @created_date : Jan 2, 2014
   * @description To set Labels and Id for buttons.
   * @parm(s) :
   * @return : void
   * @throws : <Mentioned if any exceptions>
   */
  private void setLabelsAndIds() {
    btnResourceLink.setText(i18n.GL0548());
    btnResourceLink.getElement().setId("btnResourceLink");
    btnResourceLink.getElement().setAttribute("alt", i18n.GL0548());
    btnResourceLink.getElement().setAttribute("title", i18n.GL0548());

    lblGooruFieldTrip.setText(i18n.GL0549());
    lblGooruFieldTrip.getElement().setId("lblGooruFieldTrip");
    lblGooruFieldTrip.getElement().setAttribute("alt", i18n.GL0549());
    lblGooruFieldTrip.getElement().setAttribute("title", i18n.GL0549());

    // lblGooruFieldTripDescUnforseen.setText(i18n.GL0550);
    // lblGooruFieldTripDescOriginal.setText(i18n.GL0552);
    lblGooruFieldTripDescOriginal.setText("");
    lblGooruFieldTripDescOriginal.getElement().setId("lblGooruFieldTripDescOriginal");
    lblGooruFieldTripDescOriginal.getElement().setAttribute("alt", "");
    lblGooruFieldTripDescOriginal.getElement().setAttribute("title", "");

    lblDontForget.setText(i18n.GL0551());
    lblDontForget.getElement().setId("lblDontForget");
    lblDontForget.getElement().setAttribute("alt", i18n.GL0551());
    lblDontForget.getElement().setAttribute("title", i18n.GL0551());

    imgFieldTrip.getElement().setId("imgFieldTrip");
    imgFieldTrip.setUrl("images/framebraker/field-trip.png");

    resoruceFrameBrakerContainer.getElement().setId("fpnlResoruceFrameBrakerContainer");
    resourceCategory.getElement().setId("pnlResourceCategory");
    lblGooruFieldTripDescUnforseen.getElement().setId("lblGooruFieldTripDescUnforseen");
    supportTip.getElement().setId("lblSupportTip");
    //		learnMoreLbl.setText("Learn more.");
  }
Ejemplo n.º 30
0
 @Override
 public void showButtons(boolean displayButtons) {
   buttons.setVisible(displayButtons);
   for (ToggleEditor editor : editors) {
     editor.showCopySourceButton(displayButtons);
   }
 }