Example usage for org.apache.wicket Application get

List of usage examples for org.apache.wicket Application get

Introduction

In this page you can find the example usage for org.apache.wicket Application get.

Prototype

public static Application get() 

Source Link

Document

Get Application for current thread.

Usage

From source file:org.cdlflex.ui.pages.examples.StripTagExamplePage.java

License:Apache License

@Override
protected void onBeforeRender() {
    super.onBeforeRender();
    Application.get().getMarkupSettings().setStripWicketTags(true);
}

From source file:org.cdlflex.ui.pages.examples.StripTagExamplePage.java

License:Apache License

@Override
protected void onAfterRender() {
    super.onAfterRender();
    Application.get().getMarkupSettings().setStripWicketTags(stripTags);
}

From source file:org.cipango.ims.oam.util.ClassResolver.java

License:Apache License

/**
 * /*from w  w w .  j  av a 2s . c o  m*/
 * @see org.apache.wicket.application.IClassResolver#getResources(java.lang.String)
 */
public Iterator<URL> getResources(String name) {
    HashSet<URL> loadedFiles = new HashSet<URL>();
    try {
        // Try the classloader for the wicket jar/bundle
        Enumeration<URL> resources = Application.class.getClassLoader().getResources(name);
        loadResources(resources, loadedFiles);

        // Try the classloader for the user's application jar/bundle
        resources = Application.get().getClass().getClassLoader().getResources(name);
        loadResources(resources, loadedFiles);

        // Try the context class loader
        resources = Thread.currentThread().getContextClassLoader().getResources(name);
        loadResources(resources, loadedFiles);
    } catch (IOException e) {
        throw new WicketRuntimeException(e);
    }

    return loadedFiles.iterator();
}

From source file:org.dcm4chee.dashboard.war.common.InternalErrorPage.java

License:LGPL

@Override
protected void onBeforeRender() {
    super.onBeforeRender();

    add(new Label("exception-message",
            new ResourceModel("application.internal_error.throwable").wrapOnAssignment(this).getObject()
                    + (this.throwable == null ? "" : throwable.getLocalizedMessage())));
    add(new Label("exception-page",
            new ResourceModel("application.internal_error.page").wrapOnAssignment(this).getObject()
                    + (this.page == null ? "" : Page.class.toString())));
    add(new Link<Object>("back-to-main") {

        private static final long serialVersionUID = 1L;

        @Override//from w w  w .  j av  a2  s.com
        public void onClick() {
            setResponsePage(Application.get().getHomePage());
        }
    });
}

From source file:org.dcm4chee.web.common.base.AccessDeniedPage.java

License:LGPL

public AccessDeniedPage() {
    super();//  w  ww.j av a2s .c o m
    add(new Link<Object>("home") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(Application.get().getHomePage());
        }
    }.add(new Label("homeLabel", new ResourceModel("application.home"))));
}

From source file:org.dcm4chee.web.common.base.BaseWicketPage.java

License:LGPL

protected String getBrowserTitle() {
    Class<?> clazz = Application.get().getHomePage();
    String s = new ClassStringResourceLoader(clazz).loadStringResource(null, "application.browser_title");
    if (s == null) {
        s = new PackageStringResourceLoader().loadStringResource(clazz, "application.browser_title",
                getSession().getLocale(), null);
    }//w  w  w  . j a  v  a 2  s . co  m
    return s == null ? "DCM4CHEE" : s;
}

From source file:org.dcm4chee.web.common.base.PageExpiredErrorPage.java

License:LGPL

public PageExpiredErrorPage() {
    super();//from  www .  j a  v a  2  s. co m
    this.getModuleSelectorPanel().setShowLogoutLink(false);
    add(new Link<Object>("login") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(Application.get().getHomePage());
        }
    }.add(new Label("loginLabel", new ResourceModel("application.homeLogin"))));
}

From source file:org.dcm4chee.web.common.behaviours.TooltipBehaviour.java

License:LGPL

public Localizer getLocalizer() {
    if (localizer == null)
        localizer = Application.get().getResourceSettings().getLocalizer();
    return localizer;
}

From source file:org.dcm4chee.web.common.delegate.BaseCfgDelegate.java

License:LGPL

protected void init() {
    log.info("Init " + getClass().getName());
    List<?> servers = MBeanServerFactory.findMBeanServer(null);
    if (servers != null && !servers.isEmpty()) {
        server = (MBeanServerConnection) servers.get(0);
        log.debug("Found MBeanServer:" + server);
    } else {//w ww  . j a va  2s .c  om
        log.error("Failed to get MBeanServerConnection! MbeanDelegate class:" + getClass().getName());
        return;
    }
    String s = ((WebApplication) Application.get()).getInitParameter("WebCfgServiceName");
    if (s == null)
        s = "dcm4chee.web:service=WebConfig";
    try {
        serviceObjectName = new ObjectName(s);
        log.info(getClass().getName() + " initialized! WebConfig serviceName: " + serviceObjectName);
    } catch (Exception e) {
        log.error("Failed to set ObjectName for " + getClass().getName() + "! name:" + s, e);
    }
}

From source file:org.dcm4chee.web.common.login.LoginPage.java

License:LGPL

protected String getBrowserTitle() {

    Class<?> clazz = Application.get().getHomePage();
    String s = new ClassStringResourceLoader(clazz).loadStringResource(null, "application.browser_title");
    if (s == null)
        s = new PackageStringResourceLoader().loadStringResource(clazz, "application.browser_title",
                getSession().getLocale(), null);
    return (s == null ? "DCM4CHEE" : s) + ": " + this.getString("application.login", null, "Login");
}