Tabnine Logo
CareWebShell
Code IndexAdd Tabnine to your IDE (free)

How to use
CareWebShell
in
org.carewebframework.shell

Best Java code snippets using org.carewebframework.shell.CareWebShell (Showing top 14 results out of 315)

origin: org.carewebframework/org.carewebframework.shell

/**
 * Performs logout.
 */
@EventHandler(value = "click", target = "mnuLogout")
private void onClick$mnuLogout() {
  shell.logout();
}

origin: org.carewebframework/org.carewebframework.shell

/**
 * Locates a loaded plugin with the specified id.
 *
 * @param id Id of plugin to locate.
 * @param forceInit If true the plugin will be initialized if not already so.
 * @return A reference to the loaded and fully initialized plugin, or null if not found.
 */
public ElementPlugin getLoadedPlugin(String id, boolean forceInit) {
  ElementPlugin plugin = getLoadedPlugin(id);
  
  if (plugin != null && forceInit) {
    plugin.load();
  }
  
  return plugin;
}

origin: org.carewebframework/org.carewebframework.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);
}
origin: org.carewebframework/org.carewebframework.shell

@Override
protected void onAttach(Page page) {
  try {
    CommandUtil.associateCommand("help", this);
    getPage().addChild(messageWindow = new MessageWindow());
    addChild(registeredStyles);
    desktop = new ElementDesktop(this);
    setLogoutConfirm(logoutConfirm);
    String confirmClose = getAppProperty("confirmClose", "CAREWEB.CONFIRM.CLOSE");
    
    if (StringUtils.isEmpty(confirmClose) || BooleanUtils.toBoolean(confirmClose)) {
      ClientUtil.canClose(false);
    }
    
    String layout = defaultLayoutName != null ? defaultLayoutName
        : getAppProperty("layout", "CAREWEB.LAYOUT.DEFAULT");
    
    if (!StringUtils.isEmpty(layout)) {
      loadLayout(layout);
    }
    
  } catch (Exception e) {
    log.error("Error initializing the shell.", e);
    throw MiscUtil.toUnchecked(e);
  }
}

origin: org.carewebframework/org.carewebframework.ui.statuspanel

@Test
public void test() throws Exception {
  CareWebShell shell = new CareWebShell();
  shell.setLayout("/StatusPanelTest.xml");
  shell.setPage(mockEnvironment.getDesktop().getFirstPage());
  shell.afterCompose();
  mockEnvironment.flushEvents();
  PluginContainer plugin = shell.getActivatedPlugin("statusPanel");
  Component root = plugin.getFirstChild();
  StatusPanel controller = (StatusPanel) FrameworkController.getController(root);
  assertNotNull("Controller must not be null.", controller);
  assertEquals(1, root.getChildren().size());
  test(root, "STATUS", 1, 1);
  test(root, "STATUS.TEST1", 1, 3);
  test(root, "STATUS.TEST1", 2, 3);
  test(root, "STATUS.TEST2", 1, 5);
  test(root, "STATUS.TEST2", 2, 5);
}

origin: org.carewebframework/org.carewebframework.plugin.statuspanel

@Test
public void test() throws Exception {
  CareWebShell shell = new CareWebShell();
  shell.setParent(getMockEnvironment().getSession().getPage());
  shell.setLayout("/StatusPanelTest.xml");
  getMockEnvironment().flushEvents();
  ElementPlugin plugin = shell.getActivatedPlugin("cwfStatusPanel");
  BaseComponent root = plugin.getOuterComponent().getFirstChild();
  StatusPanel controller = (StatusPanel) FrameworkController.getController(root);
  assertNotNull("Controller must not be null.", controller);
  assertEquals(1, root.getChildren().size());
  test(root, "STATUS", 1, 1);
  test(root, "STATUS.TEST1", 1, 2);
  test(root, "STATUS.TEST1", 2, 2);
  test(root, "STATUS.TEST2", 1, 3);
  test(root, "STATUS.TEST2", 2, 3);
}

