Example #1
0
  private void loadOpeners() {
    openers.clear();

    if (nameAutoLookupAsOpener) {
      // --get openers defined from the opener provider
      OpenerProvider openerProvider = ClientContext.getCurrentContext().getOpenerProvider();
      if (openerProvider != null) {
        UIController controller = binding.getController();
        List<Opener> oo = openerProvider.getOpeners(getName(), null);
        if (oo != null) openers.addAll(oo);
      }
    } else {
      // --get openers defined from the code bean
      Object value = null;
      try {
        value = UIControlUtil.getBeanValue(this);
      } catch (Exception e) {;
      }

      if (value == null) {
        // do nothing
      } else if (value.getClass().isArray()) {
        for (Opener o : (Opener[]) value) {
          openers.add(o);
        }
      } else if (value instanceof Collection) {
        openers.addAll((Collection) value);
      }
    }
  }
Example #2
0
 public Object getValue() {
   if (!ValueUtil.isEmpty(expression)) {
     ExpressionResolver er = ClientContext.getCurrentContext().getExpressionResolver();
     return er.evaluate(binding.getBean(), expression);
   } else if (!ValueUtil.isEmpty(getName())) return UIControlUtil.getBeanValue(this);
   else return super.getText();
 }
Example #3
0
  public void refresh() {
    try {
      Object value = null;
      if (!ValueUtil.isEmpty(expression)) {
        value = UIControlUtil.evaluateExpr(binding.getBean(), expression);
      } else if (!ValueUtil.isEmpty(getName())) {
        value = UIControlUtil.getBeanValue(this);
        if (value != null && format != null) {
          value = format.format(value);
        }
      } else {
        value = super.getText();
      }

      super.setText((value != null ? value + "" : ""));

    } catch (Exception e) {
      super.setText("");

      if (ClientContext.getCurrentContext().isDebugMode()) {
        e.printStackTrace();
      }
    }
  }
Example #4
0
 public int compareTo(Object o) {
   return UIControlUtil.compare(this, o);
 }