/** * Returns true if the default layout scope is shared. * * @return True if the default layout scope is shared. */ public static boolean defaultIsShared() { return FrameworkUtil.getAttribute(ATTR_DEFAULT_SCOPE) != null; }
/** * Sets the default layout scope. * * @param isShared If true, the default scope is shared. If false, it is private. */ public static void defaultIsShared(boolean isShared) { FrameworkUtil.setAttribute(ATTR_DEFAULT_SCOPE, isShared ? true : null); }
/** * Returns true if the application framework has been initialized. * * @return boolean whether AppFramework has been initialized */ public static boolean isInitialized() { return getAppFramework() != null; }
/** * Retrieves the value of a named attribute from the attribute cache. * * @param key Attribute name * @return Attribute value. * @throws IllegalStateException if AppFramework is not initialized */ public static Object getAttribute(final String key) { assertInitialized(); return getAppFramework().getAttribute(key); }
/** * Returns the application name. * * @return Application name. */ protected String getAppName() { if (appName == null && FrameworkUtil.isInitialized()) { setAppName(FrameworkUtil.getAppName()); } return appName; }
/** * Returns a reference to the attribute map used to store persistent references to arbitrary * objects. * * @return Attribute map */ public static Map<String, Object> getAttributes() { return isInitialized() ? getAppFramework().getAttributes() : null; }
/** * Returns the current patient selector. If one has not already been created, it is created from * the factory. * * @return The patient selector. */ private static IPatientSelector getSelector() { IPatientSelector selector = (IPatientSelector) FrameworkUtil.getAttribute(Constants.SELECTOR_ATTRIB); if (selector == null) { IPatientSelectorFactory factory = getFactory(); selector = factory == null ? null : factory.create(); FrameworkUtil.setAttribute(Constants.SELECTOR_ATTRIB, selector); } return selector; }
/** * Asserts that the application framework has been initialized. */ public static void assertInitialized() { Assert.state(isInitialized(), "AppFramework must be initialized"); }
/** * Returns the application name for this instance of the CareWeb shell. * * @return Application name, or null if not set. */ public static String getApplicationName() { return FrameworkUtil.getAppName(); }
/** * Returns true if drill down icons are enabled. * * @return True if drill down icons are enabled. */ public static boolean showIcons() { Boolean result = (Boolean) FrameworkUtil.getAttribute(Constants.PROPERTY_ID_DRILLDOWN); if (result == null) { try { String value = PropertyUtil.getValue(Constants.PROPERTY_ID_DRILLDOWN); result = BooleanUtils.toBoolean(value); } catch (Exception e) { result = true; } FrameworkUtil.setAttribute(Constants.PROPERTY_ID_DRILLDOWN, result); } return result; }
/** * Stores an arbitrary named attribute in the attribute cache. * * @param key Attribute name. * @param value Attribute value. If null, value is removed from cache. * @throws IllegalStateException if AppFramework is not initialized */ public static void setAttribute(String key, Object value) { assertInitialized(); getAppFramework().setAttribute(key, value); }
/** * Returns a reference to the attribute map used to store persistent references to arbitrary * objects. * * @return Attribute map */ public static Map<String, Object> getAttributes() { return isInitialized() ? getAppFramework().getAttributes() : null; }
/** * Returns the application name. * * @return Application name. */ protected String getAppName() { if (appName == null && FrameworkUtil.isInitialized()) { setAppName(FrameworkUtil.getAppName()); } return appName; }
/** * Asserts that the application framework has been initialized. */ public static void assertInitialized() { Assert.state(isInitialized(), "AppFramework must be initialized"); }
/** * Build the UI based on the specified layout. * * @param layout Layout for building UI. */ public void buildUI(Layout layout) { this.layout = layout; reset(); layout.materialize(desktop); desktop.setAppId(FrameworkUtil.getAppName()); desktop.activate(true); if (autoStart) { start(); } }
/** * Returns true if drill down icons are enabled. * * @return True if drill down icons are enabled. */ public static boolean showIcons() { Boolean result = (Boolean) FrameworkUtil.getAttribute(Constants.PROPERTY_ID_DRILLDOWN); if (result == null) { try { String value = PropertyUtil.getValue(Constants.PROPERTY_ID_DRILLDOWN); result = BooleanUtils.toBoolean(value); } catch (Exception e) { result = true; } FrameworkUtil.setAttribute(Constants.PROPERTY_ID_DRILLDOWN, result); } return result; }
/** * Returns true if the application framework has been initialized. * * @return boolean whether AppFramework has been initialized */ public static boolean isInitialized() { return getAppFramework() != null; }
/** * Retrieves the value of a named attribute from the attribute cache. * * @param key Attribute name * @return Attribute value. * @throws IllegalStateException if AppFramework is not initialized */ public static Object getAttribute(String key) { assertInitialized(); return getAppFramework().getAttribute(key); }
/** * Set the application name into the context. * * @param value Application name. */ public static void setAppName(String value) { setAttribute("applicationName", value); }
/** * Return the application name from the context. * * @return The application name. */ public static String getAppName() { return (String) getAttribute("applicationName"); }