Example usage for java.lang Boolean Boolean

List of usage examples for java.lang Boolean Boolean

Introduction

In this page you can find the example usage for java.lang Boolean Boolean.

Prototype

@Deprecated(since = "9")
public Boolean(String s) 

Source Link

Document

Allocates a Boolean object representing the value true if the string argument is not null and is equal, ignoring case, to the string "true" .

Usage

From source file:com.alkacon.opencms.v8.comments.CmsCommentFormHandler.java

/**
 * Special form output for the comments.<p>
 * /*from  w  ww .  j  av a2s . c  o  m*/
 * @see com.alkacon.opencms.v8.formgenerator.CmsFormHandler#createForm()
 */
@Override
public void createForm() throws IOException {

    // the output writer
    Writer out = getJspContext().getOut();

    // check the template group syntax and show eventual errors
    out.write(buildTemplateGroupCheckHtml());

    boolean showForm = showForm();
    if (!showForm) {
        // form has been submitted with correct values
        // try to send a notification email with the submitted form field values
        if (sendData()) {
            // successfully submitted
            if (getFormConfirmationText().equals("")) {
                // and no confirmation required
                out.write("ok");
                return;
            }
            // confirmation output
            StringTemplate sTemplate = getOutputTemplate("confirmationoutput");
            sTemplate.setAttribute("formconfig", getCommentFormConfiguration());
            sTemplate.setAttribute("closebutton", getMessages().key("form.button.close"));
            out.write(sTemplate.toString());
        } else {
            // problem while submitting
            StringTemplate sTemplate = getOutputTemplate("emailerror");
            sTemplate.setAttribute("headline", getMessages().key("form.error.mail.headline"));
            sTemplate.setAttribute("text", getMessages().key("form.error.mail.text"));
            sTemplate.setAttribute("error", getErrors().get("sendmail"));
            out.write(sTemplate.toString());
        }
        return;
    }

    // create the form
    out.write(buildFormHtml());

    // add additional JS
    StringTemplate sTemplate = getOutputTemplate("formscript");
    sTemplate.setAttribute("formlink",
            link("/system/modules/com.alkacon.opencms.v8.comments/elements/comment_form.jsp"));
    sTemplate.setAttribute("isguest", new Boolean(getRequestContext().getCurrentUser().isGuestUser()));
    sTemplate.setAttribute("username", ("" + getRequestContext().getCurrentUser().getFirstname() + " "
            + getRequestContext().getCurrentUser().getLastname()).trim());
    sTemplate.setAttribute("useremail", getRequestContext().getCurrentUser().getEmail());
    sTemplate.setAttribute("namefield", getCommentFormConfiguration().getFieldByDbLabel("name"));
    sTemplate.setAttribute("emailfield", getCommentFormConfiguration().getFieldByDbLabel("email"));
    sTemplate.setAttribute("commentfield", getCommentFormConfiguration().getFieldByDbLabel("comment"));
    sTemplate.setAttribute("charleft", getMessages().key("form.comment.char.left"));
    out.write(sTemplate.toString());
}

From source file:io.tilt.minka.business.impl.CoordinatorImpl.java

/**
 * Executes a lambda before acquiring a service permission, then it releases it.
 * It loops in the specified case.  /*from   ww w  .jav  a  2s . c o m*/
 */
