Package org.apache.wicket

Examples of org.apache.wicket.Application


  private void load() {
    if (buffer.length() == 0)
    {
      String path = Packages.absolutePath(scope, fileName);

      Application app = Application.get();

      // first try default class loading locator to find the resource
      IResourceStream stream = app.getResourceSettings()
        .getResourceStreamLocator()
        .locate(scope, path, getStyle(), getVariation(), getLocale(), null, false);

      if (stream == null)
      {
View Full Code Here


      {
        // ignore this exception.
        log.debug("Class not found by using objects own classloader, trying the IClassResolver");
      }

      Application application = Application.get();
      ApplicationSettings applicationSettings = application.getApplicationSettings();
      IClassResolver classResolver = applicationSettings.getClassResolver();

      Class<?> candidate = null;
      try
      {
View Full Code Here

   * Covariant override for easy getting the current {@link WebApplication} without having to cast
   * it.
   */
  public static WebApplication get()
  {
    Application application = Application.get();

    if (application instanceof WebApplication == false)
    {
      throw new WicketRuntimeException(
        "The application attached to the current thread is not a " +
View Full Code Here

  {
    super(contentType);

    String path = Packages.absolutePath(clazz, fileName);

    Application app = Application.get();

    // first try default class loading locator to find the resource
    IResourceStream stream = app.getResourceSettings()
      .getResourceStreamLocator()
      .locate(clazz, path);

    if (stream == null)
    {
View Full Code Here

   * Covariant override for easy getting the current {@link WebApplication} without having to cast
   * it.
   */
  public static WebApplication get()
  {
    Application application = Application.get();

    if (application instanceof WebApplication == false)
    {
      throw new WicketRuntimeException(
        "The application attached to the current thread is not a " +
View Full Code Here

    ThreadContext old = ThreadContext.get(false);
    final ByteArrayInputStream in = new ByteArrayInputStream(data);
    ObjectInputStream ois = null;
    try
    {
      Application oldApplication = ThreadContext.getApplication();
      try
      {
        ois = newObjectInputStream(in);
        String applicationName = (String)ois.readObject();
        if (applicationName != null)
        {
          Application app = Application.get(applicationName);
          if (app != null)
          {
            ThreadContext.setApplication(app);
          }
        }
View Full Code Here

      try
      {
        // Can the application always be taken??
        // Should be if serialization happened in thread with application set
        // (WICKET-2195)
        Application application = Application.get();
        IApplicationSettings applicationSettings = application.getApplicationSettings();
        IClassResolver classResolver = applicationSettings.getClassResolver();

        candidate = classResolver.resolveClass(className);
        if (candidate == null)
        {
View Full Code Here

    super.onBeforeRender();

    // Set default for before/after link text
    if (beforeDisabledLink == null)
    {
      final Application app = getApplication();
      beforeDisabledLink = app.getMarkupSettings().getDefaultBeforeDisabledLink();
      afterDisabledLink = app.getMarkupSettings().getDefaultAfterDisabledLink();
    }
  }
View Full Code Here

    if (valueParser.matches())
    {
      final String imageReferenceName = valueParser.getImageReferenceName();
      final String specification = Strings.replaceHtmlEscapeNumber(valueParser.getSpecification());
      final String factoryName = valueParser.getFactoryName();
      final Application application = component.getApplication();

      // Do we have a reference?
      if (!Strings.isEmpty(imageReferenceName))
      {
        // Is resource already available via the application?
        if (application.getResourceReferenceRegistry().getResourceReference(
          Application.class, imageReferenceName, locale, style, variation, true, false) == null)
        {
          // Resource not available yet, so create it with factory and
          // share via Application
          final IResource imageResource = getResourceFactory(application, factoryName).newResource(
            specification, locale, style, variation);

          ResourceReference ref = new SimpleStaticResourceReference(Application.class,
            imageReferenceName, locale, style, variation, imageResource);

          application.getResourceReferenceRegistry().registerResourceReference(ref);
        }

        // Create resource reference
        resourceReference = new PackageResourceReference(Application.class,
          imageReferenceName, locale, style, variation);
View Full Code Here

      {
        ois = objectStreamFactory.newObjectInputStream(in);
        String applicationName = (String)ois.readObject();
        if (applicationName != null && !Application.exists())
        {
          Application app = Application.get(applicationName);
          if (app != null)
          {
            ThreadContext.setApplication(app);
          }
        }
View Full Code Here

TOP

Related Classes of org.apache.wicket.Application

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.