/**
   * Since this property depends on the user agent it is saved separately for each combination of
   * {@link org.eclipse.scout.rt.shared.ui.IUiLayer IUiLayer} and {@link
   * org.eclipse.scout.rt.shared.ui.IUiDeviceType IUiDeviceType}.
   */
  public Rectangle getFormBounds(IForm form) {
    String key = form.computeCacheBoundsKey();
    if (key == null) {
      return null;
    }

    key = getUserAgentPrefix() + FORM_BOUNDS + key;
    String value = m_env.get(key, "");
    if (StringUtility.isNullOrEmpty(value)) {
      key = getLegacyFormBoundsKey(form);
      value = m_env.get(key, "");
    }

    if (!StringUtility.isNullOrEmpty(value)) {
      try {
        StringTokenizer tok = new StringTokenizer(value, ",");
        Rectangle r =
            new Rectangle(
                new Integer(tok.nextToken()).intValue(),
                new Integer(tok.nextToken()).intValue(),
                new Integer(tok.nextToken()).intValue(),
                new Integer(tok.nextToken()).intValue());
        return r;
      } catch (Exception e) {
        LOG.warn("value=" + value, e);
      }
    }
    return null;
  }
 private static int getScopePriority(String scope) {
   int prio = IFormFieldExtension.SCOPE_DEFAULT;
   if (StringUtility.isNullOrEmpty(scope) || scope.equalsIgnoreCase("default")) {
     prio = IFormFieldExtension.SCOPE_DEFAULT;
   } else if (scope.equalsIgnoreCase("global")) {
     prio = IFormFieldExtension.SCOPE_GLOBAL;
   }
   return prio;
 }
 @Override
 protected IStatus run(IProgressMonitor monitor) {
   String pattern;
   synchronized (navigationLock) {
     if (monitor.isCanceled() || StringUtility.isNullOrEmpty(m_filterText)) {
       return Status.CANCEL_STATUS;
     }
     pattern = StringUtility.toRegExPattern(m_filterText.toLowerCase());
     pattern = pattern + ".*";
   }
   // this call must be outside lock!
   handleSearchPattern(pattern);
   return Status.OK_STATUS;
 }
  private MqttConnectOptions getConnectOptions(
      String userName,
      String password,
      Boolean clearSession,
      Integer connectionTimeout,
      String lwtTopic,
      String lwtMessage,
      Integer lwtQos,
      Boolean lwtRetained) {
    MqttConnectOptions connectOpts = new MqttConnectOptions();

    if (!StringUtility.isNullOrEmpty(userName)) {
      connectOpts.setUserName(userName);

      if (!StringUtility.isNullOrEmpty(password)) {
        connectOpts.setPassword(password.toCharArray());
      }
    }

    if (clearSession != null) {
      connectOpts.setCleanSession(clearSession);
    }

    if (connectionTimeout != null) {
      connectOpts.setConnectionTimeout(connectionTimeout);
    }

    if (!StringUtility.isNullOrEmpty(lwtTopic) && !StringUtility.isNullOrEmpty(lwtMessage)) {
      connectOpts.setWill(
          lwtTopic,
          lwtMessage.getBytes(),
          NumberUtility.nvl(lwtQos, 1),
          BooleanUtility.nvl(lwtRetained, false));
    }

    return connectOpts;
  }
  private Element getBugTableElement(String url, int timeout) throws ProcessingException {
    Document doc = null;

    if (StringUtility.isNullOrEmpty(url)) {
      throw new ProcessingException(
          "No bugzilla base query url provided, check your config.ini file");
    }

    try {
      doc = Jsoup.parse(new URL(url), timeout);
      if (doc == null)
        throw new ProcessingException("Empty document received, check your connection");
    } catch (Exception e) {
      throw new ProcessingException(
          "Exception ", "check your connection and url: '" + url + "'", e);
    }

    return doc.getElementsByClass("bz_buglist").first();
  }