@SuppressWarnings("unchecked")
private <R> R runSynchronized(final Synchronized sync) {
    Validate.notNull(sync);
    final boolean untilGrant = sync.getPriority() == PriorityLock.MEDIUM_BLOCKING;
    if (sync.getPriority() == PriorityLock.HIGH_ISOLATED) {
        sync.execute();
        return (R) new Boolean(true);
    }

    int retries = 0;
    while (!Thread.interrupted()) {
        final Permission p = untilGrant ? acquireBlocking(sync.getAction()) : acquire(sync.getAction());
        if (logger.isDebugEnabled()) {
            logger.debug("{}: ({}) {} operation {} to {}", getClass().getSimpleName(), shardId,
                    sync.getAction(), p, sync.getTask().getClass().getSimpleName());
        }
        if (p == GRANTED) {
            try {
                if (sync.getTask() instanceof Runnable) {
                    sync.execute();
                    return (R) new Boolean(true);
                } else if (sync.getTask() instanceof Callable) {
                    // TODO
                    R call = ((Callable<R>) sync.getTask()).call();
                    return call;
                }
            } catch (Exception e) {
                logger.error("{}: ({}) Untrapped task's exception while executing: {} task: {}",
                        getClass().getSimpleName(), shardId, sync.getTask().getClass().getName(),
                        sync.getAction(), e);
            } finally {
                release(sync.getAction());
            }
            break;
        } else if (p == RETRY && untilGrant) {
            if (retries++ < Config.SEMAPHORE_UNLOCK_MAX_RETRIES) {
                if (logger.isDebugEnabled()) {
                    logger.debug("{}: Sleeping while waiting to acquire lock: {}", getClass().getSimpleName(),
                            shardId, sync.getAction());
                }
                // TODO: WTF -> LockSupport.parkUntil(Config.SEMAPHORE_UNLOCK_RETRY_DELAY_MS);
                try {
                    Thread.sleep(Config.SEMAPHORE_UNLOCK_RETRY_DELAY_MS);
                } catch (InterruptedException e) {
                    logger.error("{}: ({}) While sleeping for unlock delay", getClass().getSimpleName(),
                            shardId, e);
                }
            } else {
                logger.warn("{}: ({}) Coordination starved ({}) for action: {} too many retries ({})",
                        getClass().getSimpleName(), shardId, p, sync.getAction(), retries);
                /*throw new RuntimeException("Coordination starved for action: " + dispatch.getClass() 
                + " too many retries");*/
            }
        } else {
            break;
        }
    }
    return null;
}

From source file:com.duroty.application.admin.utils.AdminDefaultAction.java

/**
 * DOCUMENT ME!/*w  w  w  .j  a  v  a 2 s.c  o  m*/
 *
 * @param request DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 *
 * @throws NamingException DOCUMENT ME!
 * @throws RemoteException DOCUMENT ME!
 * @throws CreateException DOCUMENT ME!
 */
protected Search getSearchInstance(HttpServletRequest request)
        throws NamingException, RemoteException, CreateException {
    SearchHome home = null;

    Boolean localServer = new Boolean(Configuration.properties.getProperty(Configuration.LOCAL_WEB_SERVER));

    if (localServer.booleanValue()) {
        home = SearchUtil.getHome();
    } else {
        Hashtable environment = getContextProperties(request);
        home = SearchUtil.getHome(environment);
    }

    return home.create();
}

