Examples of FieldsetPanel


Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  {
    super.init();
    gridBuilder.newSplitPanel(GridSize.COL66);
    {
      // Group
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("group")).suppressLabelForWarning();
      groupSelectPanel = new NewGroupSelectPanel(fs.newChildId(), new Model<GroupDO>() {
        @Override
        public GroupDO getObject()
        {
          return userGroupCache.getGroup(getSearchFilter().getGroupId());
        }

        @Override
        public void setObject(final GroupDO object)
        {
          if (object == null) {
            getSearchFilter().setGroupId(null);
          } else {
            getSearchFilter().setGroupId(object.getId());
          }
        }
      }, parentPage, "groupId");
      fs.add(groupSelectPanel);
      groupSelectPanel.setDefaultFormProcessing(false);
      groupSelectPanel.init();
    }
    gridBuilder.newSplitPanel(GridSize.COL33);
    {
      // User
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("user")).suppressLabelForWarning();
      final UserSelectPanel assigneeSelectPanel = new UserSelectPanel(fs.newChildId(), new Model<PFUserDO>() {
        @Override
        public PFUserDO getObject()
        {
          return userGroupCache.getUser(getSearchFilter().getUserId());
        }

        @Override
        public void setObject(final PFUserDO object)
        {
          if (object == null) {
            getSearchFilter().setUserId(null);
          } else {
            getSearchFilter().setUserId(object.getId());
          }
        }
      }, parentPage, "userId");
      fs.add(assigneeSelectPanel);
      assigneeSelectPanel.setDefaultFormProcessing(false);
      assigneeSelectPanel.init().withAutoSubmit(true);
      fs.addHelpIcon(getString("access.tooltip.filter.user"));
    }
    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task")).suppressLabelForWarning();
      final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new Model<TaskDO>() {
        @Override
        public TaskDO getObject()
        {
          return taskTree.getTaskById(getSearchFilter().getTaskId());
        }

        @Override
        public void setObject(final TaskDO task)
        {
          if (task != null) {
            getSearchFilter().setTaskId(task.getId());
          } else {
            getSearchFilter().setTaskId(null);
          }
        }
      }, parentPage, "taskId");
      fs.add(taskSelectPanel);
      taskSelectPanel.init();
      taskSelectPanel.setRequired(false);
    }
  }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  {
    super.init();
    gridBuilder.newGridPanel();
    {
      // Parameter name
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("administration.configuration.parameter")).suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), getString(data.getI18nKey())));
    }
    FormComponent< ? > valueField = null;
    {
      // Parameter value
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("administration.configuration.value"));
      if (data.getConfigurationType() == ConfigurationType.INTEGER) {
        final TextField<Integer> textField = new TextField<Integer>(InputPanel.WICKET_ID, new PropertyModel<Integer>(data, "intValue"));
        fs.add(textField);
        valueField = textField;
      } else if (data.getConfigurationType() == ConfigurationType.PERCENT) {
        final MinMaxNumberField<BigDecimal> numberField = new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID,
            new PropertyModel<BigDecimal>(data, "floatValue"), BigDecimal.ZERO, NumberHelper.HUNDRED) {
          /**
           * @see org.projectforge.web.wicket.components.MinMaxNumberField#getConverter(java.lang.Class)
           */
          @SuppressWarnings({ "rawtypes", "unchecked"})
          @Override
          public IConverter getConverter(final Class type)
          {
            return new BigDecimalPercentConverter(true);
          };
        };
        fs.add(numberField);
        valueField = numberField;
      } else if (data.getConfigurationType() == ConfigurationType.STRING) {
        final MaxLengthTextField textField = new MaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "stringValue"));
        if (ConfigurationParam.CALENDAR_DOMAIN.getI18nKey().equals(data.getI18nKey()) == true) {
          textField.setRequired(true);
          textField.add(new IValidator<String>() {
            @Override
            public void validate(final IValidatable<String> validatable)
            {
              if (Configuration.isDomainValid(validatable.getValue()) == false) {
                textField.error(getString("validation.error.generic"));
              }
            }
          });
        }
        fs.add(textField);
        valueField = textField;
      } else if (data.getConfigurationType() == ConfigurationType.TEXT) {
        final MaxLengthTextArea textArea = new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "stringValue"));
        fs.add(textArea);
        valueField = textArea;
      } else if (data.getConfigurationType() == ConfigurationType.BOOLEAN) {
        fs.addCheckBox(new PropertyModel<Boolean>(data, "booleanValue"), null);
      } else if (data.getConfigurationType() == ConfigurationType.TIME_ZONE) {
        final TimeZonePanel timeZonePanel = new TimeZonePanel(fs.newChildId(), new PropertyModel<TimeZone>(data, "timeZone"));
        fs.add(timeZonePanel);
        valueField = timeZonePanel.getTextField();
      } else if (data.getConfigurationType() == ConfigurationType.TASK) {
        if (data.getTaskId() != null) {
          this.task = taskDao.getById(data.getTaskId());
        }
        final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(this, "task"), parentPage, "taskId");
        fs.add(taskSelectPanel);
        taskSelectPanel.init();
      } else {
        throw new UnsupportedOperationException("Parameter of type '" + data.getConfigurationType() + "' not supported.");
      }
      if (valueField != null) {
        WicketUtils.setFocus(valueField);
      }
    }
    {
      // Description
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("description")).suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), getString("administration.configuration.param." + data.getParameter() + ".description")));
    }
  }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

      }
    });
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // User
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("user"));
      Hibernate.initialize(data.getUser());
      final UserSelectPanel userSelectPanel = new UserSelectPanel(fs.newChildId(), new PropertyModel<PFUserDO>(data, "user"), parentPage,
          "userId");
      fs.add(dependentFormComponents[0] = userSelectPanel);
      userSelectPanel.setRequired(true);
      userSelectPanel.init();
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // Start Date
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("timesheet.startTime"));
      final DatePanel weekDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "week"), DateTimePanelSettings.get()
          .withSelectStartStopTime(false).withTargetType(java.sql.Date.class));
      weekDatePanel.setRequired(true);
      weekDatePanel.add(new AbstractValidator<Date>() {
        /**
         * @see org.apache.wicket.validation.validator.AbstractValidator#onValidate(org.apache.wicket.validation.IValidatable)
         */
        @Override
        protected void onValidate(final IValidatable<Date> validatable)
        {
          final Date date = validatable.getValue();
          if (date != null) {
            final DayHolder dh = new DayHolder(date);
            dh.setBeginOfWeek();
            data.setWeek(dh.getSQLDate());
          }
          weekDatePanel.markModelAsChanged();
        }
      });
      // weekDatePanel.getDateField().add(new AjaxFormComponentUpdatingBehavior("onblur") {
      // @Override
      // protected void onUpdate(final AjaxRequestTarget target)
      // {
      // // Doesn't work with DatePicker (because DatePicker updates the value after onblur event.
      // }
      // });
      fs.add(dependentFormComponents[1] = weekDatePanel);
      fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("calendarWeek")) {
        @Override
        public final void onSubmit()
        {
        }
      }.setDefaultFormProcessing(false), new Model<String>() {
        @Override
        public String getObject()
        {
          if (data.getWeek() != null) {
            return getString("calendar.weekOfYearShortLabel") + " " + DateTimeFormatter.formatWeekOfYear(data.getWeek());
          } else {
            return getString("calendar.weekOfYearShortLabel");
          }
        }

      }, SingleButtonPanel.NORMAL).setTooltip(getString("recalculate")));
      final DivPanel checkBoxDiv = new DivPanel(fs.newChildId(), DivType.BTN_GROUP) {
        /**
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible()
        {
          return data.hasDeletedEntries();
        }
      };
      fs.add(checkBoxDiv);
      checkBoxDiv.add(new CheckBoxButton(checkBoxDiv.newChildId(), new PropertyModel<Boolean>(this, "showDeletedOnly"),
          getString("onlyDeleted")) {
        /**
         * @see org.projectforge.web.wicket.flowlayout.CheckBoxButton#onSelectionChanged(java.lang.Boolean)
         */
        @Override
        protected void onSelectionChanged(final Boolean newSelection)
        {
          super.onSelectionChanged(newSelection);
          refresh();
        }

        @Override
        protected boolean wantOnSelectionChangedNotifications()
        {
          return true;
        }
      });
      if (isNew() == true) {
        fs.add(new SingleButtonPanel(fs.newChildId(), new Button(SingleButtonPanel.WICKET_ID, new Model<String>("predecessor")) {
          @Override
          public final void onSubmit()
          {
            if (getPredecessor() != null && predecessor.getEntries() != null) {
              final Iterator<HRPlanningEntryDO> it = getData().getEntries().iterator();
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

      final DivPanel content = new DivPanel(ToggleContainerPanel.CONTENT_ID);
      positionsPanel.add(content);
      final GridBuilder posGridBuilder = new GridBuilder(content, content.newChildId());
      {
        // DropDownChoice status / project
        final FieldsetPanel fs = posGridBuilder.newFieldset(WicketUtils.createMultipleFieldsetLabel(getString("status"),
            getString("fibu.projekt")));
        final LabelValueChoiceRenderer<HRPlanningEntryStatus> statusChoiceRenderer = new LabelValueChoiceRenderer<HRPlanningEntryStatus>(
            fs, HRPlanningEntryStatus.values());
        final DropDownChoice<HRPlanningEntryStatus> statusChoice = new DropDownChoice<HRPlanningEntryStatus>(fs.getDropDownChoiceId(),
            new PropertyModel<HRPlanningEntryStatus>(entry, "status"), statusChoiceRenderer.getValues(), statusChoiceRenderer);
        statusChoice.setNullValid(true).setRequired(false).setEnabled(!entry.isDeleted());
        fs.add(statusChoice);
        dependentEntryFormComponents.add(statusChoice);
        final NewProjektSelectPanel projektSelectPanel = new NewProjektSelectPanel(fs.newChildId(),
            new PropertyModel<ProjektDO>(entry, "projekt"), parentPage, "projektId:" + idx);
        projektSelectPanel.setRequired(false).setEnabled(!entry.isDeleted());
        fs.add(projektSelectPanel);
        projektSelectPanel.init();
        dependentEntryFormComponents.add(projektSelectPanel);
        projektSelectPanels.add(projektSelectPanel);

        final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("deleteUndelete")) {
          @Override
          public final void onSubmit()
          {
            if (entry.isDeleted() == true) {
              // Undelete
              entry.setDeleted(false);
            } else {
              getData().deleteEntry(entry);
            }
            refresh();
          }
        };
        final String buttonLabel, classNames;
        if (entry.isDeleted() == true) {
          buttonLabel = getString("undelete");
          classNames = SingleButtonPanel.NORMAL;
        } else {
          buttonLabel = getString("delete");
          classNames = SingleButtonPanel.DELETE;
          if (entry.getId() != null) {
            button.add(AttributeModifier.prepend("onclick", "if (showDeleteQuestionDialog() == false) return false;"));
          }
        }
        button.setDefaultFormProcessing(false);
        fs.add(new SingleButtonPanel(fs.newChildId(), button, buttonLabel, classNames) {

        });
      }
      posGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // DropDownChoice Priority
        final FieldsetPanel fs = posGridBuilder.newFieldset(getString("hr.planning.priority"));
        final LabelValueChoiceRenderer<Priority> priorityChoiceRenderer = new LabelValueChoiceRenderer<Priority>(fs, Priority.values());
        final DropDownChoice<Priority> priorityChoice = new DropDownChoice<Priority>(fs.getDropDownChoiceId(), new PropertyModel<Priority>(
            entry, "priority"), priorityChoiceRenderer.getValues(), priorityChoiceRenderer);
        priorityChoice.setNullValid(true).setEnabled(!entry.isDeleted());
        fs.add(priorityChoice);
      }
      posGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // DropDownChoice probability
        final FieldsetPanel fs = posGridBuilder.newFieldset(getString("hr.planning.probability"));
        final LabelValueChoiceRenderer<Integer> probabilityChoiceRenderer = new LabelValueChoiceRenderer<Integer>();
        probabilityChoiceRenderer.addValue(25, "25%");
        probabilityChoiceRenderer.addValue(50, "50%");
        probabilityChoiceRenderer.addValue(75, "75%");
        probabilityChoiceRenderer.addValue(95, "95%");
        probabilityChoiceRenderer.addValue(100, "100%");
        final DropDownChoice<Integer> probabilityChoice = new DropDownChoice<Integer>(fs.getDropDownChoiceId(), new PropertyModel<Integer>(
            entry, "probability"), probabilityChoiceRenderer.getValues(), probabilityChoiceRenderer);
        probabilityChoice.setNullValid(true).setEnabled(!entry.isDeleted());
        fs.add(probabilityChoice);
      }
      posGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // Hours
        final FieldsetPanel fs = posGridBuilder.newFieldset(getString("hours")).suppressLabelForWarning();
        final HRPlanningEditTablePanel table = new HRPlanningEditTablePanel(fs.newChildId());
        fs.add(table);
        table.init(entry);
      }
      posGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // Description
        final FieldsetPanel fs = posGridBuilder.newFieldset(getString("hr.planning.description"));
        final IModel<String> model = new PropertyModel<String>(entry, "description");
        final MaxLengthTextArea description = new MaxLengthTextArea(TextAreaPanel.WICKET_ID, model);
        if (entry.isDeleted() == true) {
          description.setEnabled(false);
        }
        fs.add(description);
        fs.add(new JiraIssuesPanel(fs.newChildId(), entry.getDescription()));
        fs.addJIRAField(model);
      }
    }
  }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  @SuppressWarnings("serial")
  protected void init()
  {
    add(new FeedbackPanel("feedback").setOutputMarkupId(true));
    {
      final FieldsetPanel fs = new FieldsetPanel("username", getString("username"));
      add(fs);
      final RequiredTextField<String> username = new RequiredTextField<String>(fs.getTextFieldId(), new PropertyModel<String>(this,
          "username"));
      username.setRequired(true).setMarkupId("username").setOutputMarkupId(true);
      fs.add(username);
      WicketUtils.setFocus(username);
    }
    {
      final FieldsetPanel fs = new FieldsetPanel("password", getString("password"));
      add(fs);
      final PasswordTextField password = new PasswordTextField(fs.getTextFieldId(), new PropertyModel<String>(this, "password"));
      password.setResetPassword(true).setRequired(true);
      fs.add(password);
    }
    {
      final FieldsetPanel fs = new FieldsetPanel("stayLoggedIn", "").suppressLabelForWarning();
      add(fs);
      final CheckBoxPanel stayLoggedInCheckBox = fs.addCheckBox(new PropertyModel<Boolean>(this, "stayLoggedIn"), null);
      final DivPanel divPanel = new DivPanel(fs.newChildId());
      fs.add(divPanel);
      final LabelPanel labelPanel = new LabelPanel(divPanel.newChildId(), getString("login.stayLoggedIn"));
      labelPanel.setLabelFor(stayLoggedInCheckBox.getCheckBox().getMarkupId());
      divPanel.add(labelPanel);
      WicketUtils.addTooltip(labelPanel.getLabel(), getString("login.stayLoggedIn"), getString("login.stayLoggedIn.tooltip"));
      stayLoggedInCheckBox.setTooltip(getString("login.stayLoggedIn"), getString("login.stayLoggedIn.tooltip"));
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

      }
      if (fc.isValid() == true) {
        return;
      }
    } else if (component.getParent() != null && component.getParent() instanceof FieldsetPanel) {
      final FieldsetPanel fs = (FieldsetPanel) component.getParent();
      if (fs.isValid() == true) {
        return;
      }
    } else {
      return;
    }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  @SuppressWarnings("serial")
  protected void init()
  {
    super.init();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("searchFilter"));
      final TextField<String> searchField = new TextField<String>(fs.getTextFieldId(), new PropertyModel<String>(filter, "searchString"));
      WicketUtils.setFocus(searchField);
      fs.add(searchField);
      final Model<String> modifiedSearchExpressionModel = new Model<String>() {
        @Override
        public String getObject()
        {
          return AbstractListForm.getModifiedSearchExpressionLabel(SearchForm.this, filter.getSearchString());
        }
      };
      final DivPanel div = new DivPanel(fs.newChildId());
      div.add(AttributeModifier.append("class", "modifiedSearchExpressionLabel"));
      fs.add(div);
      modifiedSearchExpressionLabel = new Label(div.newChildId(), modifiedSearchExpressionModel) {
        @Override
        public boolean isVisible()
        {
          return StringUtils.isNotBlank(filter.getSearchString()) == true;
        }
      };
      modifiedSearchExpressionLabel.setEscapeModelStrings(false);
      div.add(modifiedSearchExpressionLabel);
    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.options")).suppressLabelForWarning();
      final DivPanel checkBoxButton = fs.addNewCheckBoxButtonDiv();
      checkBoxButton.add(new CheckBoxButton(checkBoxButton.newChildId(), new PropertyModel<Boolean>(filter, "searchHistory"),
          getString("search.searchHistory")).setTooltip(getString("search.searchHistory.additional.tooltip")));
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("search.area"));
      // DropDownChoice: area
      final LabelValueChoiceRenderer<String> areaChoiceRenderer = new LabelValueChoiceRenderer<String>();
      for (final RegistryEntry entry : Registry.instance().getOrderedList()) {
        if (isSearchable(entry) == true) {
          areaChoiceRenderer.addValue(entry.getId(), getString(entry.getI18nTitleHeading()));
        }
      }
      areaChoiceRenderer.sortLabels();
      areaChoiceRenderer.addValue(0, SearchPageFilter.ALL, getString("filter.all"));
      final DropDownChoice<String> areaChoice = new DropDownChoice<String>(fs.getDropDownChoiceId(), new PropertyModel<String>(filter,
          "area"), areaChoiceRenderer.getValues(), areaChoiceRenderer);
      areaChoice.setRequired(false);
      fs.add(areaChoice);
    }
    {
      // DropDownChoice pageSize
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.pageSize"));
      final DropDownChoice<Integer> pageSizeChoice = AbstractListForm.getPageSizeDropDownChoice(fs.getDropDownChoiceId(), getLocale(),
          new PropertyModel<Integer>(filter, "maxRows"), MIN_PAGE_SIZE, MAX_PAGE_SIZE);
      fs.add(pageSizeChoice);
    }

    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("search.periodOfModification"));
      final DatePanel modifiedStartDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(filter, "startTimeOfModification"),
          DatePanelSettings.get().withSelectPeriodMode(true));
      fs.add(modifiedStartDatePanel);
      fs.add(new DivTextPanel(fs.newChildId(), " - "));
      final DatePanel modifiedStopDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(filter, "stopTimeOfModification"),
          DatePanelSettings.get().withSelectPeriodMode(true));
      fs.add(modifiedStopDatePanel);
      fs.add(new HtmlCommentPanel(fs.newChildId(), new Model<String>() {
        @Override
        public String getObject()
        {
          return WicketUtils.getUTCDates(filter.getStartTimeOfModification(), filter.getStopTimeOfModification());
        }
      }));
      // DropDownChoice: time period
      final LabelValueChoiceRenderer<Integer> lastDaysChoiceRenderer = new LabelValueChoiceRenderer<Integer>();
      lastDaysChoiceRenderer.addValue(MAGIC_NUMBER_LAST_DAYS_FOR_WITHOUT_TIME_SETTINGS, getString("search.withoutTimePeriod"));
      lastDaysChoiceRenderer.addValue(0, getString("search.today"));
      lastDaysChoiceRenderer.addValue(1, getString("search.lastDay"));
      for (final int days : new int[] { 3, 7, 14, 30, 60, 90}) {
        lastDaysChoiceRenderer.addValue(days, getLocalizedMessage("search.lastDays", days));
      }
      final DropDownChoice<Integer> lastDaysChoice = new DropDownChoice<Integer>(fs.getDropDownChoiceId(), new PropertyModel<Integer>(
          filter, "lastDays"), lastDaysChoiceRenderer.getValues(), lastDaysChoiceRenderer) {
        @Override
        protected void onSelectionChanged(final Integer newSelection)
        {
          if (newSelection == null) {
            return;
          }
          if (newSelection == MAGIC_NUMBER_LAST_DAYS_FOR_WITHOUT_TIME_SETTINGS) { // Magic number for
            filter.setStartTimeOfModification(null);
            filter.setStopTimeOfModification(null);
            modifiedStartDatePanel.markModelAsChanged();
            modifiedStopDatePanel.markModelAsChanged();
            filter.setLastDays(null);
            return;
          }
          final DateHolder dh = new DateHolder(new Date(), DatePrecision.MILLISECOND);
          dh.setEndOfDay();
          filter.setStopTimeOfModification(dh.getDate());
          dh.setBeginOfDay();
          dh.add(Calendar.DAY_OF_YEAR, -newSelection);
          filter.setStartTimeOfModification(dh.getDate());
          filter.setLastDays(null);
          modifiedStartDatePanel.markModelAsChanged();
          modifiedStopDatePanel.markModelAsChanged();
        }

        @Override
        protected boolean wantOnSelectionChangedNotifications()
        {
          return true;
        }
      };
      lastDaysChoice.setNullValid(true);
      lastDaysChoice.setRequired(false);
      fs.add(lastDaysChoice);
    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("modifiedBy"));
      final UserSelectPanel userSelectPanel = new UserSelectPanel(fs.newChildId(), new PropertyModel<PFUserDO>(filter, "modifiedByUser"),
          parentPage, "userId");
      fs.add(userSelectPanel);
      userSelectPanel.init().withAutoSubmit(true);
    }
    {
      final Button resetButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("reset")) {
        @Override
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  @Override
  public void component(final Component component, final IVisit<Void> visit)
  {
    if (component instanceof FieldsetPanel == true) {
      final FieldsetPanel fsPanel = (FieldsetPanel) component;
      if (fsPanel.isValid() == false) {
        if (visited.contains(component) == false) {
          visited.add(component);
          //fsPanel.getFieldset().add(new ValidationMsgBehavior());
          fsPanel.getFieldset().add(new ErrorHighlightBehavior());
        }
      }
      visit.dontGoDeeper();
      return;
    }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

      }
    });
    gridBuilder.newGridPanel();
    {
      // Parent task
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task.parentTask"));
      final TaskSelectPanel parentTaskSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "parentTask"), parentPage,
          "parentTaskId");
      fs.add(parentTaskSelectPanel);
      fs.getFieldset().setOutputMarkupId(true);
      parentTaskSelectPanel.init();
      if (taskTree.isRootNode(data) == false) {
        parentTaskSelectPanel.setRequired(true);
      } else {
        fs.setVisible(false);
      }
      parentTaskSelectPanel.setRequired(true);
    }
    {
      // Title
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task.title"));
      final MaxLengthTextField title = new RequiredMaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "title"));
      WicketUtils.setStrong(title);
      fs.add(title);
      if (isNew() == true) {
        WicketUtils.setFocus(title);
      }
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // Status drop down box:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("status"));
      final LabelValueChoiceRenderer<TaskStatus> statusChoiceRenderer = new LabelValueChoiceRenderer<TaskStatus>(fs, TaskStatus.values());
      final DropDownChoice<TaskStatus> statusChoice = new DropDownChoice<TaskStatus>(fs.getDropDownChoiceId(),
          new PropertyModel<TaskStatus>(data, "status"), statusChoiceRenderer.getValues(), statusChoiceRenderer);
      statusChoice.setNullValid(false).setRequired(true);
      fs.add(statusChoice);
    }
    {
      // Assigned user:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task.assignedUser"));
      PFUserDO responsibleUser = data.getResponsibleUser();
      if (Hibernate.isInitialized(responsibleUser) == false) {
        responsibleUser = userGroupCache.getUser(responsibleUser.getId());
        data.setResponsibleUser(responsibleUser);
      }
      final UserSelectPanel responsibleUserSelectPanel = new UserSelectPanel(fs.newChildId(), new PropertyModel<PFUserDO>(data,
          "responsibleUser"), parentPage, "responsibleUserId");
      fs.add(responsibleUserSelectPanel);
      responsibleUserSelectPanel.init();
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // Priority drop down box:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("priority"));
      final LabelValueChoiceRenderer<Priority> priorityChoiceRenderer = new LabelValueChoiceRenderer<Priority>(fs, Priority.values());
      final DropDownChoice<Priority> priorityChoice = new DropDownChoice<Priority>(fs.getDropDownChoiceId(), new PropertyModel<Priority>(
          data, "priority"), priorityChoiceRenderer.getValues(), priorityChoiceRenderer);
      priorityChoice.setNullValid(true);
      fs.add(priorityChoice);
    }
    {
      // Max hours:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task.maxHours"));
      final MinMaxNumberField<Integer> maxNumberField = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID, new PropertyModel<Integer>(
          data, "maxHours"), 0, 9999);
      WicketUtils.setSize(maxNumberField, 6);
      fs.add(maxNumberField);
      if (isNew() == false && taskTree.hasOrderPositions(data.getId(), true) == true) {
        WicketUtils.setWarningTooltip(maxNumberField);
        WicketUtils.addTooltip(maxNumberField, getString("task.edit.maxHoursIngoredDueToAssignedOrders"));
      }
    }
    gridBuilder.newGridPanel();
    {
      // Short description:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("shortDescription"));
      final IModel<String> model = new PropertyModel<String>(data, "shortDescription");
      fs.add(new MaxLengthTextField(InputPanel.WICKET_ID, model));
      fs.addJIRAField(model);
    }
    {
      // Reference
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task.reference"));
      fs.add(new MaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "reference")));
    }

    // ///////////////////////////////
    // GANTT
    // ///////////////////////////////
    gridBuilder.newGridPanel();
    {
      final ToggleContainerPanel extendedSettingsPanel = new ToggleContainerPanel(gridBuilder.getPanel().newChildId()) {
        /**
         * @see org.projectforge.web.wicket.flowlayout.ToggleContainerPanel#wantsOnStatusChangedNotification()
         */
        @Override
        protected boolean wantsOnStatusChangedNotification()
        {
          return true;
        }
      };
      extendedSettingsPanel.setHeading(getString("task.gantt.settings"));
      gridBuilder.getPanel().add(extendedSettingsPanel);
      extendedSettingsPanel.setClosed();
      final GridBuilder innerGridBuilder = extendedSettingsPanel.createGridBuilder();
      innerGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // Gantt object type:
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.objectType"));
        final LabelValueChoiceRenderer<GanttObjectType> objectTypeChoiceRenderer = new LabelValueChoiceRenderer<GanttObjectType>(fs,
            GanttObjectType.values());
        final DropDownChoice<GanttObjectType> objectTypeChoice = new DropDownChoice<GanttObjectType>(fs.getDropDownChoiceId(),
            new PropertyModel<GanttObjectType>(data, "ganttObjectType"), objectTypeChoiceRenderer.getValues(), objectTypeChoiceRenderer);
        objectTypeChoice.setNullValid(true);
        fs.add(objectTypeChoice);
      }
      {
        // Gantt: start date
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.startDate"));
        final DatePanel startDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "startDate"), DatePanelSettings.get()
            .withTargetType(java.sql.Date.class).withSelectProperty("startDate"));
        fs.add(startDatePanel);
      }
      {
        // Gantt: end date
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.endDate"));
        final DatePanel endDatePanel = new DatePanel(fs.newChildId(), new PropertyModel<Date>(data, "endDate"), DatePanelSettings.get()
            .withTargetType(java.sql.Date.class).withSelectProperty("endDate"));
        fs.add(endDatePanel);
        dependentFormComponents[1] = endDatePanel;
      }

      innerGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // Progress
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("task.progress")).setUnit("%");
        final MinMaxNumberField<Integer> progressField = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID, new PropertyModel<Integer>(
            data, "progress"), 0, 100) {
          @SuppressWarnings({ "unchecked", "rawtypes"})
          @Override
          public IConverter getConverter(final Class type)
          {
            return new IntegerPercentConverter(0);
          }
        };
        WicketUtils.setSize(progressField, 3);
        fs.add(progressField);
      }
      {
        // Gantt: duration
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.duration")).suppressLabelForWarning();
        final MinMaxNumberField<BigDecimal> durationField = new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID,
            new PropertyModel<BigDecimal>(data, "duration"), BigDecimal.ZERO, TaskEditForm.MAX_DURATION_DAYS);
        WicketUtils.setSize(durationField, 6);
        fs.add(durationField);
        dependentFormComponents[0] = durationField;
      }
      {
        // Gantt: predecessor offset
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.predecessorOffset")).setUnit(getString("days"));
        final MinMaxNumberField<Integer> ganttPredecessorField = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID,
            new PropertyModel<Integer>(data, "ganttPredecessorOffset"), Integer.MIN_VALUE, Integer.MAX_VALUE);
        WicketUtils.setSize(ganttPredecessorField, 6);
        fs.add(ganttPredecessorField);
      }
      innerGridBuilder.newGridPanel();
      {
        // Gantt relation type:
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.relationType"));
        final LabelValueChoiceRenderer<GanttRelationType> relationTypeChoiceRenderer = new LabelValueChoiceRenderer<GanttRelationType>(fs,
            GanttRelationType.values());
        final DropDownChoice<GanttRelationType> relationTypeChoice = new DropDownChoice<GanttRelationType>(fs.getDropDownChoiceId(),
            new PropertyModel<GanttRelationType>(data, "ganttRelationType"), relationTypeChoiceRenderer.getValues(),
            relationTypeChoiceRenderer);
        relationTypeChoice.setNullValid(true);
        fs.add(relationTypeChoice);
      }
      {
        // Gantt: predecessor
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("gantt.predecessor"));
        final TaskSelectPanel ganttPredecessorSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "ganttPredecessor"),
            parentPage, "ganttPredecessorId");
        fs.add(ganttPredecessorSelectPanel);
        ganttPredecessorSelectPanel.setShowFavorites(true);
        ganttPredecessorSelectPanel.init();
      }
    }

    // ///////////////////////////////
    // FINANCE ADMINISTRATION
    // ///////////////////////////////
    gridBuilder.newGridPanel();
    {
      final ToggleContainerPanel extendedSettingsPanel = new ToggleContainerPanel(gridBuilder.getPanel().newChildId()) {
        /**
         * @see org.projectforge.web.wicket.flowlayout.ToggleContainerPanel#wantsOnStatusChangedNotification()
         */
        @Override
        protected boolean wantsOnStatusChangedNotification()
        {
          return true;
        }
      };
      extendedSettingsPanel.setHeading(getString("financeAdministration"));
      gridBuilder.getPanel().add(extendedSettingsPanel);
      extendedSettingsPanel.setClosed();
      final GridBuilder innerGridBuilder = extendedSettingsPanel.createGridBuilder();
      innerGridBuilder.newSplitPanel(GridSize.COL50);

      if (Configuration.getInstance().isCostConfigured() == true) {
        // Cost 2 settings
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("fibu.kost2"));
        this.projektKostLabel = new DivTextPanel(fs.newChildId(), "");
        WicketUtils.addTooltip(projektKostLabel.getLabel(), new Model<String>() {
          @Override
          public String getObject()
          {
            final List<Kost2DO> kost2DOs = taskTree.getKost2List(projekt, data, data.getKost2BlackWhiteItems(), data.isKost2IsBlackList());
            final String[] kost2s = TaskListPage.getKost2s(kost2DOs);
            if (kost2s == null || kost2s.length == 0) {
              return " - (-)";
            }
            return StringHelper.listToString("\n", kost2s);
          };
        });
        fs.add(projektKostLabel);
        final PropertyModel<String> model = new PropertyModel<String>(data, "kost2BlackWhiteList");
        kost2BlackWhiteTextField = new MaxLengthTextField(InputPanel.WICKET_ID, model);
        WicketUtils.setSize(kost2BlackWhiteTextField, 10);
        fs.add(kost2BlackWhiteTextField);
        final LabelValueChoiceRenderer<Boolean> kost2listTypeChoiceRenderer = new LabelValueChoiceRenderer<Boolean>() //
            .addValue(Boolean.FALSE, getString("task.kost2list.whiteList")) //
            .addValue(Boolean.TRUE, getString("task.kost2list.blackList"));
        kost2listTypeChoice = new DropDownChoice<Boolean>(fs.getDropDownChoiceId(), new PropertyModel<Boolean>(data, "kost2IsBlackList"),
            kost2listTypeChoiceRenderer.getValues(), kost2listTypeChoiceRenderer);
        kost2listTypeChoice.setNullValid(false);
        fs.add(kost2listTypeChoice);
        final Kost2SelectPanel kost2SelectPanel = new Kost2SelectPanel(fs.newChildId(), new PropertyModel<Kost2DO>(this, "kost2Id"),
            parentPage, "kost2Id") {
          @Override
          protected void beforeSelectPage(final PageParameters parameters)
          {
            super.beforeSelectPage(parameters);
            if (projekt != null) {
              parameters.add(Kost2ListPage.PARAMETER_KEY_STORE_FILTER, false);
              parameters.add(Kost2ListPage.PARAMETER_KEY_SEARCH_STRING, "nummer:" + projekt.getKost() + ".*");
            }
          }
        };
        fs.add(kost2SelectPanel);
        kost2SelectPanel.init();
      }
      {
        // Time sheet booking status drop down box:
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("task.timesheetBooking"));
        final LabelValueChoiceRenderer<TimesheetBookingStatus> timesheetBookingStatusChoiceRenderer = new LabelValueChoiceRenderer<TimesheetBookingStatus>(
            fs, TimesheetBookingStatus.values());
        timesheetBookingStatusChoice = new DropDownChoice<TimesheetBookingStatus>(fs.getDropDownChoiceId(),
            new PropertyModel<TimesheetBookingStatus>(data, "timesheetBookingStatus"), timesheetBookingStatusChoiceRenderer.getValues(),
            timesheetBookingStatusChoiceRenderer);
        timesheetBookingStatusChoice.setNullValid(false);
        fs.add(timesheetBookingStatusChoice);
      }
      innerGridBuilder.newSplitPanel(GridSize.COL50);
      {
        // Protection of privacy:
        innerGridBuilder.newFieldset(getString("task.protectionOfPrivacy"))
        .addCheckBox(new PropertyModel<Boolean>(data, "protectionOfPrivacy"), null)
        .setTooltip(getString("task.protectionOfPrivacy.tooltip"));
      }
      {
        // Protection until
        final FieldsetPanel fs = innerGridBuilder.newFieldset(getString("task.protectTimesheetsUntil"));
        final DatePanel protectTimesheetsUntilPanel = new DatePanel(fs.newChildId(),
            new PropertyModel<Date>(data, "protectTimesheetsUntil"), DatePanelSettings.get().withTargetType(java.sql.Date.class)
            .withSelectProperty("protectTimesheetsUntil"));
        fs.add(protectTimesheetsUntilPanel);
        if (userGroupCache.isUserMemberOfFinanceGroup() == false) {
          protectTimesheetsUntilPanel.setEnabled(false);
        }
      }
    }

    gridBuilder.newGridPanel();
    {
      // Description:
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("description"));
      final IModel<String> model = new PropertyModel<String>(data, "description");
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, model), true);
      fs.addJIRAField(model);
    }
  }
View Full Code Here

Examples of org.projectforge.web.wicket.flowlayout.FieldsetPanel

  protected void init()
  {
    super.init();
    final HRFilter filter = getSearchFilter();
    gridBuilder.newGridPanel();
    final FieldsetPanel fs = gridBuilder.newFieldset(super.getOptionsLabel()).suppressLabelForWarning();
    final DivPanel optionsCheckBoxesPanel = fs.addNewCheckBoxButtonDiv();
    optionsCheckBoxesPanel.add(createAutoRefreshCheckBoxButton(optionsCheckBoxesPanel.newChildId(), new PropertyModel<Boolean>(filter, "showPlanning"),
        getString("hr.planning.filter.showPlanning")));
    optionsCheckBoxesPanel.add(createAutoRefreshCheckBoxButton(optionsCheckBoxesPanel.newChildId(), new PropertyModel<Boolean>(filter, "showBookedTimesheets"),
        getString("hr.planning.filter.showBookedTimesheets")));
    optionsCheckBoxesPanel.add(createAutoRefreshCheckBoxButton(optionsCheckBoxesPanel.newChildId(), new PropertyModel<Boolean>(filter, "onlyMyProjects"),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.