當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。