Package org.projectforge.web.wicket.flowlayout

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


  }

  public static void createOrganization(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // Organization
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("organization"));
    fs.add(new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(user, "organization")));
  }
View Full Code Here


  }

  public static void createEMail(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // E-Mail
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("email"));
    fs.add(new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(user, "email")));
  }
View Full Code Here

  @SuppressWarnings("serial")
  public static void createAuthenticationToken(final GridBuilder gridBuilder, final PFUserDO user, final UserDao userDao,
      final Form< ? > form)
  {
    // Authentication token
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.authenticationToken")).suppressLabelForWarning();
    fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
      @Override
      public String getObject()
      {
        if (PFUserContext.getUserId().equals(user.getId()) == true) {
          return userDao.getAuthenticationToken(user.getId());
        } else {
          // Administrators shouldn't see the token.
          return "*****";
        }
      }
    }));
    fs.addHelpIcon(gridBuilder.getString("user.authenticationToken.tooltip"));
    final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("renewAuthenticationKey")) {
      @Override
      public final void onSubmit()
      {
        userDao.renewAuthenticationToken(user.getId());
        form.error(getString("user.authenticationToken.renew.successful"));
      }
    };
    button.add(WicketUtils.javaScriptConfirmDialogOnClick(form.getString("user.authenticationToken.renew.securityQuestion")));
    fs.add(new SingleButtonPanel(fs.newChildId(), button, gridBuilder.getString("user.authenticationToken.renew"), SingleButtonPanel.DANGER));
    WicketUtils.addTooltip(button, gridBuilder.getString("user.authenticationToken.renew.tooltip"));
  }
