Package org.projectforge.web.wicket.flowlayout

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


  }

  public static void createTimeZone(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // Time zone
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("timezone"));
    final TimeZoneField timeZone = new TimeZoneField(fs.getTextFieldId(), new PropertyModel<TimeZone>(user, "timeZoneObject"));
    fs.addKeyboardHelpIcon(gridBuilder.getString("tooltip.autocomplete.timeZone"));
    fs.add(timeZone);
  }
View Full Code Here


   */
  public static void createPhoneIds(final GridBuilder gridBuilder, final PFUserDO user)
  {
    if (StringUtils.isNotEmpty(ConfigXml.getInstance().getTelephoneSystemUrl()) == true) {
      // Personal phone identifiers
      final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.personalPhoneIdentifiers"));
      fs.add(new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(user, "personalPhoneIdentifiers")));
      fs.addHelpIcon(new ResourceModel("user.personalPhoneIdentifiers.tooltip.title"), new ResourceModel(
          "user.personalPhoneIdentifiers.tooltip.content"));
    }
  }
View Full Code Here

   */
  public static void createMEBPhoneNumbers(final GridBuilder gridBuilder, final PFUserDO user)
  {
    if (Configuration.getInstance().isMebConfigured() == true) {
      // MEB mobile phone numbers
      final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.personalMebMobileNumbers"));
      fs.add(new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(user, "personalMebMobileNumbers")));
      fs.addHelpIcon(
          new ResourceModel("user.personalMebMobileNumbers.tooltip.title"),
          Model.of(gridBuilder.getString("user.personalMebMobileNumbers.tooltip.content")
              + " "
              + gridBuilder.getString("user.personalMebMobileNumbers.format")));
    }
View Full Code Here

  }

  public static void createDescription(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // Description
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("description"));
    fs.add(new MaxLengthTextArea(fs.getTextAreaId(), new PropertyModel<String>(user, "description")));
  }
View Full Code Here

  }

  public static void createSshPublicKey(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // SSH public key
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.sshPublicKey"));
    fs.add(new MaxLengthTextArea(fs.getTextAreaId(), new PropertyModel<String>(user, "sshPublicKey")));
  }
