本文整理汇总了Java中org.kuali.rice.krad.uif.field.MessageField类的典型用法代码示例。如果您正苦于以下问题:Java MessageField类的具体用法?Java MessageField怎么用?Java MessageField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MessageField类属于org.kuali.rice.krad.uif.field包,在下文中一共展示了MessageField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: performInitialization
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void performInitialization(Object model) {
CollectionGroup collectionGroup = (CollectionGroup) ViewLifecycle.getPhase().getElement();
if (Boolean.TRUE.equals(collectionGroup.getReadOnly())) {
getAddLineGroup().setReadOnly(true);
actionFieldPrototype.setReadOnly(true);
}
this.setupDetails(collectionGroup);
this.setupGrouping(model, collectionGroup);
if (collectionGroup.isAddWithDialog()) {
setSeparateAddLine(true);
}
super.performInitialization(model);
getRowCssClasses().clear();
if (generateAutoSequence && !(getSequenceFieldPrototype() instanceof MessageField)) {
sequenceFieldPrototype = ComponentFactory.getMessageField();
}
}
示例2: performInitialization
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* The following actions are performed:
*
* <ul>
* <li>Sets sequence field prototype if auto sequence is true</li>
* <li>Initializes the prototypes</li>
* </ul>
*
* @see org.kuali.rice.krad.uif.layout.BoxLayoutManager#performInitialization(org.kuali.rice.krad.uif.view.View,
* java.lang.Object, org.kuali.rice.krad.uif.container.Container)
*/
@Override
public void performInitialization(View view, Object model, Container container) {
CollectionGroup collectionGroup = (CollectionGroup) container;
this.setupDetails(collectionGroup, view);
this.setupGrouping(collectionGroup, view);
if (collectionGroup.isAddViaLightBox()) {
setSeparateAddLine(true);
}
super.performInitialization(view, model, container);
getRowCssClasses().clear();
if (generateAutoSequence && !(getSequenceFieldPrototype() instanceof MessageField)) {
sequenceFieldPrototype = ComponentFactory.getMessageField();
view.assignComponentIds(getSequenceFieldPrototype());
}
}
示例3: addSequenceColumn
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Adds the sequence column to the given column collector.
*
* <p>Sequence column is created with a new message component for the add line, and by copying
* {@link org.kuali.rice.krad.uif.layout.TableLayoutManager#getSequenceFieldPrototype()} for existing rows.</p>
*
* @param columnCollector object collecting the columns for the row
*/
protected void addSequenceColumn(ColumnCollector columnCollector) {
Field sequenceField;
if (lineBuilderContext.isAddLine()) {
sequenceField = ComponentFactory.getMessageField();
Message sequenceMessage = ComponentUtils.copy(collectionGroup.getAddLineLabel(),
lineBuilderContext.getIdSuffix());
((MessageField) sequenceField).setMessage(sequenceMessage);
} else {
sequenceField = ComponentUtils.copy(tableLayoutManager.getSequenceFieldPrototype(),
lineBuilderContext.getIdSuffix());
// ignore in validation processing
sequenceField.addDataAttribute(UifConstants.DataAttributes.VIGNORE, "yes");
if (tableLayoutManager.isGenerateAutoSequence() && (sequenceField instanceof MessageField)) {
((MessageField) sequenceField).setMessageText(Integer.toString(lineBuilderContext.getLineIndex() + 1));
}
if (sequenceField instanceof DataBinding) {
((DataBinding) sequenceField).getBindingInfo().setBindByNamePrefix(lineBuilderContext.getBindingPath());
}
}
// TODO: needed to convert full layout logic to use the builder
// sequenceField.setRowSpan(rowSpan);
// setCellAttributes(sequenceField);
ContextUtils.updateContextForLine(sequenceField, collectionGroup, lineBuilderContext.getCurrentLine(),
lineBuilderContext.getLineIndex(), lineBuilderContext.getIdSuffix());
columnCollector.addColumn(sequenceField);
}
示例4: addGroupingColumn
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Adds the grouping column to the given column collector.
*
* <p>The grouping column is used when table grouping is on to render a header for the group. The data
* tables plugin will pull the value from this column and render the header row.</p>
*
* @param columnCollector object collecting the columns for the row
*/
protected void addGroupingColumn(ColumnCollector columnCollector) {
// no grouping on add line, so just add blank field
if (lineBuilderContext.isAddLine()) {
SpaceField spaceField = ComponentFactory.getSpaceField();
columnCollector.addColumn(spaceField);
return;
}
MessageField groupingMessageField = ComponentFactory.getColGroupingField();
StringBuilder groupingTitle = new StringBuilder();
if (StringUtils.isNotBlank(tableLayoutManager.getGroupingTitle())) {
groupingTitle.append(tableLayoutManager.getGroupingTitle());
} else if (tableLayoutManager.getGroupingPropertyNames() != null) {
for (String propertyName : tableLayoutManager.getGroupingPropertyNames()) {
Object propertyValue = ObjectPropertyUtils.getPropertyValue(lineBuilderContext.getCurrentLine(),
propertyName);
if (propertyValue == null) {
propertyValue = "Null";
}
if (groupingTitle.length() != 0) {
groupingTitle.append(", ");
}
groupingTitle.append(propertyValue);
}
}
groupingMessageField.setMessageText(groupingTitle.toString());
groupingMessageField.addDataAttribute(UifConstants.DataAttributes.ROLE, UifConstants.RoleTypes.ROW_GROUPING);
columnCollector.addColumn(groupingMessageField);
}
示例5: setupGrouping
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Sets up the grouping MessageField to be used in the first column of the table layout for
* grouping collection content into groups based on values of the line's fields.
*
* @param model The model for the active lifecycle
* @param collectionGroup collection group for this layout
*/
protected void setupGrouping(Object model, CollectionGroup collectionGroup) {
String groupingTitleExpression = "";
if (StringUtils.isNotBlank(this.getPropertyExpression(UifPropertyPaths.GROUPING_TITLE))) {
groupingTitleExpression = this.getPropertyExpression(UifPropertyPaths.GROUPING_TITLE);
this.setGroupingTitle(this.getPropertyExpression(UifPropertyPaths.GROUPING_TITLE));
} else if (this.getGroupingPropertyNames() != null) {
for (String propertyName : this.getGroupingPropertyNames()) {
groupingTitleExpression = groupingTitleExpression + ", " + propertyName;
}
groupingTitleExpression = groupingTitleExpression.replaceFirst(", ",
"@{" + UifConstants.LINE_PATH_BIND_ADJUST_PREFIX);
groupingTitleExpression = groupingTitleExpression.replace(", ",
"}, @{" + UifConstants.LINE_PATH_BIND_ADJUST_PREFIX);
groupingTitleExpression = groupingTitleExpression.trim() + "}";
}
if (StringUtils.isNotBlank(groupingTitleExpression)) {
MessageField groupingMessageField = ComponentFactory.getColGroupingField();
groupingMessageField.getMessage().getPropertyExpressions().put(UifPropertyPaths.MESSAGE_TEXT,
groupingTitleExpression);
groupingMessageField.addDataAttribute(UifConstants.DataAttributes.ROLE,
UifConstants.RoleTypes.ROW_GROUPING);
List<Component> theItems = new ArrayList<Component>();
theItems.add(groupingMessageField);
theItems.addAll(collectionGroup.getItems());
collectionGroup.setItems(theItems);
}
}
示例6: setupGrouping
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Sets up the grouping MessageField to be used in the first column of the table layout for grouping
* collection content into groups based on values of the line's fields
*
* @param collectionGroup collection group for this layout
* @param view the view
*/
private void setupGrouping(CollectionGroup collectionGroup, View view) {
//Grouping setup
String groupingTitleExpression = "";
if (StringUtils.isNotBlank(this.getPropertyExpression("groupingTitle"))) {
groupingTitleExpression = this.getPropertyExpression("groupingTitle");
this.setGroupingTitle(this.getPropertyExpression("groupingTitle"));
} else if (this.getGroupingPropertyNames() != null) {
for (String propertyName : this.getGroupingPropertyNames()) {
groupingTitleExpression = groupingTitleExpression + ", " + propertyName;
}
groupingTitleExpression = groupingTitleExpression.replaceFirst(", ", "@{#lp.");
groupingTitleExpression = groupingTitleExpression.replace(", ", "}, @{#lp.");
groupingTitleExpression = groupingTitleExpression.trim() + "}";
}
if (StringUtils.isNotBlank(groupingTitleExpression)) {
MessageField groupingMessageField = ComponentFactory.getColGroupingField();
groupingMessageField.getMessage().getPropertyExpressions().put("messageText", groupingTitleExpression);
groupingMessageField.setLabel("Group");
view.assignComponentIds(groupingMessageField);
List<Component> theItems = new ArrayList<Component>();
theItems.add(groupingMessageField);
theItems.addAll(collectionGroup.getItems());
collectionGroup.setItems(theItems);
}
}
示例7: getPrompt
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Message component to use for the dialog prompt.
*
* @return Message component for prompt
*/
@ViewLifecycleRestriction
@BeanTagAttribute
public MessageField getPrompt() {
return prompt;
}
示例8: setPrompt
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* @see DialogGroup#getPrompt()
*/
public void setPrompt(MessageField prompt) {
this.prompt = prompt;
}
示例9: getSimpleFieldValue
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Attempts to extract a string value out of the field passed in, varies depending on field type
*
* <p>If the field is a dataField, it will use its propertyName to retrieve a value, otherwise it will try to
* retrieve textual content out of various component types. If the field is a FieldGroup, only the first
* component's determined value will be used. This function is used for sorting.</p>
*
* @param model the current model
* @param field the field to get a value from
* @return the field's String value, false if it cant be determined
*/
public static String getSimpleFieldValue(Object model, Field field) {
if (field == null) {
return null;
}
String value = null;
// check for what type of field this is
if (field instanceof DataField) {
String propertyPath = ((DataField) field).getBindingInfo().getBindingPath();
Object valueObject = null;
if (field.isHidden()) {
return "";
}
// check if readable
if (ObjectPropertyUtils.isReadableProperty(model, propertyPath)) {
valueObject = ObjectPropertyUtils.getPropertyValueAsText(model, propertyPath);
}
// use object's string value
if (valueObject != null && !((DataField) field).isApplyMask()) {
value = valueObject.toString();
} else if (valueObject != null && ((DataField) field).isApplyMask()) {
value = ((DataField) field).getMaskFormatter().maskValue(valueObject);
}
} else if (field instanceof ActionField) {
value = ((ActionField) field).getActionLabel();
// use image alt text if any
if (StringUtils.isBlank(value) && ((ActionField) field).getActionImage() != null) {
value = ((ActionField) field).getActionImage().getAltText();
}
} else if (field instanceof LinkField) {
value = ((LinkField) field).getLinkText();
} else if (field instanceof ImageField) {
value = ((ImageField) field).getAltText();
} else if (field instanceof MessageField && ((MessageField) field).getMessage() != null) {
value = ((MessageField) field).getMessage().getMessageText();
} else if (field instanceof SpaceField) {
value = "";
} else if (field instanceof FieldGroup
&& ((FieldGroup) field).getGroup() != null
&& ((FieldGroup) field).getGroup().getItems() != null
&& !((FieldGroup) field).getGroup().getItems().isEmpty()) {
// using first components type for assumed value
Component firstComponent = ((FieldGroup) field).getGroup().getItems().get(0);
// check first component type to extract value
if (firstComponent != null && firstComponent instanceof Field) {
value = getSimpleFieldValue(model, (Field) firstComponent);
} else if (firstComponent instanceof Action && StringUtils.isNotBlank(
((Action) firstComponent).getActionLabel())) {
value = ((Action) firstComponent).getActionLabel();
} else if (firstComponent instanceof Action && ((Action) firstComponent).getActionImage() != null) {
value = ((Action) firstComponent).getActionImage().getAltText();
} else if (firstComponent instanceof Link) {
value = ((Link) firstComponent).getLinkText();
} else if (firstComponent instanceof Image) {
value = ((Image) firstComponent).getAltText();
} else if (firstComponent instanceof org.kuali.rice.krad.uif.element.Message) {
value = ((org.kuali.rice.krad.uif.element.Message) firstComponent).getMessageText();
} else {
value = null;
}
}
return value;
}
示例10: getSimpleFieldValue
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Attempts to extract a string value out of the field passed in, varies depending on field type
*
* <p>If the field is a dataField, it will use its propertyName to retrieve a value, otherwise it will try to
* retrieve textual content out of various component types. If the field is a FieldGroup, only the first
* component's determined value will be used. This function is used for sorting.</p>
*
* @param model the current model
* @param field the field to get a value from
* @return the field's String value, false if it cant be determined
*/
public static String getSimpleFieldValue(Object model, Field field) {
if (field == null) {
return null;
}
String value = null;
// check for what type of field this is
if (field instanceof DataField) {
String propertyPath = ((DataField) field).getBindingInfo().getBindingPath();
Object valueObject = null;
// check if readable
if (ObjectPropertyUtils.isReadableProperty(model, propertyPath)){
valueObject = ObjectPropertyUtils.getPropertyValue(model, propertyPath);
}
// use object's string value
if (valueObject != null) {
value = valueObject.toString();
}
} else if (field instanceof ActionField) {
value = ((ActionField) field).getActionLabel();
// use image alt text if any
if (StringUtils.isBlank(value) && ((ActionField) field).getActionImage() != null) {
value = ((ActionField) field).getActionImage().getAltText();
}
} else if (field instanceof LinkField) {
value = ((LinkField) field).getLinkText();
} else if (field instanceof ImageField) {
value = ((ImageField) field).getAltText();
} else if (field instanceof MessageField && ((MessageField) field).getMessage() != null) {
value = ((MessageField) field).getMessage().getMessageText();
} else if (field instanceof SpaceField) {
value = "";
} else if (field instanceof FieldGroup
&& ((FieldGroup) field).getGroup() != null
&& ((FieldGroup) field).getGroup().getItems() != null
&& !((FieldGroup) field).getGroup().getItems().isEmpty()) {
// using first components type for assumed value
Component firstComponent = ((FieldGroup) field).getGroup().getItems().get(0);
// check first component type to extract value
if (firstComponent != null && firstComponent instanceof Field) {
value = getSimpleFieldValue(model, field);
} else if (firstComponent instanceof Action
&& StringUtils.isNotBlank(((Action) firstComponent).getActionLabel())) {
value = ((Action) firstComponent).getActionLabel();
} else if (firstComponent instanceof Action
&& ((Action) firstComponent).getActionImage() != null) {
value = ((Action) firstComponent).getActionImage().getAltText();
} else if (firstComponent instanceof Link) {
value = ((Link) firstComponent).getLinkText();
} else if (firstComponent instanceof Image) {
value = ((Image) firstComponent).getAltText();
} else if (firstComponent instanceof Message) {
value = ((Message) firstComponent).getText();
} else {
value = null;
}
}
return value;
}
示例11: getMessageField
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Gets the message field
*
* @return message field
*/
public static MessageField getMessageField() {
return (MessageField) getNewComponentInstance(MESSAGE_FIELD);
}
示例12: getColGroupingField
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Gets the collection grouping field
*
* @return message field
*/
public static MessageField getColGroupingField() {
return (MessageField) getNewComponentInstance(COLLECTION_GROUPING_FIELD);
}
示例13: getTotalField
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Gets the totalField. This field is the field which holds the total for the column and specifies its label.
* This SHOULD NOT BE SET except by the base bean (in MOST cases).
*
* @return the totalField
*/
@BeanTagAttribute(name = "totalField", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
public MessageField getTotalField() {
return totalField;
}
示例14: setTotalField
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Sets the totalField. This SHOULD NOT BE SET except by the base bean (in MOST cases). Setting this property
* without the appropriate settings WILL break functionality.
*
* @param totalField
*/
public void setTotalField(MessageField totalField) {
this.totalField = totalField;
}
示例15: getPageTotalField
import org.kuali.rice.krad.uif.field.MessageField; //导入依赖的package包/类
/**
* Gets the pageTotalField. This field is the field which holds the pageTotal for the column
* and specifies its label. This SHOULD NOT BE SET except by the base bean (in MOST cases).
*
* @return the pageTotalField
*/
@BeanTagAttribute(name = "pageTotalField", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
public MessageField getPageTotalField() {
return pageTotalField;
}