Search in sources :

Example 6 with PackageResourceReference

use of org.apache.wicket.request.resource.PackageResourceReference in project wicket-dashboard by decebals.

the class OpenFlashChart method onInitialize.

@Override
protected void onInitialize() {
    super.onInitialize();
    String swfUrl = toAbsolutePath(urlFor(new PackageResourceReference(OpenFlashChart.class, "res/open-flash-chart.swf"), null).toString());
    // see http://ofc2dz.com/OFC2/downloads/ofc2Downloads.html
    // http://ofc2dz.com/OFC2/examples/MiscellaneousPatches.html (Passing the Char Parameter "ID" when saving images (23-Feb-2009))
    swfUrl = swfUrl.concat("?id=").concat(getMarkupId());
    //		System.out.println("swfUrl = " + swfUrl);
    swf = new SWFObject(swfUrl, width, height, "9.0.0");
    add(swf);
}
Also used : PackageResourceReference(org.apache.wicket.request.resource.PackageResourceReference)

Example 7 with PackageResourceReference

use of org.apache.wicket.request.resource.PackageResourceReference in project midpoint by Evolveum.

the class Accordion method renderHead.

@Override
public void renderHead(IHeaderResponse response) {
    super.renderHead(response);
    response.render(JavaScriptHeaderItem.forReference(new PackageResourceReference(Accordion.class, "Accordion.js")));
    response.render(CssHeaderItem.forReference(new PackageResourceReference(Accordion.class, "Accordion.css")));
    WebMarkupContainer parent = (WebMarkupContainer) get("parent");
    response.render(OnDomReadyHeaderItem.forScript("createAccordion('" + parent.getMarkupId() + "'," + getExpanded() + "," + getMultipleSelect() + "," + getOpenedPanel() + ")"));
}
Also used : PackageResourceReference(org.apache.wicket.request.resource.PackageResourceReference) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 8 with PackageResourceReference

use of org.apache.wicket.request.resource.PackageResourceReference in project midpoint by Evolveum.

the class MidPointApplication method init.

@Override
public void init() {
    super.init();
    getJavaScriptLibrarySettings().setJQueryReference(new PackageResourceReference(MidPointApplication.class, "../../../../../webjars/adminlte/2.3.11/plugins/jQuery/jquery-2.2.3.min.js"));
    GuiComponents.init();
    getComponentInstantiationListeners().add(new SpringComponentInjector(this));
    ResourceSettings resourceSettings = getResourceSettings();
    resourceSettings.setParentFolderPlaceholder("$-$");
    resourceSettings.setHeaderItemComparator(new PriorityFirstComparator(true));
    SecurePackageResourceGuard guard = (SecurePackageResourceGuard) resourceSettings.getPackageResourceGuard();
    guard.addPattern("+*.woff2");
    List<IStringResourceLoader> resourceLoaders = resourceSettings.getStringResourceLoaders();
    resourceLoaders.add(0, new Utf8BundleStringResourceLoader("localization/Midpoint"));
    resourceLoaders.add(1, new Utf8BundleStringResourceLoader(SchemaConstants.SCHEMA_LOCALIZATION_PROPERTIES_RESOURCE_BASE_PATH));
    resourceSettings.setThrowExceptionOnMissingResource(false);
    getMarkupSettings().setStripWicketTags(true);
    if (RuntimeConfigurationType.DEVELOPMENT.equals(getConfigurationType())) {
        getDebugSettings().setAjaxDebugModeEnabled(true);
        getDebugSettings().setDevelopmentUtilitiesEnabled(true);
    }
    //pretty url for resources (e.g. images)
    mountFiles(ImgResources.BASE_PATH, ImgResources.class);
    //exception handling an error pages
    ApplicationSettings appSettings = getApplicationSettings();
    appSettings.setAccessDeniedPage(PageError401.class);
    appSettings.setInternalErrorPage(PageError.class);
    appSettings.setPageExpiredErrorPage(PageError.class);
    mount(new MountedMapper("/error", PageError.class, new PageParametersEncoder()));
    mount(new MountedMapper("/error/401", PageError401.class, new PageParametersEncoder()));
    mount(new MountedMapper("/error/403", PageError403.class, new PageParametersEncoder()));
    mount(new MountedMapper("/error/404", PageError404.class, new PageParametersEncoder()));
    mount(new MountedMapper("/error/410", PageError410.class, new PageParametersEncoder()));
    getRequestCycleListeners().add(new LoggingRequestCycleListener(this));
    //descriptor loader, used for customization
    new DescriptorLoader().loadData(this);
}
Also used : MountedMapper(org.apache.wicket.core.request.mapper.MountedMapper) PriorityFirstComparator(org.apache.wicket.markup.head.PriorityFirstComparator) DescriptorLoader(com.evolveum.midpoint.web.application.DescriptorLoader) ApplicationSettings(org.apache.wicket.settings.ApplicationSettings) SecurePackageResourceGuard(org.apache.wicket.markup.html.SecurePackageResourceGuard) PackageResourceReference(org.apache.wicket.request.resource.PackageResourceReference) ResourceSettings(org.apache.wicket.settings.ResourceSettings) IStringResourceLoader(org.apache.wicket.resource.loader.IStringResourceLoader) Utf8BundleStringResourceLoader(com.evolveum.midpoint.web.util.Utf8BundleStringResourceLoader) PageParametersEncoder(org.apache.wicket.request.mapper.parameter.PageParametersEncoder) SpringComponentInjector(org.apache.wicket.spring.injection.annot.SpringComponentInjector)

Aggregations

PackageResourceReference (org.apache.wicket.request.resource.PackageResourceReference)8 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)3 ImgResources (com.evolveum.midpoint.web.resource.img.ImgResources)3 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)3 PrismObjectPanel (com.evolveum.midpoint.web.component.prism.PrismObjectPanel)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 ObjectBrowserPanel (com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 DescriptorLoader (com.evolveum.midpoint.web.application.DescriptorLoader)1 ConfirmationPanel (com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)1 InlineMenu (com.evolveum.midpoint.web.component.menu.cog.InlineMenu)1 ObjectWrapper (com.evolveum.midpoint.web.component.prism.ObjectWrapper)1 FocusSubwrapperDto (com.evolveum.midpoint.web.page.admin.users.dto.FocusSubwrapperDto)1 Utf8BundleStringResourceLoader (com.evolveum.midpoint.web.util.Utf8BundleStringResourceLoader)1 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)1 Serializable (java.io.Serializable)1 AttributeModifier (org.apache.wicket.AttributeModifier)1 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)1