View Full Code Here

        return reportPathHeading;
      }
    }));
    gridBuilder.newGridPanel();
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("file"), "*.xsl, *.jrxml");
      fileUploadField = new FileUploadField(FileUploadPanel.WICKET_ID);
      fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
        @Override
        public String getObject()
        {
          final ReportScriptingStorage storage = getReportScriptingStorage();
          return storage != null ? storage.getLastAddedFilename() : "";
        }
      }));
      fs.add(new FileUploadPanel(fs.newChildId(), fileUploadField));
      final Button uploadButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("upload")) {
        @Override
        public final void onSubmit()
        {
          parentPage.upload();
        }
      };
      fs.add(new SingleButtonPanel(fs.newChildId(), uploadButton, getString("upload"), SingleButtonPanel.NORMAL));
    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.groovyScript"));
      final AceEditorPanel textArea = new AceEditorPanel(fs.newChildId(), new PropertyModel<String>(this, "groovyScript"));
      fs.add(textArea);
    }
    {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("label.groovy.result")).suppressLabelForWarning();
      final DivTextPanel groovyResultPanel = new DivTextPanel(fs.newChildId(), new Model<String>() {
        /**
         * @see org.apache.wicket.model.Model#getObject()
         */
        @Override
        public String getObject()
        {
          final GroovyResult groovyResult = parentPage.groovyResult;
          final StringBuffer buf = new StringBuffer();
          buf.append(groovyResult.getResultAsHtmlString());
          if (groovyResult.getResult() != null && StringUtils.isNotEmpty(groovyResult.getOutput()) == true) {
            buf.append("<br/>\n");
            buf.append(HtmlHelper.escapeXml(groovyResult.getOutput()));
          }
          return buf.toString();
        }
      }) {
        /**
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible()
        {
          final GroovyResult groovyResult = parentPage.groovyResult;
          return (groovyResult != null && groovyResult.hasResult() == true);
        }
      };
      groovyResultPanel.getLabel().setEscapeModelStrings(false);
      fs.add(groovyResultPanel);
    }
    {
      final Button executeButton = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("execute")) {
        @Override
        public final void onSubmit()
View Full Code Here

    }
    final boolean adminAccess = accessChecker.isLoggedInUserMemberOfAdminGroup();
    gridBuilder.newSplitPanel(GridSize.COL50);
    {
      // User
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("user"));
      if (adminAccess == true) {
        usernameTextField = new RequiredMaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(data, "username"));
        WicketUtils.setStrong(usernameTextField);
        fs.add(usernameTextField);
        usernameTextField.add(new AbstractValidator<String>() {

          @Override
          protected void onValidate(final IValidatable<String> validatable)
          {
            data.setUsername(validatable.getValue());
            if (StringUtils.isNotEmpty(data.getUsername()) == true && ((UserDao) getBaseDao()).doesUsernameAlreadyExist(data) == true) {
              validatable.error(new ValidationError().addMessageKey("user.error.usernameAlreadyExists"));
            }
          }
        });
      } else {
        fs.add(new DivTextPanel(fs.newChildId(), data.getUsername()));
      }
    }
    createFirstName(gridBuilder, data);
    createLastName(gridBuilder, data);
    createOrganization(gridBuilder, data);
View Full Code Here

    }
    final List<FormComponent< ? >> dependentLdapPosixFormComponentsList = new LinkedList<FormComponent< ? >>();
    final List<FormComponent< ? >> dependentLdapSambaFormComponentsList = new LinkedList<FormComponent< ? >>();
    if (posixConfigured == true) {
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.uidNumber"), getString("ldap.posixAccount"));
        uidNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues, "uidNumber"), 1,
            65535);
        WicketUtils.setSize(uidNumberField, 6);
        fs.add(uidNumberField);
        fs.addHelpIcon(gridBuilder.getString("ldap.uidNumber.tooltip"));
        dependentLdapPosixFormComponentsList.add(uidNumberField);
        if (ldapUserValues.isPosixValuesEmpty() == true) {
          final Button createButton = newCreateButton(dependentLdapPosixFormComponentsList, dependentLdapSambaFormComponentsList, true,
              sambaConfigured);
          fs.add(new SingleButtonPanel(fs.newChildId(), createButton, gridBuilder.getString("create"), SingleButtonPanel.NORMAL));
          WicketUtils.addTooltip(createButton, gridBuilder.getString("ldap.uidNumber.createDefault.tooltip"));
        }
      }
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.gidNumber"), getString("ldap.posixAccount"));
        gidNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues, "gidNumber"), 1,
            65535);
        WicketUtils.setSize(gidNumberField, 6);
        fs.add(gidNumberField);
        dependentLdapPosixFormComponentsList.add(gidNumberField);
      }
    }
    final LdapSambaAccountsConfig ldapSambaAccountsConfig = ConfigXml.getInstance().getLdapConfig().getSambaAccountsConfig();
    if (sambaConfigured == true) {
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaSID"));
        final DivTextPanel textPanel = new DivTextPanel(fs.newChildId(), ldapSambaAccountsConfig.getSambaSIDPrefix() + "-");
        fs.add(textPanel);
        sambaSIDNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues,
            "sambaSIDNumber"), 1, 65535);
        fs.add(sambaSIDNumberField);
        sambaSIDNumberField.setOutputMarkupId(true);
        WicketUtils.setSize(sambaSIDNumberField, 5);
        fs.addHelpIcon(getString("ldap.sambaSID.tooltip"));
        dependentLdapSambaFormComponentsList.add(sambaSIDNumberField);
        if (ldapUserValues.getSambaSIDNumber() == null) {
          final Button createButton = newCreateButton(dependentLdapPosixFormComponentsList, dependentLdapSambaFormComponentsList, false,
              true);
          fs.add(new SingleButtonPanel(fs.newChildId(), createButton, gridBuilder.getString("create"), SingleButtonPanel.NORMAL));
          WicketUtils.addTooltip(createButton, gridBuilder.getString("ldap.sambaSID.createDefault.tooltip"));
        }
      }
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaPrimaryGroupSID"), getString("ldap.sambaAccount"));
        final DivTextPanel textPanel = new DivTextPanel(fs.newChildId(), ldapSambaAccountsConfig.getSambaSIDPrefix() + "-");
        fs.add(textPanel);
        sambaPrimaryGroupSIDNumberField = new MinMaxNumberField<Integer>(fs.getTextFieldId(), new PropertyModel<Integer>(ldapUserValues,
            "sambaPrimaryGroupSIDNumber"), 1, 65535);
        fs.add(sambaPrimaryGroupSIDNumberField);
        sambaPrimaryGroupSIDNumberField.setOutputMarkupId(true);
        WicketUtils.setSize(sambaPrimaryGroupSIDNumberField, 5);
        fs.addHelpIcon(getString("ldap.sambaPrimaryGroupSID.tooltip"));
        dependentLdapSambaFormComponentsList.add(sambaPrimaryGroupSIDNumberField);
      }
    }
    gridBuilder.newSplitPanel(GridSize.COL50);
    gridBuilder.newFieldset(getString("user.restrictedUser")).addCheckBox(new PropertyModel<Boolean>(data, "restrictedUser"), null)
    .setTooltip(getString("user.restrictedUser.tooltip"));
    if (posixConfigured == true) {
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.homeDirectory"), getString("ldap.posixAccount"));
        homeDirectoryField = new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(ldapUserValues, "homeDirectory"), 255);
        fs.add(homeDirectoryField);
        dependentLdapPosixFormComponentsList.add(homeDirectoryField);
      }
      {
        final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.loginShell"), getString("ldap.posixAccount"));
        loginShellField = new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(ldapUserValues, "loginShell"), 100);
        fs.add(loginShellField);
        dependentLdapPosixFormComponentsList.add(loginShellField);
      }
      if (ldapUserValues.isPosixValuesEmpty() == true) {
        for (final FormComponent< ? > component : dependentLdapPosixFormComponentsList) {
          component.setEnabled(false);
        }
      }
    }
    if (sambaConfigured == true) {
      final FieldsetPanel fs = gridBuilder.newFieldset(getString("ldap.sambaNTPassword"), getString("ldap.sambaNTPassword.subtitle"))
          .suppressLabelForWarning();
      final DivTextPanel sambaNTPassword = new DivTextPanel(fs.newChildId(), "*****");
      fs.add(sambaNTPassword);
      fs.addHelpIcon(getString("ldap.sambaNTPassword.tooltip"));
      if (ldapUserValues.isSambaValuesEmpty() == true) {
        for (final FormComponent< ? > component : dependentLdapSambaFormComponentsList) {
          component.setEnabled(false);
        }
      }
View Full Code Here

    }

    gridBuilder.newSplitPanel(GridSize.COL50);

    // new title
    final FieldsetPanel fsTitle = gridBuilder.newFieldset(getString("plugins.poll.new.title"));
    final RequiredTextField<String> title = new RequiredTextField<String>(fsTitle.getTextFieldId(), new PropertyModel<String>(this.data, "title"));
    fsTitle.add(title);

    // new location
    final FieldsetPanel fsLocation = gridBuilder.newFieldset(getString("plugins.poll.new.location"));
    final PFAutoCompleteTextField<String> location = new PFAutoCompleteTextField<String>(fsLocation.getTextFieldId(), new PropertyModel<String>(
        this.data, "location")) {
      private static final long serialVersionUID = -2309992819521957913L;

      @Override
      protected List<String> getChoices(final String input)
      {
        return getBaseDao().getAutocompletion("location", input);
      }
    };
    fsLocation.add(location);

    // new description
    final FieldsetPanel fsDesc = gridBuilder.newFieldset(getString("plugins.poll.new.description"));
    final TextArea<String> desc = new TextArea<String>(fsDesc.getTextAreaId(), new PropertyModel<String>(this.data, "description"));
    fsDesc.add(desc);

    // attendee list
    final FieldsetPanel fsAttendee = gridBuilder.newFieldset(getString("plugins.poll.attendee.users"));
    final UsersProvider usersProvider = new UsersProvider();
    final MultiChoiceListHelper<PFUserDO> attendeeHelper = new MultiChoiceListHelper<PFUserDO>().setComparator(new UsersComparator())
        .setFullList(usersProvider.getSortedUsers());
    attendeeHelper.setAssignedItems(attendeePFUserList);
    final Select2MultiChoice<PFUserDO> attendees = new Select2MultiChoice<PFUserDO>(fsAttendee.getSelect2MultiChoiceId(),
        new PropertyModel<Collection<PFUserDO>>(attendeeHelper, "assignedItems"), usersProvider);
    fsAttendee.add(attendees);

    // new email list
    // TODO email list
  }
View Full Code Here

    super.init();
    /* GRID16 - BLOCK */
    gridBuilder.newGridPanel();
    {
      // Employee
      final FieldsetPanel fs = gridBuilder.newFieldset(EmployeeSalaryDO.class, "employee");
      final EmployeeSelectPanel employeeSelectPanel = new EmployeeSelectPanel(fs.newChildId(), new PropertyModel<EmployeeDO>(data,
          "employee"), parentPage, "employee");
      fs.add(employeeSelectPanel);
      employeeSelectPanel.setFocus().setRequired(true);
      employeeSelectPanel.init();
    }
    {
      // DropDownChoice months
      final FieldsetPanel fs = gridBuilder.newFieldset(WicketUtils.createMultipleFieldsetLabel(getString("calendar.month"),
          getString("calendar.year")));
      final LabelValueChoiceRenderer<Integer> monthChoiceRenderer = new LabelValueChoiceRenderer<Integer>();
      for (int i = 0; i <= 11; i++) {
        monthChoiceRenderer.addValue(i, StringHelper.format2DigitNumber(i + 1));
      }
      final DropDownChoice<Integer> monthChoice = new DropDownChoice<Integer>(fs.getDropDownChoiceId(), new PropertyModel<Integer>(data,
          "month"), monthChoiceRenderer.getValues(), monthChoiceRenderer);
      monthChoice.setNullValid(false).setRequired(true);
      WicketUtils.setSize(monthChoice, 2);
      fs.add(monthChoice);
      final MinMaxNumberField<Integer> year = new MinMaxNumberField<Integer>(InputPanel.WICKET_ID,
          new PropertyModel<Integer>(data, "year"), 1900, 2999);
      WicketUtils.setSize(year, 4);
      fs.add(year);
    }
    {
      // DropDownChoice salary type
      final FieldsetPanel fs = gridBuilder.newFieldset(EmployeeSalaryDO.class, "type");
      final LabelValueChoiceRenderer<EmployeeSalaryType> typeStatusChoiceRenderer = new LabelValueChoiceRenderer<EmployeeSalaryType>(fs,
          EmployeeSalaryType.values());
      final DropDownChoice<EmployeeSalaryType> typeChoice = new DropDownChoice<EmployeeSalaryType>(fs.getDropDownChoiceId(),
          new PropertyModel<EmployeeSalaryType>(data, "type"), typeStatusChoiceRenderer.getValues(), typeStatusChoiceRenderer);
      typeChoice.setNullValid(false).setRequired(true);
      fs.add(typeChoice);
    }
    {
      // DropDownChoice salary gross sum with employee part
      final FieldsetPanel fs = gridBuilder.newFieldset(EmployeeSalaryDO.class, "bruttoMitAgAnteil");
      fs.add(new TextField<BigDecimal>(InputPanel.WICKET_ID, new PropertyModel<BigDecimal>(data, "bruttoMitAgAnteil")) {
        @SuppressWarnings({ "unchecked", "rawtypes"})
        @Override
        public IConverter getConverter(final Class type)
        {
          return new CurrencyConverter();
        }
      });
    }
    {
      // Comment
      final FieldsetPanel fs = gridBuilder.newFieldset(EmployeeSalaryDO.class, "comment");
      fs.add(new MaxLengthTextArea(TextAreaPanel.WICKET_ID, new PropertyModel<String>(data, "comment")), true);
    }
  }
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.