Examples of UICalendar


Examples of org.apache.myfaces.tobago.component.UICalendar

    final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
        facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
    box.getFacets().put(Facets.LAYOUT, layoutOfBox);
    layoutOfBox.setRows("*;auto;auto");

    final UICalendar calendar = (UICalendar) CreateComponentUtils.createComponent(
        facesContext, UICalendar.COMPONENT_TYPE, RendererTypes.CALENDAR, "calendar");
    box.getChildren().add(calendar);

     // fixme: should work automatically from the layout manager
    final Measure width = getResourceManager().getThemeMeasure(facesContext, calendar, "minimumWidth");
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

public class CalendarRenderer extends LayoutComponentRendererBase {

  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    UICalendar output = (UICalendar) component;
    String id = output.getClientId(facesContext);

    Locale locale = facesContext.getViewRoot().getLocale();

    Object value = output.getValue();
    Calendar calendar;
    if (value instanceof Calendar) {
      calendar = (Calendar) value;
    } else {
      calendar = new GregorianCalendar();
      if (value instanceof Date) {
        calendar.setTime((Date) value);
      }
    }
    CalendarModel model = new CalendarModel(calendar);

    // rendering
    TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, component);
    writer.writeIdAttribute(id);
    writer.writeClassAttribute(Classes.create(output));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
    Style style = new Style(facesContext, output);
    writer.writeStyleAttribute(style);
    String dateInputId = (String) output.getAttributes().get(Attributes.DATE_INPUT_ID);
    if (dateInputId != null) {
      writer.writeAttribute(DataAttributes.DATE_INPUT_ID, dateInputId, false);
    }
    writer.writeAttribute(DataAttributes.DAY, Integer.toString(calendar.get(Calendar.YEAR)), false);
    writer.writeAttribute(DataAttributes.MONTH, Integer.toString(1 + calendar.get(Calendar.MONTH)), false);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

  }

  @Override
  protected void setProperties(final UIComponent uiComponent) {
    super.setProperties(uiComponent);
    final UICalendar component = (UICalendar) uiComponent;
    final FacesContext context = FacesContext.getCurrentInstance();
    final Application application = context.getApplication();
    if (markup != null) {
      if (!markup.isLiteralText()) {
        component.setValueExpression("markup", markup);
      } else {
        component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
      }
    }
    if (value != null) {
      if (!value.isLiteralText()) {
        component.setValueExpression("value", value);
      /*} else {
        component.setValue(value.getExpressionString());*/
      }
    }
  }
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

    final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
        facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
    box.getFacets().put(Facets.LAYOUT, layoutOfBox);
    layoutOfBox.setRows("*;auto;auto");

    final UICalendar calendar = (UICalendar) CreateComponentUtils.createComponent(
        facesContext, UICalendar.COMPONENT_TYPE, RendererTypes.CALENDAR, "calendar");
    box.getChildren().add(calendar);

     // fixme: should work automatically from the layout manager
    final Measure width = getResourceManager().getThemeMeasure(facesContext, calendar, "minimumWidth");
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar


  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    UICalendar output = (UICalendar) component;
    String id = output.getClientId(facesContext);
    String dateTextBoxId = (String) component.getAttributes().get(Attributes.DATE_INPUT_ID);

    if (LOG.isDebugEnabled()) {
      LOG.debug("dateTextBoxId = '" + dateTextBoxId + "'");
    }

    Locale locale = facesContext.getViewRoot().getLocale();
    SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM yyyy", locale);

    Object value = output.getValue();
    Calendar calendar;
    if (value instanceof Calendar) {
      calendar = (Calendar) value;
    } else {
      calendar = new GregorianCalendar();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar


  @Override
  public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {

    UICalendar output = (UICalendar) component;
    String id = output.getClientId(facesContext);
    String dateTextBoxId = (String) component.getAttributes().get(Attributes.DATE_INPUT_ID);

    if (LOG.isDebugEnabled()) {
      LOG.debug("dateTextBoxId = '" + dateTextBoxId + "'");
    }

    Locale locale = facesContext.getViewRoot().getLocale();
    SimpleDateFormat dateFormat = new SimpleDateFormat("MMMMM yyyy", locale);

    Object value = output.getValue();
    Calendar calendar;
    if (value instanceof Calendar) {
      calendar = (Calendar) value;
    } else {
      calendar = new GregorianCalendar();
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

    final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
        facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
    box.getFacets().put(Facets.LAYOUT, layoutOfBox);
    layoutOfBox.setRows("*;auto;auto");

    final UICalendar calendar = (UICalendar) CreateComponentUtils.createComponent(
        facesContext, UICalendar.COMPONENT_TYPE, RendererTypes.CALENDAR, "calendar");
    box.getChildren().add(calendar);

     // fixme: should work automatically from the layout manager
    final Measure width = getResourceManager().getThemeMeasure(facesContext, calendar, "minimumWidth");
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

public class CalendarRenderer extends LayoutComponentRendererBase {

  @Override
  public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {

    final UICalendar output = (UICalendar) component;
    final String id = output.getClientId(facesContext);

    final Locale locale = facesContext.getViewRoot().getLocale();

    final Object value = output.getValue();
    final Calendar calendar;
    if (value instanceof Calendar) {
      calendar = (Calendar) value;
    } else {
      calendar = new GregorianCalendar();
      if (value instanceof Date) {
        calendar.setTime((Date) value);
      }
    }
    final CalendarModel model = new CalendarModel(calendar);

    // rendering
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, component);
    writer.writeIdAttribute(id);
    writer.writeClassAttribute(Classes.create(output));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
    final Style style = new Style(facesContext, output);
    writer.writeStyleAttribute(style);
    final String dateInputId = (String) output.getAttributes().get(Attributes.DATE_INPUT_ID);
    if (dateInputId != null) {
      writer.writeAttribute(DataAttributes.DATE_INPUT_ID, dateInputId, false);
    }
    writer.writeAttribute(DataAttributes.DAY, Integer.toString(calendar.get(Calendar.YEAR)), false);
    writer.writeAttribute(DataAttributes.MONTH, Integer.toString(1 + calendar.get(Calendar.MONTH)), false);
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

    final UIGridLayout layoutOfBox = (UIGridLayout) CreateComponentUtils.createComponent(
        facesContext, UIGridLayout.COMPONENT_TYPE, RendererTypes.GRID_LAYOUT, "layout");
    box.getFacets().put(Facets.LAYOUT, layoutOfBox);
    layoutOfBox.setRows("*;auto;auto");

    final UICalendar calendar = (UICalendar) CreateComponentUtils.createComponent(
        facesContext, UICalendar.COMPONENT_TYPE, RendererTypes.CALENDAR, "calendar");
    box.getChildren().add(calendar);

     // fixme: should work automatically from the layout manager
    final Measure width = getResourceManager().getThemeMeasure(facesContext, calendar, "minimumWidth");
View Full Code Here

Examples of org.apache.myfaces.tobago.component.UICalendar

public class CalendarRenderer extends LayoutComponentRendererBase {

  @Override
  public void encodeEnd(final FacesContext facesContext, final UIComponent component) throws IOException {

    final UICalendar output = (UICalendar) component;
    final String id = output.getClientId(facesContext);

    final Locale locale = facesContext.getViewRoot().getLocale();

    final Object value = output.getValue();
    final Calendar calendar;
    if (value instanceof Calendar) {
      calendar = (Calendar) value;
    } else {
      calendar = new GregorianCalendar();
      if (value instanceof Date) {
        calendar.setTime((Date) value);
      }
    }
    final CalendarModel model = new CalendarModel(calendar);

    // rendering
    final TobagoResponseWriter writer = HtmlRendererUtils.getTobagoResponseWriter(facesContext);

    writer.startElement(HtmlElements.DIV, component);
    writer.writeIdAttribute(id);
    writer.writeClassAttribute(Classes.create(output));
    HtmlRendererUtils.writeDataAttributes(facesContext, writer, component);
    final Style style = new Style(facesContext, output);
    writer.writeStyleAttribute(style);
    final String dateInputId = (String) output.getAttributes().get(Attributes.DATE_INPUT_ID);
    if (dateInputId != null) {
      writer.writeAttribute(DataAttributes.DATE_INPUT_ID, dateInputId, false);
    }
    writer.writeAttribute(DataAttributes.DAY, Integer.toString(calendar.get(Calendar.YEAR)), false);
    writer.writeAttribute(DataAttributes.MONTH, Integer.toString(1 + calendar.get(Calendar.MONTH)), false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.