origin: org.carewebframework/org.carewebframework.shell

@Test
public void parserTest() throws Exception {
  shell = new CareWebShell();
  shell.setParent(getMockEnvironment().getSession().getPage());
  parserTestFile("layout-v3.xml", false);
  parserTestFile("layout-v4.xml", true);
}

origin: org.carewebframework/org.carewebframework.shell

ElementBase ele = def.createElement(null, null, false);
assertTrue(ele instanceof ElementTreeView);
ElementDesktop root = shell.getDesktop();
root.removeChildren();
layout.materialize(root);
testNode(0, ElementTreePane.class);
testProperty("label", "Pane 2");
ElementPlugin plugin1 = shell.getLoadedPlugin("testplugin1");
assertNotNull(plugin1);
assertEquals(hasTrigger ? 1 : 0, plugin1.getTriggers().size());
origin: org.carewebframework/org.carewebframework.ui.userheader

/**
 * Event handler for lock link
 */
public void onClick$lock() {
  CareWebUtil.getShell().lock();
}

origin: org.carewebframework/org.carewebframework.shell

public ElementDesktop(CareWebShell shell) throws Exception {
  super();
  this.shell = shell;
  desktopOuter = createFromTemplate();
  setOuterComponent(desktopOuter);
  setInnerComponent(desktopInner);
  menubar = new ElementMenubar(menubar1);
  toolbar = new ElementToolbar(toolbar1);
  ActionUtil.addAction(mnuAbout, "groovy:org.carewebframework.shell.CareWebUtil.about();");
  ActionUtil.addAction(mnuTOC, "groovy:org.carewebframework.shell.CareWebUtil.showHelpTOC();");
  fixedHelpItems = helpMenu.getChildCount();
  sortHelpMenu = false;
  helpMenu.addEventListener("open", (event) -> {
    if (sortHelpMenu) {
      sortHelpMenu();
    }
  });
  if (SecurityUtil.isGrantedAny(DesignConstants.DESIGN_MODE_PRIVS)) {
    DesignMenu.create(this, menubar0);
  }
  addChild(menubar);
  addChild(toolbar);
  setTitle(getTitle());
  shell.addChild(desktopOuter);
}
origin: org.carewebframework/org.carewebframework.plugin.userheader

/**
 * Event handler for lock link
 */
@EventHandler(value = "click", target = "lock")
private void onClick$lock() {
  CareWebUtil.getShell().lock();
}
origin: org.carewebframework/org.carewebframework.ui.userheader

/**
 * Event handler for logout link
 */
public void onClick$logout() {
  CareWebUtil.getShell().logout();
}

origin: org.carewebframework/org.carewebframework.plugin.chat

  /**
   * 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);
    }
  }
};
origin: org.carewebframework/org.carewebframework.plugin.userheader

/**
 * Event handler for logout link
 */
@EventHandler(value = "click", target = "logout")
private void onClick$logout() {
  CareWebUtil.getShell().logout();
}
org.carewebframework.shellCareWebShell

Javadoc

Implements a generic UI shell that can be dynamically extended with plug-ins.

Most used methods

  • <init>
    Create the shell instance.
  • logout
    Logout user after confirmation prompt.
  • getActivatedPlugin
  • getLoadedPlugin
    Locates a loaded plugin with the specified id.
  • getMessageWindow
    Returns the message window instance for managing slide-down messages.
  • lock
    Lock the desktop.
  • setLayout
    Sets the layout to be loaded. If null, the layout specified by the configuration will be loaded.
  • setParent
  • addChild
  • addEventListener
  • addMenu
    Adds a menu.
  • addToolbarComponent
    Adds a component to the common tool bar.
  • addMenu,
  • addToolbarComponent,
  • afterCompose,
  • buildUI,
  • findStyleSheet,
  • getActivatedPlugins,
  • getAppProperty,
  • getApplicationName,
  • getDesktop,
  • getHelpViewer

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now