Package org.apache.wicket

Examples of org.apache.wicket.WicketRuntimeException


            IFormSubmittingComponent submittingComponent = (IFormSubmittingComponent) submitter;
            Component component = (Component) submitter;

            if (!component.isVisibleInHierarchy())
            {
              throw new WicketRuntimeException("Submit Button " +
                submittingComponent.getInputName() + " (path=" +
                component.getPageRelativePath() + ") is not visible");
            }

            if (!component.isEnabledInHierarchy())
            {
              throw new WicketRuntimeException("Submit Button " +
                submittingComponent.getInputName() + " (path=" +
                component.getPageRelativePath() + ") is not enabled");
            }
          }
        }
View Full Code Here


          {
            url = url + "#" + anchor.getMarkupId();
          }
          else
          {
            throw new WicketRuntimeException("an achor component was set on " + this +
              " but it neither has outputMarkupId set to true " +
              "nor has a id set explicitly");
          }
        }
      }
View Full Code Here

    IChoiceRenderer<T> renderer = getPalette().getChoiceRenderer();
    StringBuilder modelStringBuffer = new StringBuilder();
    Collection<T> modelCollection = getPalette().getModelCollection();
    if (modelCollection == null)
    {
      throw new WicketRuntimeException(
        "Expected getPalette().getModelCollection() to return a non-null value."
          + " Please make sure you have model object assigned to the palette");
    }
    Iterator<T> selection = modelCollection.iterator();
View Full Code Here

      return;
    }

    if (!supportsMultiple && (values.length > 1))
    {
      throw new WicketRuntimeException(
        "The model of Select component [" +
          getPath() +
          "] is not of type java.util.Collection, but more then one SelectOption component has been selected. Either remove the multiple attribute from the select tag or make the model of the Select component a collection");
    }

    List<Object> converted = new ArrayList<>(values.length);

    /*
     * if the input is null we do not need to do anything since the model collection has already
     * been cleared
     */
    for (int i = 0; i < values.length; i++)
    {
      final String value = values[i];
      if (!Strings.isEmpty(value))
      {
        SelectOption<T> option = visitChildren(SelectOption.class,
          new IVisitor<SelectOption<T>, SelectOption<T>>()
          {
            @Override
            public void component(SelectOption<T> option, IVisit<SelectOption<T>> visit)
            {
              if (String.valueOf(option.getValue()).equals(value))
              {
                visit.stop(option);
              }
            }
          });

        if (option == null)
        {
          throw new WicketRuntimeException(
            "submitted http post value [" +
              Arrays.toString(values) +
              "] for SelectOption component [" +
              getPath() +
              "] contains an illegal value [" +
View Full Code Here

      CharSequence url = renderUrl(mappedUrl, handler);
      return url;
    }
    catch (Exception x)
    {
      throw new WicketRuntimeException(String.format(
        "An error occurred while generating an Url for handler '%s'", handler), x);
    }

  }
View Full Code Here

    application = Application.get();

    markupCache = newCacheImplementation();
    if (markupCache == null)
    {
      throw new WicketRuntimeException("The map used to cache markup must not be null");
    }

    markupKeyCache = newCacheImplementation();
  }
View Full Code Here

      start(pollFrequency);

    } catch (IOException iox)
    {
      throw new WicketRuntimeException("Cannot get the watch service", iox);
    }
  }
View Full Code Here

  public static void setValue(final String expression, final Object object,
    final Object value, final PropertyResolverConverter converter)
  {
    if (Strings.isEmpty(expression))
    {
      throw new WicketRuntimeException("Empty expression setting value: " + value +
        " on object: " + object);
    }
    if (object == null)
    {
      throw new WicketRuntimeException(
        "Attempted to set property value on a null object. Property expression: " +
          expression + " Value: " + value);
    }

    ObjectAndGetSetter setter = getObjectAndGetSetter(expression, object, CREATE_NEW_VALUE);
    if (setter == null)
    {
      throw new WicketRuntimeException("Null object returned for expression: " + expression +
        " for setting value: " + value + " on: " + object);
    }
    setter.setValue(value, converter == null ? new PropertyResolverConverter(Application.get()
      .getConverterLocator(), Session.get().getLocale()) : converter);
  }
View Full Code Here

  public static Class<?> getPropertyClass(final String expression, final Object object)
  {
    ObjectAndGetSetter setter = getObjectAndGetSetter(expression, object, RESOLVE_CLASS);
    if (setter == null)
    {
      throw new WicketRuntimeException("Null object returned for expression: " + expression +
        " for getting the target class of: " + object);
    }
    return setter.getTargetClass();
  }
View Full Code Here

  public static <T> Class<T> getPropertyClass(final String expression, final Class<?> clz)
  {
    ObjectAndGetSetter setter = getObjectAndGetSetter(expression, null, RESOLVE_CLASS, clz);
    if (setter == null)
    {
      throw new WicketRuntimeException("No Class returned for expression: " + expression +
        " for getting the target class of: " + clz);
    }
    return (Class<T>)setter.getTargetClass();
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.WicketRuntimeException

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.