Beispiel #1
0
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());

    attributes =
        Attributes.getComponentAttributesFromFacesConfig(UIHashParameter.class, getClass());
  }
 private long getActualMaxValue() {
   Object value = attributes.get("maxValue").getValue();
   if (value instanceof Integer) {
     return Long.valueOf((Integer) value);
   } else if (value instanceof Long) {
     return (Long) value;
   } else if (value instanceof String) {
     return Long.valueOf((String) value);
   }
   throw new IllegalStateException("Cannot convert value: " + value);
 }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());
    files = new ArrayList<UploadedFile>();

    attributes = Attributes.getComponentAttributesFromFacesConfig(UIFileUpload.class, getClass());

    attributes.setAttribute("addLabel", "Add ...");
    attributes.setAttribute("clearAllLabel", "Clear All");
    attributes.setAttribute("clearLabel", "Clear");
    attributes.setAttribute("deleteLabel", "Delete");
    attributes.setAttribute("noDuplicate", false);
    attributes.setAttribute("rendered", true);
    attributes.setAttribute("uploadLabel", "Upload");

    // will be tested in another way
    attributes.remove("validator");
    attributes.remove("fileUploadListener");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());

    attributes =
        Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuGroup.class, getClass());

    attributes.setAttribute("rendered", true);
    attributes.setAttribute("selectable", true);
    attributes.setAttribute("mode", "ajax");

    // already defined in source directly
    attributes.remove("name");
    attributes.remove("label");
    attributes.remove("changeExpandListener");
    attributes.remove("action");
    attributes.remove("actionListener");

    // expanded needs to be set separately
    attributes.remove("expanded");
    expanded.put("group2", true);
    expanded.put("group23", true);
  }
 public Long getCurrentValue() {
   if (Boolean.TRUE.equals(attributes.get("enabled").getValue())) {
     long current = (System.currentTimeMillis() - startTime) / UPDATE_INTERVAL;
     if (current >= getActualMaxValue()) {
       // in tests there is no need to continue further than maximum
       buttonRendered = true;
     } else if (current == 0) {
       return 1L;
     }
     return current;
   }
   if (startTime < 0) {
     return startTime;
   } else {
     return getActualMaxValue() + 1L;
   }
 }
  @PostConstruct
  public void init() {
    LOG.info("initializing bean " + getClass().getName());
    attributes = Attributes.getComponentAttributesFromFacesConfig(UIPlaceholder.class, getClass());

    attributes.setAttribute("value", "Watermark text");
    attributes.setAttribute("rendered", "true");
    attributes.setAttribute("styleClass", "customPlaceholderClass");
    attributes.setAttribute("selector", "");

    attributes.remove("converter");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());

    attributes = Attributes.getComponentAttributesFromFacesConfig(UICommandLink.class, getClass());

    attributes.setAttribute("value", "command link");
    attributes.setAttribute("rendered", true);
    attributes.setAttribute("action", "first6CharsAction");
    attributes.setAttribute("actionListener", "toUpperCaseActionListener");
    attributes.setAttribute("render", "output1 output2 output3");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    LOGGER.debug("initializing bean " + getClass().getName());

    attributes = Attributes.getComponentAttributesFromFacesConfig(UIProgressBar.class, getClass());

    attributes.setAttribute(
        "enabled", Boolean.FALSE); // The true is set after start button is clicked
    attributes.setAttribute("maxValue", 20);
    attributes.setAttribute("minValue", 0);
    attributes.setAttribute("interval", 1500);
    attributes.setAttribute("rendered", true);
    attributes.setAttribute("value", -1);

    // attributes tested in another way
    attributes.remove("mode");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());

    attributes =
        Attributes.getComponentAttributesFromFacesConfig(UIPanelMenuItem.class, getClass());

    attributes.setAttribute("rendered", true);
    attributes.setAttribute("selectable", true);

    // already defined in source directly
    attributes.remove("action");
    attributes.remove("actionListener");
    attributes.remove("name");
    attributes.remove("label");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger.debug("initializing bean " + getClass().getName());

    attributes =
        Attributes.getComponentAttributesFromFacesConfig(HtmlInputNumberSlider.class, getClass());

    attributes.setAttribute("enableManualInput", true);
    attributes.setAttribute("inputSize", 3);
    attributes.setAttribute("maxlength", 10);
    attributes.setAttribute("maxValue", 10);
    attributes.setAttribute("minValue", -10);
    attributes.setAttribute("rendered", true);
    attributes.setAttribute("required", true);
    attributes.setAttribute("requiredMessage", NumberInputValidationBean.REQUIRED_VALIDATION_MSG);
    attributes.setAttribute("showBoundaryValues", true);
    attributes.setAttribute("showInput", true);
    attributes.setAttribute("step", 1);
    attributes.setAttribute("value", 2);
    attributes.setAttribute("delay", 200);
    attributes.setAttribute("valueChangeListener", "valueChangeListener");
  }
  /** Initializes the managed bean. */
  @PostConstruct
  public void init() {
    logger = LoggerFactory.getLogger(getClass());
    logger.debug("initializing bean " + getClass().getName());

    attributes = Attributes.getComponentAttributesFromFacesConfig(UIDragSource.class, getClass());

    attributes.setAttribute("dragIndicator", "indicator");
    attributes.setAttribute("type", "drg1");
    attributes.setAttribute("rendered", true);

    attributes.remove("dragValue");
    attributes.remove("event");

    for (int i = 0; i < DRAG_VALUES; i++) {
      dragValues.add(new DragValue(i + 1));
    }
  }
 public String startProcess() {
   attributes.setAttribute("enabled", true);
   buttonRendered = false;
   this.startTime = System.currentTimeMillis();
   return null;
 }
 public void switchPolling() {
   Attribute enabled = attributes.get("enabled");
   Boolean b = (Boolean) enabled.getValue();
   enabled.setValue(!b.booleanValue());
 }
  @PostConstruct
  public void init() {
    attributes = Attributes.getComponentAttributesFromFacesConfig(UIPickList.class, getClass());
    capitalsOptions = new ArrayList<SelectItem>();
    validationOptions = new ArrayList<SelectItem>();
    value = new ArrayList<SelectItem>();

    for (Capital capital : capitals) {
      capitalsOptions.add(new SelectItem(capital.getState(), capital.getState()));
      validationOptions.add(new SelectItem(capital.getState(), capital.getState()));
    }
    validationOptions.add(new SelectItem("@@", "@@"));
    validationOptions.add(new SelectItem("", ""));
    validationOptions.add(new SelectItem("RichFaces", "RichFaces"));
    validationOptions.add(new SelectItem("richfaces", "richfaces"));

    attributes.setAttribute("rendered", Boolean.TRUE);
    attributes.setAttribute("minListHeight", "100");
    attributes.setAttribute("orderable", Boolean.TRUE);

    attributes.setAttribute("requiredMessage", "Not empty target list is required!");
    attributes.setAttribute("validatorMessage", "We are sorry, but @ is not allowed to join us!");

    attributes.setAttribute("addText", "add");
    attributes.setAttribute("addAllText", "add all");
    attributes.setAttribute("removeText", "remove");
    attributes.setAttribute("removeAllText", "remove all");

    attributes.setAttribute("upTopText", "First");
    attributes.setAttribute("upText", "Up");
    attributes.setAttribute("downText", "Down");
    attributes.setAttribute("downBottomText", "Last");

    attributes.remove("converter");
    attributes.remove("converterMessage");
    attributes.remove("valueChangeListener");
    attributes.remove("columnVar");
  }