/** * Associates help context with a component. * * @param component The component. * @param context The help context. */ public static void associateCSH(BaseUIComponent component, HelpContext context) { HelpUtil.associateCSH(component, context, getShell()); }
/** * Event handler for logout link */ public void onClick$logout() { CareWebUtil.getShell().logout(); }
/** * Event handler for lock link */ public void onClick$lock() { CareWebUtil.getShell().lock(); }
/** * Sets the active instance of the CareWeb shell. An exception is raised if an active instance * has already been set. * * @param shell Shell to become the active instance. */ protected static void setShell(CareWebShell shell) { if (getShell() != null) { throw new RuntimeException("A CareWeb shell instance has already been registered."); } ExecutionContext.getPage().setAttribute(Constants.SHELL_INSTANCE, shell); }
/** * Sends an informational message for display by desktop. * * @param message Text of the message. * @param caption Optional caption text. */ public static void showMessage(String message, String caption) { getShell().getMessageWindow().showMessage(message, caption); }
/** * Shows table of contents in help viewer. */ public static void showHelpTOC() { getShell().getHelpViewer(); HelpUtil.showTOC(); }
/** * Associates help context with a component. * * @param component The component. * @param module The help module identifier. * @param topic The topic id. * @param label The topic label. */ public static void associateCSH(BaseUIComponent component, String module, String topic, String label) { HelpContext context = new HelpContext(module, topic, label); HelpUtil.associateCSH(component, context, getShell()); }
/** * Shows help topic in help viewer. * * @param module The id of the help module. * @param topic The id of the desired topic. * @param label The label to display for the topic. */ public static void showHelpTopic(String module, String topic, String label) { getShell().getHelpViewer(); HelpUtil.show(module, topic, label); }
/** * Event handler for logout link */ @EventHandler(value = "click", target = "logout") private void onClick$logout() { CareWebUtil.getShell().logout(); }
/** * Event handler for lock link */ @EventHandler(value = "click", target = "lock") private void onClick$lock() { CareWebUtil.getShell().lock(); }
/** * Process all associated resources. * * @param register If true, resources will be registered; if false, unregistered. */ private void processResources(boolean register) { CareWebShell shell = CareWebUtil.getShell(); for (IPluginResource resource : getDefinition().getResources()) { resource.register(shell, this, register); } }
/** * Sets the container as the wrapped component and registers itself to receive action * notifications from the container. */ public ElementPlugin() { super(); shell = CareWebUtil.getShell(); setOuterComponent(container); setMaskMode(MaskMode.ENABLE); container.addClass("cwf-plugin-container"); fullSize(container); container.wireController(this); }
@Override public boolean execute() { CareWebShell shell = CareWebUtil.getShell(); CommandUtil.associateCommand("PATIENT_SELECT", shell, PATIENT_SELECT); // call the patient selection routine at login, if the user preference is set if (PatientContext.getActivePatient() == null && PatientSelection.forcePatientSelection()) { shell.addEventListener(FORCE_SELECT_EVENT, forceSelectionListener); EventUtil.post(FORCE_SELECT_EVENT, shell, null); } return true; }
/** * If event data is of the format [session id]^[requester], this is an invitation * request. If event data is of the format [session id], it is a cancellation of a * previous request. */ @Override public void eventCallback(String eventName, String eventData) { String[] pcs = eventData.split("\\^", 2); String tag = EVENT_INVITE + "_" + pcs[0]; CareWebShell shell = CareWebUtil.getShell(); if (pcs.length == 2) { String message = StrUtil.formatMessage("@cwf.chat.invitation.message", pcs[1]); String caption = StrUtil.formatMessage("@cwf.chat.invitation.caption"); shell.getMessageWindow().showMessage(message, caption, null, 999999, tag, (event) -> { eventManager.fireLocalEvent(EVENT_ACCEPT, pcs[0]); }); } else { shell.getMessageWindow().clearMessages(tag); } } };