View Full Code Here

        public boolean isVisible()
        {
          return searchFilter.isFilter();
        }
      });
      final FieldsetPanel fieldset = gridBuilder.newFieldset(parentPage.getString("address.contactStatus")).suppressLabelForWarning();
      final DivPanel checkBoxPanel = fieldset.addNewCheckBoxButtonDiv();
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(searchFilter, "active"),
          parentPage.getString("address.contactStatus.active")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(searchFilter,
          "nonActive"), parentPage.getString("address.contactStatus.nonActive")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(searchFilter,
          "uninteresting"), parentPage.getString("address.contactStatus.uninteresting")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(searchFilter,
          "personaIngrata"), parentPage.getString("address.contactStatus.personaIngrata")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(),
          new PropertyModel<Boolean>(searchFilter, "departed"), parentPage.getString("address.contactStatus.departed")));
    }
    {
      gridBuilder.newSplitPanel(GridSize.COL50);
      final FieldsetPanel fieldset = gridBuilder.newFieldset(parentPage.getString("address.addressStatus")).suppressLabelForWarning();
      final DivPanel checkBoxPanel = fieldset.addNewCheckBoxButtonDiv();
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(),
          new PropertyModel<Boolean>(searchFilter, "uptodate"), parentPage.getString("address.addressStatus.uptodate")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(),
          new PropertyModel<Boolean>(searchFilter, "outdated"), parentPage.getString("address.addressStatus.outdated")));
      checkBoxPanel.add(form.createAutoRefreshCheckBoxButton(checkBoxPanel.newChildId(), new PropertyModel<Boolean>(searchFilter, "leaved"),
View Full Code Here

    body.add(form);
    form.init();
    resultGridBuilder = form.newGridBuilder(body, "results");
    resultGridBuilder.newGridPanel();
    {
      scriptResultFieldsetPanel = new FieldsetPanel(resultGridBuilder.getPanel(), getString("scripting.script.result")) {
        /**
         * @see org.apache.wicket.Component#isVisible()
         */
        @Override
        public boolean isVisible()
View Full Code Here

  }

  public static void createJIRAUsername(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // JIRA user name
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.jiraUsername"));
    fs.add(new MaxLengthTextField(fs.getTextFieldId(), new PropertyModel<String>(user, "jiraUsername")));
    fs.addHelpIcon(gridBuilder.getString("user.jiraUsername.tooltip"));
  }
View Full Code Here

  }

  @SuppressWarnings("serial")
  private void addTemplatesRow()
  {
    final FieldsetPanel templatesRow = gridBuilder.newFieldset(getString("templates")).suppressLabelForWarning();
    final String[] templateNames = userPrefDao.getPrefNames(UserPrefArea.TIMESHEET_TEMPLATE);
    if (templateNames != null && templateNames.length > 0) {
      // DropDownChoice templates
      final String label = getString("userPref.template.select");
      final LabelValueChoiceRenderer<String> templateNamesChoiceRenderer = new LabelValueChoiceRenderer<String>();
      templateNamesChoiceRenderer.addValue("", label);
      for (final String name : templateNames) {
        templateNamesChoiceRenderer.addValue(name, name);
      }
      final DropDownChoice<String> templateNamesChoice = new DropDownChoice<String>(templatesRow.getDropDownChoiceId(),
          new PropertyModel<String>(this, "templateName"), templateNamesChoiceRenderer.getValues(), templateNamesChoiceRenderer) {
        @Override
        protected boolean wantOnSelectionChangedNotifications()
        {
          return true;
        }

        /**
         * @see org.apache.wicket.markup.html.form.AbstractSingleSelectChoice#getDefaultChoice(java.lang.String)
         */
        @Override
        protected CharSequence getDefaultChoice(final String selectedValue)
        {
          return "";
        }

        @Override
        protected void onSelectionChanged(final String newSelection)
        {
          if (StringUtils.isNotEmpty(newSelection) == true) {
            // Fill fields with selected template values:
            final UserPrefDO userPref = userPrefDao.getUserPref(UserPrefArea.TIMESHEET_TEMPLATE, newSelection);
            if (userPref != null) {
              data.setKost2(null).setTask(null);
              locationTextField.processInput(); // Update model.
              descriptionArea.processInput(); // Update model.
              if (recentUserPref != null) {
                final String recentLocation = recentUserPref.getUserPrefEntryAsString("location");
                if (StringUtils.equals(recentLocation, data.getLocation()) == true) {
                  // Previous value was filled by recent user pref so overwrite it:
                  data.setLocation(null);
                }
                final String recentDescription = recentUserPref.getUserPrefEntryAsString("description");
                if (StringUtils.equals(recentDescription, data.getDescription()) == true) {
                  // Previous value was filled by recent user pref so overwrite it:
                  data.setDescription(null);
                }
              }
              userPrefDao.fillFromUserPrefParameters(userPref, data, true);
              recentUserPref = userPref;
              locationTextField.modelChanged();
              descriptionArea.modelChanged();
              if (cost2ChoicePanel != null) {
                cost2ChoicePanel.getDropDownChoice().modelChanged();
              }
            }
            templateName = "";
            refresh();
          }
        }
      };
      templateNamesChoice.setNullValid(true);
      templatesRow.add(templateNamesChoice);
    }
    // Needed as submit link because the modal dialog reloads the page and otherwise any previous change will be lost.
    final AjaxSubmitLink link = new AjaxSubmitLink(IconLinkPanel.LINK_ID) {
      @Override
      protected void onSubmit(final AjaxRequestTarget target, final Form< ? > form)
      {
        recentSheetsModalDialog.open(target);
      }

      @Override
      protected void onError(final AjaxRequestTarget target, final Form< ? > form)
      {
      }
    };
    link.setDefaultFormProcessing(false);
    templatesRow
    .add(new IconLinkPanel(templatesRow.newChildId(), IconType.FOLDER_OPEN, new ResourceModel("timesheet.recent.select"), link));
    recentSheetsModalDialog = new TimesheetEditSelectRecentDialogPanel(parentPage.newModalDialogId(), getString("timesheet.recent.select"),
        parentPage, TimesheetEditForm.this, cost2Exists, timesheetDao, taskTree, userFormatter);
    parentPage.add(recentSheetsModalDialog);
    recentSheetsModalDialog.init();
  }
View Full Code Here

  public static void createLastLoginAndDeleteAllStayLogins(final GridBuilder gridBuilder, final PFUserDO user, final UserDao userDao,
      final Form< ? > form)
  {
    // Last login and deleteAllStayLoggedInSessions
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("login.lastLogin")).suppressLabelForWarning();
    fs.add(new DivTextPanel(fs.newChildId(), DateTimeFormatter.instance().getFormattedDateTime(user.getLastLogin())));
    @SuppressWarnings("serial")
    final Button button = new Button(SingleButtonPanel.WICKET_ID, new Model<String>("invalidateStayLoggedInSessions")) {
      @Override
      public final void onSubmit()
      {
        userDao.renewStayLoggedInKey(user.getId());
        form.error(getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions.successfullDeleted"));
      }
    };
    fs.add(new SingleButtonPanel(fs.newChildId(), button, gridBuilder.getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions"),
        SingleButtonPanel.DANGER));
    WicketUtils.addTooltip(button, gridBuilder.getString("login.stayLoggedIn.invalidateAllStayLoggedInSessions.tooltip"));
  }
View Full Code Here

  }

  public static void createLocale(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // Locale
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("user.locale"));
    final LabelValueChoiceRenderer<Locale> localeChoiceRenderer = new LabelValueChoiceRenderer<Locale>();
    localeChoiceRenderer.addValue(null, gridBuilder.getString("user.defaultLocale"));
    for (final String str : I18nCore.LOCALIZATIONS) {
      localeChoiceRenderer.addValue(new Locale(str), gridBuilder.getString("locale." + str));
    }
    @SuppressWarnings("serial")
    final DropDownChoice<Locale> localeChoice = new DropDownChoice<Locale>(fs.getDropDownChoiceId(), new PropertyModel<Locale>(user,
        "locale"), localeChoiceRenderer.getValues(), localeChoiceRenderer) {
      /**
       * @see org.apache.wicket.markup.html.form.AbstractSingleSelectChoice#getDefaultChoice(java.lang.String)
       */
      @Override
      protected CharSequence getDefaultChoice(final String selectedValue)
      {
        return "";
      }

      @Override
      protected Locale convertChoiceIdToChoice(final String id)
      {
        if (StringHelper.isIn(id, I18nCore.LOCALIZATIONS) == true) {
          return new Locale(id);
        } else {
          return null;
        }
      }
    };
    fs.add(localeChoice);
  }
View Full Code Here

  }

  public static void createTimeNotation(final GridBuilder gridBuilder, final PFUserDO user)
  {
    // Time notation
    final FieldsetPanel fs = gridBuilder.newFieldset(gridBuilder.getString("timeNotation"));
    final LabelValueChoiceRenderer<TimeNotation> timeNotationChoiceRenderer = new LabelValueChoiceRenderer<TimeNotation>();
    timeNotationChoiceRenderer.addValue(TimeNotation.H12, gridBuilder.getString("timeNotation.12"));
    timeNotationChoiceRenderer.addValue(TimeNotation.H24, gridBuilder.getString("timeNotation.24"));
    final DropDownChoice<TimeNotation> timeNotationChoice = new DropDownChoice<TimeNotation>(fs.getDropDownChoiceId(),
        new PropertyModel<TimeNotation>(user, "timeNotation"), timeNotationChoiceRenderer.getValues(), timeNotationChoiceRenderer);
    timeNotationChoice.setNullValid(true);
    fs.add(timeNotationChoice);
  }
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.