From source file:com.sun.faces.taglib.html_basic.InputTextareaTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UIInput input = null;/*from   w ww  .j  av  a  2 s. c o m*/
    try {
        input = (UIInput) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UIInput.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            input.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            input.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            input.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            input.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            input.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            input.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            input.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            input.setValueBinding("value", vb);
        } else {
            input.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            input.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            input.setValueBinding("accesskey", vb);
        } else {
            input.getAttributes().put("accesskey", accesskey);
        }
    }
    if (cols != null) {
        if (isValueReference(cols)) {
            ValueBinding vb = Util.getValueBinding(cols);
            input.setValueBinding("cols", vb);
        } else {
            int _cols = new Integer(cols).intValue();
            if (_cols != Integer.MIN_VALUE) {
                input.getAttributes().put("cols", new Integer(_cols));
            }
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            input.setValueBinding("dir", vb);
        } else {
            input.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            input.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            input.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            input.setValueBinding("lang", vb);
        } else {
            input.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            input.setValueBinding("onblur", vb);
        } else {
            input.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            input.setValueBinding("onchange", vb);
        } else {
            input.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            input.setValueBinding("onclick", vb);
        } else {
            input.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            input.setValueBinding("ondblclick", vb);
        } else {
            input.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            input.setValueBinding("onfocus", vb);
        } else {
            input.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            input.setValueBinding("onkeydown", vb);
        } else {
            input.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            input.setValueBinding("onkeypress", vb);
        } else {
            input.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            input.setValueBinding("onkeyup", vb);
        } else {
            input.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            input.setValueBinding("onmousedown", vb);
        } else {
            input.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            input.setValueBinding("onmousemove", vb);
        } else {
            input.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            input.setValueBinding("onmouseout", vb);
        } else {
            input.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            input.setValueBinding("onmouseover", vb);
        } else {
            input.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            input.setValueBinding("onmouseup", vb);
        } else {
            input.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            input.setValueBinding("onselect", vb);
        } else {
            input.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            input.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            input.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (rows != null) {
        if (isValueReference(rows)) {
            ValueBinding vb = Util.getValueBinding(rows);
            input.setValueBinding("rows", vb);
        } else {
            int _rows = new Integer(rows).intValue();
            if (_rows != Integer.MIN_VALUE) {
                input.getAttributes().put("rows", new Integer(_rows));
            }
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            input.setValueBinding("style", vb);
        } else {
            input.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            input.setValueBinding("styleClass", vb);
        } else {
            input.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            input.setValueBinding("tabindex", vb);
        } else {
            input.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            input.setValueBinding("title", vb);
        } else {
            input.getAttributes().put("title", title);
        }
    }
}

From source file:cz.zcu.kiv.eegdatabase.logic.controller.experiment.ExperimentMultiController.java

public ModelAndView detail(HttpServletRequest request, HttpServletResponse response) {
    ModelAndView mav = new ModelAndView("experiments/detail");
    VhdrReader vhdr = new VhdrReader();
    List<ChannelInfo> channels = null;

    setPermissionsToView(mav);//from ww w  .ja  va  2 s.com
    int id = 0;
    try {
        id = Integer.parseInt(request.getParameter("experimentId"));
    } catch (Exception e) {
    }
    Experiment m = experimentDao.getExperimentForDetail(id);

    mav.addObject("userIsOwnerOrCoexperimenter", (auth.userIsOwnerOrCoexperimenter(id)) || (auth.isAdmin()));
    int subjectPersonId = m.getPersonBySubjectPersonId().getPersonId();
    Boolean filesIn = new Boolean(false);
    ArrayList<double[]> signalData = new ArrayList<double[]>();
    for (DataFile file : m.getDataFiles()) {
        if (file.getFilename().endsWith(".vhdr")) {
            Blob b = file.getFileContent();
            int index = file.getFilename().lastIndexOf(".");
            String fileName = file.getFilename().substring(0, index);
            try {
                vhdr.readVhdr(IOUtils.toByteArray(b.getBinaryStream()));
            } catch (IOException ex) {
                Logger.getLogger(ExperimentMultiController.class.getName()).log(Level.SEVERE, null, ex);
                throw new RuntimeException(ex);
            } catch (SQLException ex) {
                Logger.getLogger(ExperimentMultiController.class.getName()).log(Level.SEVERE, null, ex);
                throw new RuntimeException(ex);
            }
            channels = vhdr.getChannels();
            mav.addObject("channels", channels);

            for (DataFile file2 : m.getDataFiles()) {
                if ((file2.getFilename().endsWith(".eeg")) || (file2.getFilename().endsWith(".avg"))) {
                    filesIn = true;
                    Blob b2 = file.getFileContent();
                    EegReader eeg = new EegReader(vhdr);
                    for (ChannelInfo ch : channels) {
                        try {
                            signalData.add(
                                    eeg.readFile(IOUtils.toByteArray(b2.getBinaryStream()), ch.getNumber()));
                        } catch (IOException ex) {
                            Logger.getLogger(ExperimentMultiController.class.getName()).log(Level.SEVERE, null,
                                    ex);
                            throw new RuntimeException(ex);
                        } catch (SQLException ex) {
                            Logger.getLogger(ExperimentMultiController.class.getName()).log(Level.SEVERE, null,
                                    ex);
                            throw new RuntimeException(ex);
                        }
                    }
                    mav.addObject("signalData", signalData);
                }
            }
        }
    }

    mav.addObject("filesAvailable", filesIn);
    mav.addObject("userCanViewPersonDetails", auth.userCanViewPersonDetails(subjectPersonId));

    mav.addObject("experimentDetail", m);

    return mav;
}

From source file:it.cnr.icar.eric.client.ui.thin.components.components.QueryPanelComponent.java

public Object saveState(FacesContext context) {

    Object values[] = new Object[10];
    values[0] = super.saveState(context);
    values[1] = panelMap;/* ww  w. j  a va  2 s.  c  o m*/
    values[2] = new Integer(currentComponentId);
    values[3] = classSchemeRegistry;
    values[4] = currentQuery;
    values[5] = storeBasicQueryId;
    values[6] = storeBasicQueryIds;
    values[7] = new Boolean(menuDisplayTree);
    values[8] = adhocQueryMap;
    // Save additional state for this component
    // Into additional values in the array.
    //values[7] = saveAttachedState(context, validators);
    //values[8] = saveAttachedState(context, validatorBinding);
    //values[9] = saveAttachedState(context, valueChangeMethod);
    return (values);

}

From source file:com.adito.core.actions.AbstractMultiFormDispatchAction.java

private ActionForward provideActionTargets(Collection<SubActionWrapper> subActions,
        AbstractMultiFormDispatchForm dispatchForm, HttpServletRequest request, HttpServletResponse response,
        String name)//from w  ww.ja va2s .  c o m
        throws ClassNotFoundException, IOException, IllegalAccessException, InstantiationException {
    if (null == name || name.equals(""))
        name = "unspecified";
    // JDR added the ability to refresh all sub forms.
    boolean refreshAll = new Boolean(request.getParameter("refreshAll"));

    String subForm = dispatchForm.getSubForm();
    ActionForm subform = (ActionForm) request.getSession().getAttribute(subForm);
    ActionForward fwd = null;

    // Now try to create actions and run the provided action target on each.
    // Any forwards returned are ignored
    for (SubActionWrapper wrapper : subActions) {
        try {
            // We have an action config, so get the action instance
            Action action = processActionCreate(request, response, wrapper.getMapping());
            // Identify the method object to be dispatched to
            if (dispatchForm.isSubFormEmpty() || wrapper.getForm().equals(subform) || refreshAll) {
                Method method = getMethod(action, name);
                Object args[] = { wrapper.getMapping(), wrapper.getForm(), request, response };
                // Invoke the method. We don't care about the forward
                // returned,
                // it will not be used.
                if (wrapper.getForm().equals(subform)) {
                    fwd = (ActionForward) method.invoke(action, args);
                } else {
                    method.invoke(action, args);
                }
            }
        } catch (Exception e) {
            log.error(e);
        }
    }

    return fwd;
}

From source file:com.sun.faces.taglib.html_basic.SelectOneMenuTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectOne selectone = null;//from   ww  w  .  j av a2 s . c  o  m
    try {
        selectone = (UISelectOne) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UISelectOne.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            selectone.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            selectone.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            selectone.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            selectone.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            selectone.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            selectone.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            selectone.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            selectone.setValueBinding("value", vb);
        } else {
            selectone.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            selectone.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            selectone.setValueBinding("accesskey", vb);
        } else {
            selectone.getAttributes().put("accesskey", accesskey);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            selectone.setValueBinding("dir", vb);
        } else {
            selectone.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            selectone.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            selectone.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (disabledClass != null) {
        if (isValueReference(disabledClass)) {
            ValueBinding vb = Util.getValueBinding(disabledClass);
            selectone.setValueBinding("disabledClass", vb);
        } else {
            selectone.getAttributes().put("disabledClass", disabledClass);
        }
    }
    if (enabledClass != null) {
        if (isValueReference(enabledClass)) {
            ValueBinding vb = Util.getValueBinding(enabledClass);
            selectone.setValueBinding("enabledClass", vb);
        } else {
            selectone.getAttributes().put("enabledClass", enabledClass);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            selectone.setValueBinding("lang", vb);
        } else {
            selectone.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            selectone.setValueBinding("onblur", vb);
        } else {
            selectone.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            selectone.setValueBinding("onchange", vb);
        } else {
            selectone.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            selectone.setValueBinding("onclick", vb);
        } else {
            selectone.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            selectone.setValueBinding("ondblclick", vb);
        } else {
            selectone.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            selectone.setValueBinding("onfocus", vb);
        } else {
            selectone.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            selectone.setValueBinding("onkeydown", vb);
        } else {
            selectone.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            selectone.setValueBinding("onkeypress", vb);
        } else {
            selectone.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            selectone.setValueBinding("onkeyup", vb);
        } else {
            selectone.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            selectone.setValueBinding("onmousedown", vb);
        } else {
            selectone.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            selectone.setValueBinding("onmousemove", vb);
        } else {
            selectone.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            selectone.setValueBinding("onmouseout", vb);
        } else {
            selectone.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            selectone.setValueBinding("onmouseover", vb);
        } else {
            selectone.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            selectone.setValueBinding("onmouseup", vb);
        } else {
            selectone.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            selectone.setValueBinding("onselect", vb);
        } else {
            selectone.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            selectone.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            selectone.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            selectone.setValueBinding("style", vb);
        } else {
            selectone.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            selectone.setValueBinding("styleClass", vb);
        } else {
            selectone.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            selectone.setValueBinding("tabindex", vb);
        } else {
            selectone.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            selectone.setValueBinding("title", vb);
        } else {
            selectone.getAttributes().put("title", title);
        }
    }
}

From source file:com.sun.faces.taglib.html_basic.SelectManyMenuTag.java

protected void setProperties(UIComponent component) {
    super.setProperties(component);
    UISelectMany selectmany = null;/*www.  j  ava2  s  .c om*/
    try {
        selectmany = (UISelectMany) component;
    } catch (ClassCastException cce) {
        throw new IllegalStateException("Component " + component.toString()
                + " not expected type.  Expected: UISelectMany.  Perhaps you're missing a tag?");
    }

    if (converter != null) {
        if (isValueReference(converter)) {
            ValueBinding vb = Util.getValueBinding(converter);
            selectmany.setValueBinding("converter", vb);
        } else {
            Converter _converter = FacesContext.getCurrentInstance().getApplication()
                    .createConverter(converter);
            selectmany.setConverter(_converter);
        }
    }

    if (immediate != null) {
        if (isValueReference(immediate)) {
            ValueBinding vb = Util.getValueBinding(immediate);
            selectmany.setValueBinding("immediate", vb);
        } else {
            boolean _immediate = new Boolean(immediate).booleanValue();
            selectmany.setImmediate(_immediate);
        }
    }
    if (required != null) {
        if (isValueReference(required)) {
            ValueBinding vb = Util.getValueBinding(required);
            selectmany.setValueBinding("required", vb);
        } else {
            boolean _required = new Boolean(required).booleanValue();
            selectmany.setRequired(_required);
        }
    }
    if (validator != null) {
        if (isValueReference(validator)) {
            Class args[] = { FacesContext.class, UIComponent.class, Object.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication().createMethodBinding(validator,
                    args);
            selectmany.setValidator(vb);
        } else {
            Object params[] = { validator };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (value != null) {
        if (isValueReference(value)) {
            ValueBinding vb = Util.getValueBinding(value);
            selectmany.setValueBinding("value", vb);
        } else {
            selectmany.setValue(value);
        }
    }
    if (valueChangeListener != null) {
        if (isValueReference(valueChangeListener)) {
            Class args[] = { ValueChangeEvent.class };
            MethodBinding vb = FacesContext.getCurrentInstance().getApplication()
                    .createMethodBinding(valueChangeListener, args);
            selectmany.setValueChangeListener(vb);
        } else {
            Object params[] = { valueChangeListener };
            throw new javax.faces.FacesException(
                    Util.getExceptionMessageString(Util.INVALID_EXPRESSION_ID, params));
        }
    }
    if (accesskey != null) {
        if (isValueReference(accesskey)) {
            ValueBinding vb = Util.getValueBinding(accesskey);
            selectmany.setValueBinding("accesskey", vb);
        } else {
            selectmany.getAttributes().put("accesskey", accesskey);
        }
    }
    if (dir != null) {
        if (isValueReference(dir)) {
            ValueBinding vb = Util.getValueBinding(dir);
            selectmany.setValueBinding("dir", vb);
        } else {
            selectmany.getAttributes().put("dir", dir);
        }
    }
    if (disabled != null) {
        if (isValueReference(disabled)) {
            ValueBinding vb = Util.getValueBinding(disabled);
            selectmany.setValueBinding("disabled", vb);
        } else {
            boolean _disabled = new Boolean(disabled).booleanValue();
            selectmany.getAttributes().put("disabled", _disabled ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (disabledClass != null) {
        if (isValueReference(disabledClass)) {
            ValueBinding vb = Util.getValueBinding(disabledClass);
            selectmany.setValueBinding("disabledClass", vb);
        } else {
            selectmany.getAttributes().put("disabledClass", disabledClass);
        }
    }
    if (enabledClass != null) {
        if (isValueReference(enabledClass)) {
            ValueBinding vb = Util.getValueBinding(enabledClass);
            selectmany.setValueBinding("enabledClass", vb);
        } else {
            selectmany.getAttributes().put("enabledClass", enabledClass);
        }
    }
    if (lang != null) {
        if (isValueReference(lang)) {
            ValueBinding vb = Util.getValueBinding(lang);
            selectmany.setValueBinding("lang", vb);
        } else {
            selectmany.getAttributes().put("lang", lang);
        }
    }
    if (onblur != null) {
        if (isValueReference(onblur)) {
            ValueBinding vb = Util.getValueBinding(onblur);
            selectmany.setValueBinding("onblur", vb);
        } else {
            selectmany.getAttributes().put("onblur", onblur);
        }
    }
    if (onchange != null) {
        if (isValueReference(onchange)) {
            ValueBinding vb = Util.getValueBinding(onchange);
            selectmany.setValueBinding("onchange", vb);
        } else {
            selectmany.getAttributes().put("onchange", onchange);
        }
    }
    if (onclick != null) {
        if (isValueReference(onclick)) {
            ValueBinding vb = Util.getValueBinding(onclick);
            selectmany.setValueBinding("onclick", vb);
        } else {
            selectmany.getAttributes().put("onclick", onclick);
        }
    }
    if (ondblclick != null) {
        if (isValueReference(ondblclick)) {
            ValueBinding vb = Util.getValueBinding(ondblclick);
            selectmany.setValueBinding("ondblclick", vb);
        } else {
            selectmany.getAttributes().put("ondblclick", ondblclick);
        }
    }
    if (onfocus != null) {
        if (isValueReference(onfocus)) {
            ValueBinding vb = Util.getValueBinding(onfocus);
            selectmany.setValueBinding("onfocus", vb);
        } else {
            selectmany.getAttributes().put("onfocus", onfocus);
        }
    }
    if (onkeydown != null) {
        if (isValueReference(onkeydown)) {
            ValueBinding vb = Util.getValueBinding(onkeydown);
            selectmany.setValueBinding("onkeydown", vb);
        } else {
            selectmany.getAttributes().put("onkeydown", onkeydown);
        }
    }
    if (onkeypress != null) {
        if (isValueReference(onkeypress)) {
            ValueBinding vb = Util.getValueBinding(onkeypress);
            selectmany.setValueBinding("onkeypress", vb);
        } else {
            selectmany.getAttributes().put("onkeypress", onkeypress);
        }
    }
    if (onkeyup != null) {
        if (isValueReference(onkeyup)) {
            ValueBinding vb = Util.getValueBinding(onkeyup);
            selectmany.setValueBinding("onkeyup", vb);
        } else {
            selectmany.getAttributes().put("onkeyup", onkeyup);
        }
    }
    if (onmousedown != null) {
        if (isValueReference(onmousedown)) {
            ValueBinding vb = Util.getValueBinding(onmousedown);
            selectmany.setValueBinding("onmousedown", vb);
        } else {
            selectmany.getAttributes().put("onmousedown", onmousedown);
        }
    }
    if (onmousemove != null) {
        if (isValueReference(onmousemove)) {
            ValueBinding vb = Util.getValueBinding(onmousemove);
            selectmany.setValueBinding("onmousemove", vb);
        } else {
            selectmany.getAttributes().put("onmousemove", onmousemove);
        }
    }
    if (onmouseout != null) {
        if (isValueReference(onmouseout)) {
            ValueBinding vb = Util.getValueBinding(onmouseout);
            selectmany.setValueBinding("onmouseout", vb);
        } else {
            selectmany.getAttributes().put("onmouseout", onmouseout);
        }
    }
    if (onmouseover != null) {
        if (isValueReference(onmouseover)) {
            ValueBinding vb = Util.getValueBinding(onmouseover);
            selectmany.setValueBinding("onmouseover", vb);
        } else {
            selectmany.getAttributes().put("onmouseover", onmouseover);
        }
    }
    if (onmouseup != null) {
        if (isValueReference(onmouseup)) {
            ValueBinding vb = Util.getValueBinding(onmouseup);
            selectmany.setValueBinding("onmouseup", vb);
        } else {
            selectmany.getAttributes().put("onmouseup", onmouseup);
        }
    }
    if (onselect != null) {
        if (isValueReference(onselect)) {
            ValueBinding vb = Util.getValueBinding(onselect);
            selectmany.setValueBinding("onselect", vb);
        } else {
            selectmany.getAttributes().put("onselect", onselect);
        }
    }
    if (readonly != null) {
        if (isValueReference(readonly)) {
            ValueBinding vb = Util.getValueBinding(readonly);
            selectmany.setValueBinding("readonly", vb);
        } else {
            boolean _readonly = new Boolean(readonly).booleanValue();
            selectmany.getAttributes().put("readonly", _readonly ? Boolean.TRUE : Boolean.FALSE);
        }
    }
    if (style != null) {
        if (isValueReference(style)) {
            ValueBinding vb = Util.getValueBinding(style);
            selectmany.setValueBinding("style", vb);
        } else {
            selectmany.getAttributes().put("style", style);
        }
    }
    if (styleClass != null) {
        if (isValueReference(styleClass)) {
            ValueBinding vb = Util.getValueBinding(styleClass);
            selectmany.setValueBinding("styleClass", vb);
        } else {
            selectmany.getAttributes().put("styleClass", styleClass);
        }
    }
    if (tabindex != null) {
        if (isValueReference(tabindex)) {
            ValueBinding vb = Util.getValueBinding(tabindex);
            selectmany.setValueBinding("tabindex", vb);
        } else {
            selectmany.getAttributes().put("tabindex", tabindex);
        }
    }
    if (title != null) {
        if (isValueReference(title)) {
            ValueBinding vb = Util.getValueBinding(title);
            selectmany.setValueBinding("title", vb);
        } else {
            selectmany.getAttributes().put("title", title);
        }
    }
}

From source file:com.aurel.track.screen.dashboard.action.DashboardAction.java

public String edit() {
    session.put(DashboardScreenEditAction.DASHBOARD_EDIT_FROM, new Boolean(false));
    return "edit";
}