예제 #1
0
  @Override
  protected Widget onExtendedInitialization() {
    Requirement requirement = getObject();

    requirementWidget =
        new RequirementWidget(requirement, false, false, true, false, false, false, false);
    taskList = new BlockListWidget<Task>(TaskInRequirementBlock.FACTORY);
    taskList.setAutoSorter(requirement.getTasksOrderComparator());
    if (requirement.getProject().isTeamMember(getCurrentUser())) {
      taskList.setDndSorting(true);
      taskList.setMoveObserver(new MoveObserver());
    }
    createTaskButton = new ButtonWidget(new CreateTaskAction(requirement));
    changeHistoryWidget = new ChangeHistoryWidget(requirement);

    FlowPanel left = new FlowPanel();
    left.add(requirementWidget);
    left.add(taskList);
    left.add(Gwt.createDiv("CreateTaskButtonWrapper", createTaskButton));
    left.add(changeHistoryWidget);

    right = new FlowPanel();
    if (requirement.isDecidable() && requirement.getProject().isProductOwner(getCurrentUser())) {
      right.add(RequirementWidget.createActionsPanelForCompletedRequirement(requirement));
      right.add(Gwt.createSpacer(1, 10));
    }
    right.add(ScrumGwt.createEmoticonsAndComments(requirement));

    bodyWidget = TableBuilder.row(20, left, right);
    return bodyWidget;
  }
예제 #2
0
  private void appendWord(Paragraph p, String word) {
    if (isUrl(word)) {
      p.add(new Link(word));
      return;
    }

    if (word.length() > 1 && isIgnorableWordPrefix(word.charAt(0))) {
      p.add(new Text(word.substring(0, 1)));
      word = word.substring(1);
    }

    StringBuilder suffix = null;
    for (int i = word.length() - 1; i >= 0; i--) {
      if (isIgnorableWordSuffix(word.charAt(i))) {
        if (suffix == null) suffix = new StringBuilder();
        suffix.insert(0, word.charAt(i));
      } else {
        break;
      }
    }
    if (suffix != null) word = word.substring(0, word.length() - suffix.length());

    if (ScrumGwt.isEntityReference(word)) {
      p.add(new EntityReference(word));
      if (suffix != null) p.add(new Text(suffix.toString()));
      return;
    }

    p.add(new Text(word));
    if (suffix != null) p.add(new Text(suffix.toString()));
  }
예제 #3
0
  private void showPageAndEntity(String page, String entityId) {
    new TouchLastActivityServiceCall().execute();
    ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class);

    if (historyToken.getPage() == null && page == null) page = HistoryToken.START_PAGE;

    if (page != null) workspace.showPage(page);

    if (entityId != null) {
      if (ScrumGwt.isEntityReferenceOrWikiPage(entityId)) {
        workspace.showEntityByReference(entityId);
      } else {
        if ("Forum".equals(historyToken.getPage())) {
          ForumSupport entity = (ForumSupport) AEntity.getById(entityId);
          workspace.showForum(entity);
        } else {
          workspace.showEntityById(entityId);
        }
      }
    }

    // if (search != null &&
    // !Page.getPageName(SearchResultsWidget.class).equals(historyToken.getPage()))
    // {
    // search.clear();
    // }
  }
예제 #4
0
 private Widget createStateInformation() {
   TableBuilder tb = ScrumGwt.createFieldTable();
   tb.addFieldRow(
       "activeServiceCallCount",
       new Label(String.valueOf(serviceCaller.getActiveServiceCallCount())));
   tb.addFieldRow(
       "conversationNumber", new Label(String.valueOf(serviceCaller.getConversationNumber())));
   tb.addFieldRow("entityIdBase", new Label(dao.getEntityIdBase()));
   tb.addFieldRow("entityIdCounter", new Label(String.valueOf(dao.getEntityIdCounter())));
   return tb.createTable();
 }
예제 #5
0
  public void showDate(Date dateToShow) {
    this.date = dateToShow;
    updateBeginAndEnd();

    lists.clear();
    selectionManager.clear();

    FlexTable table = new FlexTable();
    table.setWidth("100%");
    table.setCellPadding(2);
    table.getColumnFormatter().setWidth(0, "25px");
    table.getColumnFormatter().setWidth(1, "40px");
    table.getColumnFormatter().setWidth(2, "30px");
    table.getColumnFormatter().setWidth(3, "40px");

    // table.setBorderWidth(1);
    int row = 0;
    Date d = begin;
    int month = 0;
    int week = 0;
    while (d.compareTo(end) <= 0) {
      int w = d.getWeek();
      if (w != week) {
        week = w;
        Widget weekWidget = Gwt.createDiv("DayListWidget-week", String.valueOf(week));
        table.setWidget(row, 0, weekWidget);
      }
      int m = d.getMonth();
      if (m != month) {
        month = m;
        Widget monthWidget = Gwt.createDiv("DayListWidget-month", Gwt.getMonthShort(month));
        table.setWidget(row, 1, monthWidget);
      }
      table.setWidget(row, 2, Gwt.createDiv("DayListWidget-date", Gwt.formatDay(d.toJavaDate())));
      table.setWidget(
          row, 3, Gwt.createDiv("DayListWidget-date", Gwt.formatWeekdayShort(d.toJavaDate())));
      table.setWidget(row, 4, createDayContent(d));

      formatRow(table, row);
      d = d.nextDay();
      row++;
    }

    Widget downloadLink =
        ScrumGwt.createPdfLink(
            "Download as PDF", "calendar", "from", begin.toString(), "to", end.toString());
    wrapper.setWidget(Gwt.createFlowPanel(table, Gwt.createSpacer(1, 10), downloadLink));
  }
예제 #6
0
 @Override
 public String toHtml() {
   return ScrumGwt.toHtml(this, getLabel());
 }
예제 #7
0
 public String getEstimatedWorkWithUnit() {
   return ScrumGwt.getEstimationAsString(getEstimatedWork(), getProject().getEffortUnit());
 }
예제 #8
0
 public String getEstimatedWorkAsString() {
   return ScrumGwt.getEstimationAsString(getEstimatedWork());
 }
예제 #9
0
 @Override
 public boolean isThemesCreatable() {
   return ScrumGwt.isCurrentUserProductOwner();
 }