List of usage examples for com.google.gwt.user.datepicker.client DatePicker setStyleName
@Override public void setStyleName(String styleName)
From source file:org.jbpm.form.builder.ng.model.client.form.items.CalendarFormItem.java
License:Apache License
private void populate(DatePicker calendar, TextBox text, Image icon) { if (getHeight() != null && !"".equals(getHeight())) { calendar.setHeight(getHeight()); }// w ww .ja v a 2s .c o m if (getWidth() != null && !"".equals(getWidth())) { calendar.setWidth(getWidth()); } if (this.defaultValue != null) { if (!"".equals(this.defaultValue)) { calendar.setValue(format.parse(this.defaultValue)); } else { calendar.setValue(null); } } if (this.calendarCss != null && !"".equals(this.calendarCss)) { calendar.setStyleName(this.calendarCss); } if (this.iconUrl != null && !"".equals(this.iconUrl)) { icon.setUrl(this.iconUrl); } String cursor = icon.getElement().getStyle().getCursor(); if (!Style.Cursor.POINTER.getCssName().equals(cursor)) { icon.getElement().getStyle().setCursor(Style.Cursor.POINTER); } }
From source file:org.jbpm.form.builder.ng.model.client.form.items.CalendarFormItem.java
License:Apache License
@Override public Widget cloneDisplay(Map<String, Object> data) { DatePicker date = new DatePicker(); TextBox textBox = new TextBox(); final PopupPanel panel = new PopupPanel(); DatePicker calendar = new DatePicker(); if (this.calendarCss != null && !"".equals(this.calendarCss)) { calendar.setStyleName(this.calendarCss); }/*from w w w . j a v a2 s . c om*/ panel.setSize("183px", "183px"); panel.setWidget(calendar); Image icon = new Image(); icon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { panel.setPopupPosition(event.getClientX(), event.getClientY()); panel.show(); } }); populate(date, textBox, icon); CalendarPanel display = new CalendarPanel(textBox, icon); Object input = getInputValue(data); if (input != null) { textBox.setValue(input.toString()); } if (getOutput() != null && getOutput().get("name") != null) { textBox.setName(String.valueOf(getOutput().get("name"))); } super.populateActions(textBox.getElement()); return display; }
From source file:org.jbpm.formbuilder.client.form.items.CalendarFormItem.java
License:Apache License
@Override public Widget cloneDisplay(Map<String, Object> data) { DatePicker date = new DatePicker(); TextBox textBox = new TextBox(); final PopupPanel panel = new PopupPanel(); DatePicker calendar = new DatePicker(); if (this.calendarCss != null && !"".equals(this.calendarCss)) { calendar.setStyleName(this.calendarCss); }/*from w ww. j ava 2 s.c o m*/ panel.setSize("183px", "183px"); panel.setWidget(calendar); Image icon = new Image(); icon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { panel.setPopupPosition(event.getClientX(), event.getClientY()); panel.show(); } }); populate(date, textBox, icon); CalendarPanel display = new CalendarPanel(textBox, icon); Object input = getInputValue(data); if (input != null) { textBox.setValue(input.toString()); } if (getOutput() != null && getOutput().getName() != null) { textBox.setName(getOutput().getName()); } super.populateActions(textBox.getElement()); return display; }