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:com.aplombee.QuickViewBase.java

License:Apache License

@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    response.render(JavaScriptHeaderItem.forReference(RepeaterUtilReference.get()));
    /**//from  ww w  .ja  v a 2 s .c om
     * jquery reference added,it's not important as wicket itself uses jquery in ajax use case but still added to be safe
     */
    response.render(JavaScriptHeaderItem
            .forReference(Application.get().getJavaScriptLibrarySettings().getJQueryReference()));
}

From source file:com.aplombee.RepeaterUtil.java

License:Apache License

public static RepeaterUtil get() {
    Application app = Application.get();
    RepeaterUtil util = app.getMetaData(REPEATER_UTIL_KEY);
    if (util != null) {
        return util;
    }//from w w w .  ja va 2  s  .  c o m
    util = new RepeaterUtil(app); //this registers too
    return util;
}

From source file:com.blogspot.chicchiricco.c3wicketdemo.DemoWebapp.java

License:Apache License

public static DemoWebapp get() {
    return (DemoWebapp) Application.get();
}

From source file:com.comcast.cdn.traffic_control.traffic_monitor.MonitorApplication.java

License:Apache License

public static MonitorApplication get() {
    return (MonitorApplication) Application.get();
}

From source file:com.doculibre.constellio.wicket.application.ConstellioApplication.java

License:Open Source License

public static ConstellioApplication get() {
    return (ConstellioApplication) Application.get();
}

From source file:com.ecom.web.components.gmap.GMap2.java

License:Apache License

/**
 * @see org.apache.wicket.Component#onBeforeRender()
 *///from   w w  w.  jav  a2s .c o m
@Override
protected void onBeforeRender() {

    RuntimeConfigurationType configurationType = Application.get().getConfigurationType();
    if (configurationType.equals(RuntimeConfigurationType.DEVELOPMENT)
            && !Application.get().getMarkupSettings().getStripWicketTags()) {
        log.warn("Application is in DEVELOPMENT mode && Wicket tags are not stripped,"
                + " Firefox 3.0 will not render the GMap."
                + " Change to DEPLOYMENT mode  || turn on Wicket tags stripping." + " See:"
                + " http://www.nabble.com/Gmap2-problem-with-Firefox-3.0-to18137475.html.");
    }
    super.onBeforeRender();
}

From source file:com.evolveum.midpoint.web.component.util.LookupPropertyModel.java

License:Apache License

@Override
public void setObject(T object) {
    final String expression = propertyExpression();

    PropertyResolverConverter prc;/*from  w  w w .ja va2 s.  c  o  m*/
    prc = new PropertyResolverConverter(Application.get().getConverterLocator(), Session.get().getLocale());

    if (object instanceof String) {
        String label = (String) object;
        String key;

        for (LookupTableRowType row : lookupTable.getRow()) {
            if (label.equals(WebMiscUtil.getOrigStringFromPoly(row.getLabel()))) {
                key = row.getKey();

                PropertyResolver.setValue(expression, getInnermostModelOrObject(), key, prc);
            }
        }
    }
}

From source file:com.evolveum.midpoint.web.model.LookupPropertyModel.java

License:Apache License

@Override
public void setObject(T object) {
    final String expression = propertyExpression();

    PropertyResolverConverter prc;//from   w  ww .j a  va 2 s . c o m
    prc = new PropertyResolverConverter(Application.get().getConverterLocator(), Session.get().getLocale());

    if (object instanceof String) {
        String label = (String) object;
        String key;

        if (StringUtils.isBlank(label)) {
            PropertyResolver.setValue(expression, getInnermostModelOrObject(), null, prc);
        } else {
            if (!isStrict || lookupTable == null) { // set default value from input and overwrite later if key is found
                PropertyResolver.setValue(expression, getInnermostModelOrObject(), label, prc);
            }
            if (lookupTable != null) {
                for (LookupTableRowType row : lookupTable.getRow()) {
                    if (label.equals(WebComponentUtil.getOrigStringFromPoly(row.getLabel()))) {
                        key = row.getKey();
                        PropertyResolver.setValue(expression, getInnermostModelOrObject(), key, prc);
                    }
                }
            }
        }
    } else if (object == null) {
        PropertyResolver.setValue(expression, getInnermostModelOrObject(), object, prc);
    }
}

From source file:com.evolveum.midpoint.web.page.admin.certification.dto.CertDefinitionDto.java

License:Apache License

public String getXml() {
    try {//from  w  w  w .j a  v a2s .  c o m
        PrismContext prismContext = ((MidPointApplication) Application.get()).getPrismContext();
        return prismContext.serializeObjectToString(getUpdatedDefinition(prismContext).asPrismObject(),
                PrismContext.LANG_XML);
    } catch (SchemaException | RuntimeException e) {
        return "Couldn't serialize campaign definition to XML: " + e.getMessage();
    }

}

From source file:com.evolveum.midpoint.web.page.admin.server.dto.TaskDto.java

License:Apache License

public String getObjectQuery() {
    QueryType queryType = getExtensionPropertyRealValue(SchemaConstants.MODEL_EXTENSION_OBJECT_QUERY,
            QueryType.class);
    PrismContext prismContext = ((MidPointApplication) Application.get()).getPrismContext();
    try {/*  w  ww . java  2  s .  c o m*/
        return prismContext.serializeAnyData(queryType, SchemaConstants.MODEL_EXTENSION_OBJECT_QUERY,
                PrismContext.LANG_XML);
    } catch (SchemaException e) {
        throw new SystemException("Couldn't serialize query: " + e.getMessage(), e);
    }
}