コード例 #1
0
 public void setInput(RegistrationRequestState requestState) {
   commentField.setValue("");
   contentP.removeAllComponents();
   this.requestState = requestState;
   List<AdminComment> comments = requestState.getAdminComments();
   for (AdminComment comment : comments) {
     StringBuilder sb = new StringBuilder();
     if (comment.isPublicComment()) sb.append(msg.getMessage("RequestCommentPanel.public"));
     else sb.append(msg.getMessage("RequestCommentPanel.internal"));
     sb.append(" ")
         .append(new SimpleDateFormat(Constants.SIMPLE_DATE_FORMAT).format(comment.getDate()));
     sb.append("\n\n").append(comment.getContents());
     Label commentL = new Label(sb.toString(), ContentMode.PREFORMATTED);
     commentL.addStyleName(Styles.messageBox.toString());
     contentP.addComponent(commentL);
   }
 }
コード例 #2
0
 private void process(String comment, boolean asPublic) {
   try {
     regMan.processRegistrationRequest(
         requestState.getRequestId(),
         null,
         RegistrationRequestAction.update,
         asPublic ? comment : null,
         asPublic ? null : comment);
     bus.fireEvent(new RegistrationRequestChangedEvent(requestState.getRequestId()));
   } catch (EngineException e) {
     NotificationPopup.showError(
         msg, msg.getMessage("RequestProcessingPanel.errorRequestProcess"), e);
   }
 }
コード例 #3
0
  private void initUI() {
    VerticalLayout main = new VerticalLayout();
    main.setSpacing(true);
    main.setMargin(true);

    contentP = new VerticalLayout();
    contentP.setSpacing(true);
    contentP.setHeight(80, Unit.PERCENTAGE);

    Button postPublic = new Button(msg.getMessage("RequestProcessingPanel.postPublic"));
    postPublic.setDescription(msg.getMessage("RequestProcessingPanel.postPublicTooltip"));
    postPublic.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            process(commentField.getValue(), true);
          }
        });
    Button postInternal = new Button(msg.getMessage("RequestProcessingPanel.postInternal"));
    postInternal.setDescription(msg.getMessage("RequestProcessingPanel.postInternalTooltip"));
    postInternal.addClickListener(
        new Button.ClickListener() {
          @Override
          public void buttonClick(ClickEvent event) {
            process(commentField.getValue(), false);
          }
        });

    commentField = new TextArea();
    commentField.setWidth(100, Unit.PERCENTAGE);

    HorizontalLayout buttons = new HorizontalLayout(postPublic, postInternal);
    buttons.setSpacing(true);

    main.addComponents(contentP, commentField, buttons);
    setCompositionRoot(main);
  }
 @Override
 public String getCaption() {
   return msg.getMessage("ConnectId.wizardCaption");
 }