Package javax.faces.application

Examples of javax.faces.application.Application


    {
        super.setProperties(component);

        HtmlPlanner planner = (HtmlPlanner) component;
        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();

        if (rendered != null)
        {
            if (isValueReference(rendered))
            {
                planner.setValueBinding("rendered", app
                        .createValueBinding(rendered));
            }
            else
            {
                planner.setRendered(Boolean.valueOf(rendered).booleanValue());
            }
        }

        if (visibleStartHour != null)
        {
            if (isValueReference(visibleStartHour))
            {
                planner.setValueBinding("visibleStartHour", app
                        .createValueBinding(visibleStartHour));
            }
            else
            {
                planner.setVisibleStartHour(new Integer(visibleStartHour)
                        .intValue());
            }
        }

        if (visibleEndHour != null)
        {
            if (isValueReference(visibleEndHour))
            {
                planner.setValueBinding("visibleEndHour", app
                        .createValueBinding(visibleEndHour));
            }
            else
            {
                planner.setVisibleEndHour(new Integer(visibleEndHour)
                        .intValue());
            }
        }

        if (workingStartHour != null)
        {
            if (isValueReference(workingStartHour))
            {
                planner.setValueBinding("workingStartHour", app
                        .createValueBinding(workingStartHour));
            }
            else
            {
                planner.setWorkingStartHour(new Integer(workingStartHour)
                        .intValue());
            }
        }

        if (workingEndHour != null)
        {
            if (isValueReference(workingEndHour))
            {
                planner.setValueBinding("workingEndHour", app
                        .createValueBinding(workingEndHour));
            }
            else
            {
                planner.setWorkingEndHour(new Integer(workingEndHour)
                        .intValue());
            }
        }

        if ((value != null) && isValueReference(value))
        {
            planner.setValueBinding("value", app.createValueBinding(value));
        }
        else
        {
            throw new IllegalArgumentException(
                    "The value property must be a value binding expression that points to a PlannerModel object.");
View Full Code Here


    }

        // Derive view identifier
        String viewId = deriveViewId(facesContext);

        Application application = facesContext.getApplication();
        ViewHandler viewHandler = application.getViewHandler();

        //boolean viewCreated = false;
        UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewId);
        if (viewRoot == null)
        {
View Full Code Here

        // also possible that one of the listeners completed the response
        if(isResponseComplete(facesContext, "render", true))
        {
            return;
        }
        Application application = facesContext.getApplication();
        ViewHandler viewHandler = application.getViewHandler();
        try
        {
            viewHandler.renderView(facesContext, facesContext.getViewRoot());
        }
        catch (IOException e)
View Full Code Here

    {
        super.setProperties(component);

        HtmlSchedule schedule = (HtmlSchedule) component;
        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();

        if (rendered != null)
        {
            if (isValueReference(rendered))
            {
                schedule.setValueBinding("rendered", app
                        .createValueBinding(rendered));
            }
            else
            {
                schedule.setRendered(Boolean.valueOf(rendered).booleanValue());
            }
        }

        if (visibleStartHour != null)
        {
            if (isValueReference(visibleStartHour))
            {
                schedule.setValueBinding("visibleStartHour", app
                        .createValueBinding(visibleStartHour));
            }
            else
            {
                schedule.setVisibleStartHour(new Integer(visibleStartHour)
                        .intValue());
            }
        }

        if (visibleEndHour != null)
        {
            if (isValueReference(visibleEndHour))
            {
                schedule.setValueBinding("visibleEndHour", app
                        .createValueBinding(visibleEndHour));
            }
            else
            {
                schedule.setVisibleEndHour(new Integer(visibleEndHour)
                        .intValue());
            }
        }

        if (workingStartHour != null)
        {
            if (isValueReference(workingStartHour))
            {
                schedule.setValueBinding("workingStartHour", app
                        .createValueBinding(workingStartHour));
            }
            else
            {
                schedule.setWorkingStartHour(new Integer(workingStartHour)
                        .intValue());
            }
        }

        if (workingEndHour != null)
        {
            if (isValueReference(workingEndHour))
            {
                schedule.setValueBinding("workingEndHour", app
                        .createValueBinding(workingEndHour));
            }
            else
            {
                schedule.setWorkingEndHour(new Integer(workingEndHour)
                        .intValue());
            }
        }

        if (immediate != null)
        {
            if (isValueReference(immediate))
            {
                schedule.setValueBinding("immediate", app
                        .createValueBinding(immediate));
            }
            else
            {
                schedule
                        .setImmediate(Boolean.valueOf(immediate).booleanValue());
            }
        }

        if (readonly != null)
        {
            if (isValueReference(readonly))
            {
                schedule.setValueBinding("readonly", app
                        .createValueBinding(readonly));
            }
            else
            {
                schedule.setReadonly(Boolean.valueOf(readonly).booleanValue());
            }
        }

        if (actionListener != null)
        {
            if (isValueReference(actionListener))
            {
                MethodBinding actionListenerBinding = app.createMethodBinding(
                        actionListener, new Class[] { ActionEvent.class });
                schedule.setActionListener(actionListenerBinding);
            }
            else
            {
                throw new IllegalArgumentException(
                        "actionListener property must be a method-binding expression.");
            }
        }

        if (action != null)
        {
            if (isValueReference(action))
            {
                MethodBinding actionBinding = app.createMethodBinding(action,
                        new Class[] { ActionEvent.class });
                schedule.setAction(actionBinding);
            }
            else
            {
                throw new IllegalArgumentException(
                        "action property must be a method-binding expression.");
            }
        }

        if ((value != null) && isValueReference(value))
        {
            schedule.setValueBinding("value", app.createValueBinding(value));
        }
        else
        {
            throw new IllegalArgumentException(
                    "The value property must be a value binding expression that points to a SimpleScheduleModel object.");
View Full Code Here

  public Converter getConverter() {
    Converter converter = super.getConverter();
    if (converter == null) {
      // setting required default converter
      Application application
          = FacesContext.getCurrentInstance().getApplication();
      DateTimeConverter dateTimeConverter
          = (DateTimeConverter) application.createConverter(CONVERTER_ID);
      dateTimeConverter.setPattern("HH:mm");
      dateTimeConverter.setTimeZone(TimeZone.getDefault());
      setConverter(dateTimeConverter);
    }
    return converter;
View Full Code Here

      if (labelText ==null) {
        labelText = attributes.get(ATTR_LABEL);
      }

      if (labelText != null) {
        Application application = FacesContext.getCurrentInstance().getApplication();
        label = application.createComponent(UIOutput.COMPONENT_TYPE);
        label.setRendererType(RENDERER_TYPE_LABEL);
        String idprefix = ComponentUtil.getComponentId(facesContext, component);
        label.setId(idprefix + "_" + FACET_LABEL);
        label.setRendered(true);
View Full Code Here

  }

  public static void setConverter(ValueHolder valueHolder, String converterId) {
    if (converterId != null && valueHolder.getConverter() == null) {
      final FacesContext facesContext = FacesContext.getCurrentInstance();
      final Application application = facesContext.getApplication();
      if (UIComponentTag.isValueReference(converterId)) {
        ValueBinding valueBinding = application.createValueBinding(converterId);
        if (valueHolder instanceof UIComponent) {
          ((UIComponent) valueHolder).setValueBinding(ATTR_CONVERTER, valueBinding);
        }
      } else {
        Converter converter = application.createConverter(converterId);
        valueHolder.setConverter(converter);
      }
    }
  }
View Full Code Here

  }
 
  public static void setAction(UICommand component, String type, String action) {
    String commandType;
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final Application application = facesContext.getApplication();
    if (type != null && UIComponentTag.isValueReference(type)) {
      commandType = (String) application.createValueBinding(type).getValue(facesContext);
    } else {
      commandType = type;
    }
    if (commandType != null
        && (commandType.equals(COMMAND_TYPE_NAVIGATE)
          || commandType.equals(COMMAND_TYPE_RESET)
          || commandType.equals(COMMAND_TYPE_SCRIPT))) {
      if (commandType.equals(COMMAND_TYPE_NAVIGATE)) {
        setStringProperty(component, ATTR_ACTION_LINK, action);
      } else if (commandType.equals(COMMAND_TYPE_SCRIPT)) {
        setStringProperty(component, ATTR_ACTION_ONCLICK, action);
      } else {
        LOG.warn("Type reset is not supported");
      }
    } else {
      if (action != null) {
        if (UIComponentTag.isValueReference(action)) {
          MethodBinding binding = application.createMethodBinding(action, null);
          component.setAction(binding);
        } else {
          component.setAction(new ConstantMethodBinding(action));
        }
      }
View Full Code Here

    }
  }
 
  public static void setActionListener(ActionSource command, String actionListener) {
    final FacesContext facesContext = FacesContext.getCurrentInstance();
    final Application application = facesContext.getApplication();
    if (actionListener != null) {
      if (UIComponentTag.isValueReference(actionListener)) {
        MethodBinding binding
            = application.createMethodBinding(actionListener, ACTION_LISTENER_ARGS);
        command.setActionListener(binding);
      } else {
        throw new IllegalArgumentException(
            "Must be a valueReference (actionListener): " + actionListener);
      }
View Full Code Here

    }
  }

  public static void setValueChangeListener(EditableValueHolder valueHolder, String valueChangeListener) {
     final FacesContext facesContext = FacesContext.getCurrentInstance();
     final Application application = facesContext.getApplication();
     if (valueChangeListener != null) {
       if (UIComponentTag.isValueReference(valueChangeListener)) {
         MethodBinding binding
             = application.createMethodBinding(valueChangeListener, VALUE_CHANGE_LISTENER_ARGS);
         valueHolder.setValueChangeListener(binding);
       } else {
         throw new IllegalArgumentException(
             "Must be a valueReference (valueChangeListener): " + valueChangeListener);
       }
View Full Code Here

TOP

Related Classes of javax.faces.application.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.