当前位置: 首页>>代码示例>>Java>>正文


Java Image类代码示例

本文整理汇总了Java中org.kuali.rice.krad.uif.element.Image的典型用法代码示例。如果您正苦于以下问题:Java Image类的具体用法?Java Image怎么用?Java Image使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Image类属于org.kuali.rice.krad.uif.element包,在下文中一共展示了Image类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addChildExpressions

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Add expressions to the expression map for nested components of specific types
 *
 * @param components the child components
 * @param expressionMap the map to add expressions to
 * @return the map with child component expressions added
 */
protected Map<String, String> addChildExpressions(Collection<? extends LifecycleElement> components,
        Map<String, String> expressionMap) {
    for (LifecycleElement comp : components) {
        if (comp != null && (comp instanceof Action
                || comp instanceof Image
                || comp instanceof Message
                || comp instanceof Link
                || comp instanceof Inquiry
                || comp instanceof Group
                || comp instanceof Tooltip
                || comp instanceof InputField
                || comp instanceof CheckboxControl
                || comp instanceof TextControl
                || comp instanceof SelectControl)) {
            expressionMap = buildExpressionMap((Component) comp, expressionMap);
        }
    }

    return expressionMap;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:LightTable.java

示例2: addChildExpressions

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Add expressions to the expression map for nested components of specific types
 *
 * @param components the child components
 * @param expressionMap the map to add expressions to
 * @return the map with child component expressions added
 */
protected Map<String, String> addChildExpressions(List<? extends Component> components,
        Map<String, String> expressionMap) {
    for (Component comp : components) {
        if (comp != null && (comp instanceof Action
                || comp instanceof Image
                || comp instanceof Message
                || comp instanceof Link
                || comp instanceof Inquiry
                || comp instanceof Group
                || comp instanceof Tooltip
                || comp instanceof InputField
                || comp instanceof CheckboxControl
                || comp instanceof TextControl
                || comp instanceof SelectControl)) {
            expressionMap = buildExpressionMap(comp, expressionMap);
        }
    }

    return expressionMap;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:28,代码来源:LightTable.java

示例3: getSimpleFieldValue

import org.kuali.rice.krad.uif.element.Image; //导入依赖的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;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:81,代码来源:KRADUtils.java

示例4: getActionImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.uif.element.Action#getActionImage()
 */
@BeanTagAttribute(name = "actionImage", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
public Image getActionImage() {
    return action.getActionImage();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:8,代码来源:ActionField.java

示例5: setActionImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.uif.element.Action#setActionImage(org.kuali.rice.krad.uif.element.Image)
 */
public void setActionImage(Image actionImage) {
    action.setActionImage(actionImage);
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:7,代码来源:ActionField.java

示例6: getSimpleFieldValue

import org.kuali.rice.krad.uif.element.Image; //导入依赖的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;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:76,代码来源:KRADUtils.java

示例7: getActionImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Delegates {@code actionImage} property reference to the action.
 * 
 * @return action image
 * @see org.kuali.rice.krad.uif.element.Action#getActionImage()
 */
@ViewLifecycleRestriction
@BeanTagAttribute
public Image getActionImage() {
    return action.getActionImage();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:ActionField.java

示例8: setActionImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Delegates {@code actionImage} property reference to the action.
 * 
 * @param actionImage action image
 * @see org.kuali.rice.krad.uif.element.Action#setActionImage(org.kuali.rice.krad.uif.element.Image)
 */
public void setActionImage(Image actionImage) {
    action.setActionImage(actionImage);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ActionField.java

示例9: getImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Retrieves the {@link Image} element wrapped by this field
 *
 * @return the Image element representing the HTML IMG element
 */
@BeanTagAttribute(type= BeanTagAttribute.AttributeType.DIRECTORBYTYPE)
public Image getImage() {
    return image;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:ImageField.java

示例10: setImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Sets the Image to be wrapped by this field
 *
 * @param image the Image element to be wrapped by this field
 */
public void setImage(Image image) {
    this.image = image;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:ImageField.java

示例11: getImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Gets the image component
 *
 * @return image field
 */
public static Image getImage() {
    return (Image) getNewComponentInstance(IMAGE);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:ComponentFactory.java

示例12: getImage

import org.kuali.rice.krad.uif.element.Image; //导入依赖的package包/类
/**
 * Retrieves the {@link Image} element wrapped by this field
 *
 * @return the Image element representing the HTML IMG element
 */
@BeanTagAttribute(name="image",type= BeanTagAttribute.AttributeType.SINGLEBEAN)
public Image getImage() {
    return image;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:10,代码来源:ImageField.java


注:本文中的org.kuali.rice.krad.uif.element.Image类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。