Package org.projectforge.web.wicket.flowlayout

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


    }
    gridBuilder = form.newGridBuilder(body, "fields");
    final GridSize gridSize = costConfigured == true ? GridSize.COL33 : GridSize.COL50;
    gridBuilder.newSplitPanel(gridSize);
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("timesheet.user")).suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
        /**
         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
        {
          final PFUserDO user = form.filter.getUser();
          return user != null ? user.getFullname() : "";
        }
      }));
    }
    if (costConfigured == true) {
      gridBuilder.newSplitPanel(gridSize);
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.kost1")).suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
        /**
         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
        {
          if (report == null) {
            return "";
          }
          final Kost1DO kost1 = kost1Dao.internalGetById(report.getKost1Id());
          return kost1 != null ? KostFormatter.format(kost1) : "";
        }
      }));
    }
    gridBuilder.newSplitPanel(gridSize);
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.common.workingDays")).suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
        @Override
        public String getObject()
        {
          return report != null ? String.valueOf(report.getNumberOfWorkingDays()) : "";
        };
      }));
    }
    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = new FieldsetPanel(gridBuilder.getPanel(), getString("fibu.common.workingDays"),
          getString("fibu.monthlyEmployeeReport.withoutTimesheets")) {
        /**
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible()
        {
          return report != null && StringUtils.isNotBlank(report.getFormattedUnbookedDays());
        }
      }.suppressLabelForWarning();
      fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
        /**
         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
View Full Code Here


    private BookmarkDialog redraw()
    {
      clearContent();
      final AbstractSecuredPage page = (AbstractSecuredPage) NavTopPanel.this.getPage();
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("bookmark.directPageLink")).setLabelSide(false);
        final TextArea<String> textArea = new TextArea<String>(fs.getTextAreaId(), new Model<String>(page.getPageAsLink()));
        fs.add(textArea);
        textArea.add(AttributeModifier.replace("onClick", "$(this).select();"));
      }
      final PageParameters params = page.getBookmarkableInitialParameters();
      if (params.isEmpty() == false) {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString(page.getTitleKey4BookmarkableInitialParameters())).setLabelSide(false);
        final TextArea<String> textArea = new TextArea<String>(fs.getTextAreaId(), new Model<String>(page.getPageAsLink(params)));
        fs.add(textArea);
        textArea.add(AttributeModifier.replace("onClick", "$(this).select();"));
      }
      return this;
    }
View Full Code Here

  {
    super.init();
    gridBuilder.newGridPanel();
    {
      // Number
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.kost2art.nummer"));
      final TextField<Integer> nummerField = new RequiredMinMaxNumberField<Integer>(InputPanel.WICKET_ID, new PropertyModel<Integer>(data,
          "id"), 0, 99) {
        @SuppressWarnings({ "rawtypes", "unchecked"})
        @Override
        public IConverter getConverter(final Class type)
        {
          return new IntegerConverter(2);
        }
      };
      if (isNew() == false) {
        nummerField.setEnabled(false);
      }
      fs.add(nummerField);
    }
    {
      // Invoiced
      gridBuilder.newFieldset(getString("fibu.fakturiert")).addCheckBox(new PropertyModel<Boolean>(data, "fakturiert"), null);
    }
    {
      // Invoiced
      gridBuilder.newFieldset(getString("fibu.kost2art.projektStandard")).addCheckBox(new PropertyModel<Boolean>(data, "projektStandard"),
          null);
    }
    {
      // Name
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.kost2art.name"));
      fs.add(new RequiredMaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(data, "name")));
    }
    {
      // Work frqction
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("fibu.kost2art.workFraction"));
      fs.add(new MinMaxNumberField<BigDecimal>(InputPanel.WICKET_ID, new PropertyModel<BigDecimal>(data, "workFraction"), BigDecimal.ZERO,
          BigDecimal.ONE));
    }
    {
      // Description
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("description"));
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "description")), true);
    }
  }
View Full Code Here

  {
    super.init();
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // Name
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("name"));
      final RequiredMaxLengthTextField name = new RequiredMaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(getData(),
          "name"));
      name.add(new AbstractValidator<String>() {
        @Override
        protected void onValidate(final IValidatable<String> validatable)
        {
          final String groupname = validatable.getValue();
          if (groupname == null) {
            return;
          }
          getData().setName(groupname);
          if (groupDao.doesGroupnameAlreadyExist(getData()) == true) {
            validatable.error(new ValidationError().addMessageKey("group.error.groupnameAlreadyExists"));
          }
        }
      });
      fs.add(name);
      WicketUtils.setStrong(name);
    }
    {
      // Organization
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("organization"));
      fs.add(new MaxLengthTextField(InputPanel.WICKET_ID, new PropertyModel<String>(getData(), "organization")));
    }
    {
      // Description
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("description"));
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(getData(), "description")));
    }
    if (Login.getInstance().hasExternalUsermanagementSystem() == true) {
      gridBuilder.newFieldset(getString("group.localGroup")).addCheckBox(new PropertyModel<Boolean>(data, "localGroup"), null)
      .setTooltip(getString("group.localGroup.tooltip"));
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // Assigned users
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("group.assignedUsers")).setLabelSide(false);
      final Set<PFUserDO> assignedUsers = getData().getAssignedUsers();
      final UsersProvider usersProvider = new UsersProvider();
      assignUsersListHelper = new MultiChoiceListHelper<PFUserDO>().setComparator(new UsersComparator()).setFullList(
          usersProvider.getSortedUsers());
      if (assignedUsers != null) {
        for (final PFUserDO user : assignedUsers) {
          assignUsersListHelper.addOriginalAssignedItem(user).assignItem(user);
        }
      }
      final Select2MultiChoice<PFUserDO> users = new Select2MultiChoice<PFUserDO>(fs.getSelect2MultiChoiceId(),
          new PropertyModel<Collection<PFUserDO>>(this.assignUsersListHelper, "assignedItems"), usersProvider);
      fs.add(users);
    }
    final boolean adminAccess = accessChecker.isLoggedInUserMemberOfAdminGroup();
    if (adminAccess == true && Login.getInstance().hasExternalUsermanagementSystem() == true) {
      ldapGroupValues = GroupDOConverter.readLdapGroupValues(data.getLdapValues());
      if (ldapGroupValues == null) {
View Full Code Here

      return;
    }
    final List<FormComponent< ? >> dependentLdapPosixFormComponentsList = new LinkedList<FormComponent< ? >>();
    if (posixConfigured == true) {
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.gidNumber"), getString("ldap.posixAccount"));
        gidNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapGroupValues, "gidNumber"), 1,
            65535);
        WicketUtils.setSize(gidNumberField, 6);
        fs.add(gidNumberField);
        fs.addHelpIcon(gridBuilder.getString("ldap.gidNumber.tooltip"));
        dependentLdapPosixFormComponentsList.add(gidNumberField);
        if (ldapGroupValues.isPosixValuesEmpty() == true) {
          final Button createButton = newCreateButton(dependentLdapPosixFormComponentsList);
          fs.add(new SingleButtonPanel(fs.newChildId(), createButton, gridBuilder.getString("create"), SingleButtonPanel.NORMAL));
          WicketUtils.addTooltip(createButton, gridBuilder.getString("ldap.gidNumber.createDefault.tooltip"));
        }
      }
    }
    if (posixConfigured == true) {
View Full Code Here

    addressEditSupport = new AddressPageSupport(this, gridBuilder, (AddressDao) getBaseDao(), personalAddressDao, data);
    /* GRID8 - BLOCK */
    gridBuilder.newSplitPanel(GridSize.COL50, true).newSubSplitPanel(GridSize.COL50);
    addressEditSupport.addName();
    addressEditSupport.addFirstName();
    final FieldsetPanel fs = (FieldsetPanel)addressEditSupport.addFormOfAddress();
    final DivPanel checkBoxPanel = fs.addNewCheckBoxButtonDiv();
    checkBoxPanel.addCheckBoxButton(new PropertyModel<Boolean>(addressEditSupport.personalAddress, "favoriteCard"), getString("favorite"),
        getString("address.tooltip.vCardList"));
    addressEditSupport.addTitle();
    addressEditSupport.addWebsite();

