本文整理匯總了Java中com.ibm.xsp.convert.DateTimeConverter.getType方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTimeConverter.getType方法的具體用法?Java DateTimeConverter.getType怎麽用?Java DateTimeConverter.getType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.ibm.xsp.convert.DateTimeConverter
的用法示例。
在下文中一共展示了DateTimeConverter.getType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: valueFor
import com.ibm.xsp.convert.DateTimeConverter; //導入方法依賴的package包/類
public static PickerType valueFor(final FacesContext context, final UIComponent component) {
DateTimeConverter converter = (DateTimeConverter)((UIInput)component).getConverter();
String type = converter.getType();
if("date".equals(type)) {
return DATE;
} else if("time".equals(type)) {
return TIME;
} else {
return DATETIME;
}
}
示例2: getValueType
import com.ibm.xsp.convert.DateTimeConverter; //導入方法依賴的package包/類
private int getValueType(UIInput uiInput) {
DateTimeConverter converter = (DateTimeConverter) uiInput.getConverter();
// Find what should be used: date, time or both
// Default is both...
String dateType = converter.getType();
int type = TYPE_TIMESTAMP;
if(StringUtil.isNotEmpty(dateType)) {
if(dateType.equals(DateTimeConverter.TYPE_DATE)) {
type = TYPE_DATE;
} else if(dateType.equals(DateTimeConverter.TYPE_TIME)) {
type = TYPE_TIME;
}
}
return type;
}
示例3: generateClientSideConverter
import com.ibm.xsp.convert.DateTimeConverter; //導入方法依賴的package包/類
/**
* Implements {@link ClientSideConverter#generateClientSideConverter(FacesContext, UIComponent)}
*/
public String generateClientSideConverter(FacesContext context, UIComponent component) {
UIInput input = (UIInput) component;
DateTimeConverter converter = (DateTimeConverter) input.getConverter();
String dateType = converter.getType();
int valueType = TYPE_TIMESTAMP;
if(StringUtil.isNotEmpty(dateType)) {
if(dateType.equals(DateTimeConverter.TYPE_DATE)) {
valueType = TYPE_DATE;
} else if(dateType.equals(DateTimeConverter.TYPE_TIME)) {
valueType = TYPE_TIME;
}
}
// TODO in 9.0.2, should update this to handle message changes for SPR#MKEE7TXMLG
String message;
if( TYPE_DATE == valueType ){
message = getMessageDate();
}else if( TYPE_TIME == valueType ){
message = getMessageTime();
}else{
message = getMessageBoth();
}
DojoModuleResource module;
StringBuilder builder = new StringBuilder();
switch(valueType){
case TYPE_DATE:{
module = ISO_DATE_CONVERTER_MODULE;
builder.append("new extlib.date.IsoDateConverter({message:"); //$NON-NLS-1$
JavaScriptUtil.addMessage(builder, message);
builder.append("})"); //$NON-NLS-1$
break;
}
case TYPE_TIME:{
module = ISO_TIME_CONVERTER_MODULE;
builder.append("new extlib.date.IsoTimeConverter({message:"); //$NON-NLS-1$
JavaScriptUtil.addMessage(builder, message);
builder.append("})"); //$NON-NLS-1$
break;
}
default:{// TYPE_TIMESTAMP
module = ISO_DATE_TIME_CONVERTER_MODULE;
builder.append("new extlib.date.IsoDateTimeConverter({message:"); //$NON-NLS-1$
JavaScriptUtil.addMessage(builder, message);
builder.append("})"); //$NON-NLS-1$
break;
}
}
if( null != module ){
UIViewRootEx rootEx = (UIViewRootEx) context.getViewRoot();
rootEx.addEncodeResource(context,module);
}
return builder.toString();
}