Package org.apache.wicket.util.string

Examples of org.apache.wicket.util.string.StringValue


    final INamedParameters parameters = url.getParameters();
   
    if (parameters != null)
    {
      // store the version in the request cycle
      StringValue versionValue = parameters.get(versionParameter);
      RequestCycle requestCycle = RequestCycle.get();
      if (versionValue.isEmpty() == false && requestCycle != null)
      {
        requestCycle.setMetaData(URL_VERSION, versionValue.toString());
      }

      // undecorate
      parameters.remove(versionParameter);
    }
View Full Code Here


     */
    @Override
    public String getObject()
    {
      // name contains the name of the selected file
      StringValue sourceParam = getPageParameters().get(SOURCE);
      if (Strings.isEmpty(name) && sourceParam.isEmpty())
      {
        return "";
      }

      String source = null;
      InputStream resourceAsStream = null;
      try
      {
        source = (name != null) ? name : sourceParam.toString();
        resourceAsStream = getPageTargetClass().getResourceAsStream(source);
        if (resourceAsStream == null)
        {
          return "Unable to read the source for " + source;
        }
View Full Code Here

      // the list that will contain accepted post param values
      List<StringValue> postValues = new ArrayList<StringValue>();

      for (String value : values)
      {
        StringValue val = StringValue.valueOf(value);
        if (queryValues.contains(val))
        {
          // if a query param with this value exists remove it and continue
          queryValues.remove(val);
        }
View Full Code Here

    add(form);
    form.setMultiPart(true);
    form.setMaxSize(Bytes.kilobytes(100));
    form.add(new TextField<String>("text"));
    fileUploadField = new FileUploadField("file", new Model<FileUpload>());
    StringValue requiredParam = param.get("required");
    boolean required = requiredParam.toBoolean();
    fileUploadField.setRequired(required);
    form.add(fileUploadField);
  }
View Full Code Here

      // the list that will contain accepted post param values
      List<StringValue> postValues = new ArrayList<StringValue>();

      for (String value : values)
      {
        StringValue val = StringValue.valueOf(value);
        if (queryValues.contains(val))
        {
          // if a query param with this value exists remove it and continue
          queryValues.remove(val);
        }
View Full Code Here

     * sets the theme for the current user.
     *
     * @param pageParameters current page parameters
     */
    private void configureTheme(PageParameters pageParameters) {
        StringValue theme = pageParameters.get("theme");

        if (!theme.isEmpty()) {
            IBootstrapSettings settings = Bootstrap.getSettings(getApplication());
            settings.getActiveThemeProvider().setActiveTheme(theme.toString(""));
        }
    }
View Full Code Here

        }

        @Override
        protected void respond(AjaxRequestTarget target) {
            IRequestParameters requestParameters = getComponent().getRequest().getRequestParameters();
            StringValue color = requestParameters.getParameterValue("color");

            onChange(target, color.toString());
        }
View Full Code Here

        add(new AjaxEventBehavior("change") {
            @Override
            protected void onEvent(AjaxRequestTarget target) {
                WebRequest request = getWebRequest();
                IRequestParameters requestParameters = request.getRequestParameters();
                StringValue value = requestParameters.getParameterValue(getParameterName());
                if (!value.isNull()) {
                    Boolean convertedInput = CheckBoxXConverter.INSTANCE.convertToObject(value.toString(), getLocale());
                    setModelObject(convertedInput);
                    onChange(convertedInput, target);
                }
            }
View Full Code Here

    public void onRequest() {

        RequestCycle requestCycle = getComponent().getRequestCycle();
        Request request = requestCycle.getRequest();
        IRequestParameters parameters = request.getRequestParameters();
        StringValue input = parameters.getParameterValue(QUERY_PARAM);

        final Iterable<T> choices = getChoices(input.toString(""));

        String jsonArray = createJson(choices);

        requestCycle.scheduleRequestHandlerAfterCurrent(
            new TextRequestHandler("application/json", "UTF-8", jsonArray));
View Full Code Here

     * sets the theme for the current user.
     *
     * @param pageParameters current page parameters
     */
    private void configureTheme(PageParameters pageParameters) {
        StringValue theme = pageParameters.get("theme");

        if (!theme.isEmpty()) {
            IBootstrapSettings settings = Bootstrap.getSettings(getApplication());
            settings.getActiveThemeProvider().setActiveTheme(theme.toString(""));
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.string.StringValue

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.