@Override
 protected void execRowsSelected(List<? extends ITableRow> rows) throws ProcessingException {
   if (CollectionUtility.hasElements(rows)) {
     IOutline outline = getOutlineColumn().getValue(CollectionUtility.firstElement(rows));
     MobileDesktopUtility.activateOutline(outline);
     getDesktop().removeForm(MobileHomeForm.this);
     clearSelectionDelayed();
   }
 }
Ejemplo n.º 2
0
 /** Performs a set of sanity checks to make sure the keystroke is valid. */
 private void performSanityChecks(String keystroke, List<String> components) {
   if (components.size() > 1
       && keystroke.endsWith("-")
       && !"-".equals(CollectionUtility.lastElement(components))) {
     m_isValid = false;
   }
 }
Ejemplo n.º 3
0
 /**
  * Clears the cache for a set of userIds and sends a notification for these users.
  *
  * @param userIds derived from the Subject, see{@link
  *     IAccessControlService#getUserIdOfCurrentSubject()}
  */
 public void clearCacheOfUserIds(Collection<String> userIds0) {
   Set<String> userIds = CollectionUtility.hashSetWithoutNullElements(userIds0);
   if (userIds.isEmpty()) {
     return;
   }
   synchronized (m_storeLock) {
     for (String userId : userIds) {
       if (userId != null) {
         m_store.remove(userId.toLowerCase());
       }
     }
   }
 }
Ejemplo n.º 4
0
 /**
  * Parses the key of the list of components. The key is the last element of the components but
  * can't be a modifier.
  */
 private void parseKey(List<String> components) {
   String key = CollectionUtility.lastElement(components);
   if (isModifier(key)) {
     m_isValid = false;
   } else {
     m_key = key;
     m_normalizedKeyStroke =
         (m_shift ? "shift-" : "")
             + (m_ctrl ? "control-" : "")
             + (m_alt ? "alternate-" : "")
             + m_key;
   }
 }
Ejemplo n.º 5
0
 public Collection<String> getUserIds() {
   synchronized (m_storeLock) {
     return CollectionUtility.hashSet(m_store.keySet());
   }
 }
Ejemplo n.º 6
0
 private List<String> getComponents(String keyStroke) {
   String[] components = keyStroke.trim().split("\\b-|-\\b");
   return CollectionUtility.arrayList(components);
 }
Ejemplo n.º 7
0
 public Map<String, String> getAttributes() {
   return CollectionUtility.copyMap(m_attributeMap);
 }
 @Override
 protected Set<? extends IMenuType> getConfiguredMenuTypes() {
   return CollectionUtility.<IMenuType>hashSet(
       TableMenuType.MultiSelection, TableMenuType.SingleSelection);
 }
 @Override
 protected Set<? extends IMenuType> getConfiguredMenuTypes() {
   return CollectionUtility.<IMenuType>hashSet(
       TableMenuType.EmptySpace, TableMenuType.Header, TableMenuType.SingleSelection);
 }
Ejemplo n.º 10
0
 @Override
 public List<IButton> getSystemProcessButtons() {
   ensureCategorized();
   return CollectionUtility.arrayList(m_systemButtons);
 }
Ejemplo n.º 11
0
 @Override
 public List<IFormField> getControlFields() {
   ensureCategorized();
   return CollectionUtility.arrayList(m_controlFields);
 }
Ejemplo n.º 12
0
 @Override
 public List<IGroupBox> getGroupBoxes() {
   ensureCategorized();
   return CollectionUtility.arrayList(m_groupBoxes);
 }
Ejemplo n.º 13
0
  private void doHtmlResponse(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    String errorMsg = "";

    /* run garbage collection for better estimation of current memory usage */
    String doGc = req.getParameter("gc");
    if (StringUtility.hasText(doGc)) {
      System.gc();
      errorMsg = "<font color='blue'> System.gc() triggered.</font>";
    }

    List<List<String>> result = getDiagnosticItems();

    IDiagnostic[] diagnosticServices = DiagnosticFactory.getDiagnosticProviders();
    for (IDiagnostic diagnosticService : diagnosticServices) {
      if (CollectionUtility.hasElements(diagnosticService.getPossibleActions())) {
        diagnosticService.addSubmitButtonsHTML(result);
      }
    }
    DiagnosticFactory.addDiagnosticItemToList(
        result, "System.gc()", "", "<input type='checkbox' name='gc' value='yes'/>");

    String diagnosticHTML = getDiagnosticItemsHTML(result);

    String title = "unknown";
    Version version = Version.emptyVersion;
    IProduct product = Platform.getProduct();
    if (product != null) {
      title = product.getName();
      version =
          Version.parseVersion("" + product.getDefiningBundle().getHeaders().get("Bundle-Version"));
    }

    resp.setContentType("text/html");
    ServletOutputStream out = resp.getOutputStream();
    out.println("<html>");
    out.println("<head>");
    out.println("<title>" + title + "</title>");
    out.println("<style>");
    out.println("body {font-family: sans-serif; font-size: 12; background-color : #F6F6F6;}");
    out.println("a,a:VISITED {color: #6666ff;text-decoration: none;}");
    out.println("table {font-size: 12; empty-cells: show;}");
    out.println(
        "th {text-align: left;vertical-align: top; padding-left: 2; background-color : #cccccc;}");
    out.println("td {text-align: left;vertical-align: top; padding-left: 2;}");
    out.println("p {margin-top: 4; margin-bottom: 4; padding-top: 4; padding-bottom: 4;}");
    out.println("dt {font-weight: bold;}");
    out.println("dd {margin-left: 20px; margin-bottom: 3px;}");
    out.println(".copyright {font-size: 10;}");
    out.println("</style>");
    out.println("<script type=\"text/javascript\">");
    out.println("function toggle_visibility(id) {");
    out.println("   var el = document.getElementById(id);");
    out.println("   el.style.display = (el.style.display != 'none' ? 'none' : 'block');");
    out.println("}");
    out.println("</script>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h3>" + title + " " + version + "</h3>");
    out.println(
        "<form method='POST' action='"
            + StringUtility.join("?", req.getRequestURL().toString(), req.getQueryString())
            + "'>");
    out.print(diagnosticHTML);
    out.println("<p><input type='submit' value='submit'/></p>");
    out.println("</form>");
    out.print(errorMsg);
    out.println("<p class=\"copyright\">&copy; " + OfficialVersion.COPYRIGHT + "</p>");
    out.println("</body>");
    out.println("</html>");
  }
 @Override
 protected Set<? extends IMenuType> getConfiguredMenuTypes() {
   return CollectionUtility.hashSet(TableMenuType.EmptySpace);
 }