Search in sources :

Example 1 with ProfileContainer

use of com.github.bordertech.wcomponents.monitor.ProfileContainer in project wcomponents by BorderTech.

the class PlainLauncher method getUI.

/**
 * This method has been overridden to load a WComponent from parameters.
 *
 * @param httpServletRequest the servlet request being handled.
 * @return the top-level WComponent for this servlet.
 */
@Override
public synchronized WComponent getUI(final Object httpServletRequest) {
    String configuredUIClassName = getComponentToLaunchClassName();
    if (sharedUI == null || !Util.equals(configuredUIClassName, uiClassName)) {
        uiClassName = configuredUIClassName;
        WComponent ui = createUI();
        if (ui instanceof WApplication) {
            sharedUI = (WApplication) ui;
        } else {
            LOG.warn("Top-level component should be a WApplication." + " Creating WApplication wrapper...");
            sharedUI = new WApplication();
            ui.setLocked(false);
            sharedUI.add(ui);
            sharedUI.setLocked(true);
        }
        if (ConfigurationProperties.getLdeServerShowMemoryProfile()) {
            ProfileContainer profiler = new ProfileContainer();
            sharedUI.setLocked(false);
            sharedUI.add(profiler);
            sharedUI.setLocked(true);
        }
    }
    return sharedUI;
}
Also used : WComponent(com.github.bordertech.wcomponents.WComponent) WApplication(com.github.bordertech.wcomponents.WApplication) ProfileContainer(com.github.bordertech.wcomponents.monitor.ProfileContainer)

Aggregations

WApplication (com.github.bordertech.wcomponents.WApplication)1 WComponent (com.github.bordertech.wcomponents.WComponent)1 ProfileContainer (com.github.bordertech.wcomponents.monitor.ProfileContainer)1