View Full Code Here

  }

  private void addPhoneNumber(final String property, final String labelKey, final String labelDescriptionKey,
      final String favoriteProperty, final FieldType fieldType)
  {
    final FieldsetPanel fs = (FieldsetPanel)addressEditSupport.addPhoneNumber(property, labelKey, labelDescriptionKey, fieldType);
    final DivPanel checkBoxPanel = fs.addNewCheckBoxButtonDiv();
    checkBoxPanel
    .addCheckBoxButton(new PropertyModel<Boolean>(addressEditSupport.personalAddress, favoriteProperty), PHONE_NUMBER_FAVORITE_LABEL)
    .setTooltip(getString("address.tooltip.phonelist"));
  }
View Full Code Here

  {
    super.init();
    timesheetPageSupport = new TimesheetPageSupport(parentPage, gridBuilder, timesheetDao, data);
    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("task"));
      fs.addCheckBox(new PropertyModel<Boolean>(this, "updateTask"), getString("update") + ":", getString("massupdate.updateTask"));
      final TaskSelectPanel taskSelectPanel = new TaskSelectPanel(fs, new PropertyModel<TaskDO>(data, "task"), parentPage, "taskId");
      fs.add(taskSelectPanel);
      taskSelectPanel.init();
    }
    {
      kost2Fieldset = new FieldsetPanel(gridBuilder.getPanel(), getString("fibu.kost2")) {
        @Override
        public boolean isVisible()
        {
          return CollectionUtils.isNotEmpty(kost2List);
        }
View Full Code Here

  @SuppressWarnings("serial")
  private void addPassswordFields()
  {
    // Password
    final FieldsetPanel fs = gridBuilder.newFieldset(getString("password"), getString("passwordRepeat"));
    final PasswordTextField passwordField = new PasswordTextField(fs.getTextFieldId(), new PropertyModel<String>(this, "password")) {
      @Override
      protected void onComponentTag(final ComponentTag tag)
      {
        super.onComponentTag(tag);
        if (passwordUser == null) {
          tag.put("value", "");
        } else if (StringUtils.isEmpty(getConvertedInput()) == false) {
          tag.put("value", MAGIC_PASSWORD);
        }
      }
    };
    passwordField.setResetPassword(false).setRequired(isNew());
    final PasswordTextField passwordRepeatField = new PasswordTextField(fs.getTextFieldId(), new PropertyModel<String>(this,
        "passwordRepeat")) {
      @Override
      protected void onComponentTag(final ComponentTag tag)
      {
        super.onComponentTag(tag);
        if (passwordUser == null) {
          tag.put("value", "");
        } else if (StringUtils.isEmpty(getConvertedInput()) == false) {
          tag.put("value", MAGIC_PASSWORD);
        }
      }
    };
    passwordRepeatField.setResetPassword(false).setRequired(false);
    passwordRepeatField.add(new AbstractValidator<String>() {
      @Override
      protected void onValidate(final IValidatable<String> validatable)
      {
        final String passwordRepeatInput = validatable.getValue();
        passwordField.validate();
        final String passwordInput = passwordField.getConvertedInput();
        if (StringUtils.isEmpty(passwordInput) == true && StringUtils.isEmpty(passwordRepeatInput) == true) {
          return;
        }
        if (StringUtils.equals(passwordInput, passwordRepeatInput) == false) {
          passwordUser = null;
          validatable.error(new ValidationError().addMessageKey("user.error.passwordAndRepeatDoesNotMatch"));
          return;
        }
        if (MAGIC_PASSWORD.equals(passwordInput) == false || passwordUser == null) {
          final String errorMsgKey = ((UserDao) getBaseDao()).checkPasswordQuality(passwordInput);
          if (errorMsgKey != null) {
            passwordUser = null;
            validatable.error(new ValidationError().addMessageKey(errorMsgKey));
          } else {
            passwordUser = new PFUserDO();
            ((UserDao) getBaseDao()).createEncryptedPassword(passwordUser, passwordInput);
          }
        }
      }

      /**
       * @see org.apache.wicket.validation.validator.AbstractValidator#validateOnNullValue()
       */
      @Override
      public boolean validateOnNullValue()
      {
        // Should be validated (e. g. if password field is given but password repeat field not).
        return true;
      }
    });
    WicketUtils.setPercentSize(passwordField, 50);
    WicketUtils.setPercentSize(passwordRepeatField, 50);
    fs.add(passwordField);
    fs.add(passwordRepeatField);
    fs.addHelpIcon(getString(UserDao.MESSAGE_KEY_PASSWORD_QUALITY_CHECK));
  }
View Full Code Here

  }

  private static void addDateFormatCombobox(final GridBuilder gridBuilder, final PFUserDO user, final String labelKey,
      final String property, final String[] dateFormats, final boolean convertExcelFormat)
  {
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString(labelKey));
    final LabelValueChoiceRenderer<String> dateFormatChoiceRenderer = new LabelValueChoiceRenderer<String>();
    for (final String str : dateFormats) {
      String dateString = "???";
      final String pattern = convertExcelFormat == true ? str.replace('Y', 'y').replace('D', 'd') : str;
      try {
        final SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
        dateString = dateFormat.format(new Date());
      } catch (final Exception ex) {
        log.warn("Invalid date format in config.xml: " + pattern);
      }
      dateFormatChoiceRenderer.addValue(str, str + ": " + dateString);
    }
    final DropDownChoice<String> dateFormatChoice = new DropDownChoice<String>(fs.getDropDownChoiceId(), new PropertyModel<String>(user,
        property), dateFormatChoiceRenderer.getValues(), dateFormatChoiceRenderer);
    dateFormatChoice.setNullValid(true);
    fs.add(dateFormatChoice);
  }
View Full Code Here

TOP

Related Classes of org.projectforge.web.wicket.flowlayout.FieldsetPanel

Copyright © 2018 www.massapicom. 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.