本文整理汇总了Java中org.apache.wicket.util.value.IValueMap.put方法的典型用法代码示例。如果您正苦于以下问题:Java IValueMap.put方法的具体用法?Java IValueMap.put怎么用?Java IValueMap.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.value.IValueMap
的用法示例。
在下文中一共展示了IValueMap.put方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
@Override
public void onComponentTag(Component component, ComponentTag tag) {
super.onComponentTag(component, tag);
IValueMap attributes = tag.getAttributes();
addAttribute(component, attributes, ATTRIBUTE_TITLE, titleModel);
addAttribute(component, attributes, ATTRIBUTE_TEXT, textModel);
addAttribute(component, attributes, ATTRIBUTE_YES_LABEL, yesLabelModel);
addAttribute(component, attributes, ATTRIBUTE_NO_LABEL, noLabelModel);
addAttribute(component, attributes, ATTRIBUTE_YES_ICON, yesIconModel);
addAttribute(component, attributes, ATTRIBUTE_NO_ICON, noIconModel);
addAttribute(component, attributes, ATTRIBUTE_YES_BUTTON, yesButtonModel);
addAttribute(component, attributes, ATTRIBUTE_NO_BUTTON, noButtonModel);
addAttribute(component, attributes, ATTRIBUTE_CSS_CLASS_NAMES, cssClassNamesModel);
if (textNoEscape) {
attributes.put(ATTRIBUTE_TEXT_NO_ESCAPE, textNoEscape);
}
}
示例2: replaceAttributeValue
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
private void replaceAttributeValue(ComponentTag tag) {
if (removeModel != null && removeModel.getObject() != VALUELESS_ATTRIBUTE) {
final IValueMap tagAttributes = tag.getAttributes();
Object attributeValue = tagAttributes.get(attribute);
List<String> valuesToRemove = getClassesToRemove();
if (attributeValue != null && !valuesToRemove.isEmpty()) {
List<String> values = Arrays.asList(attributeValue.toString().split(separator));
StringBuilder newAttributeValue = new StringBuilder();
for (String value : values) {
if (!valuesToRemove.contains(value)) {
newAttributeValue.append(value).append(separator);
}
}
tagAttributes.put(attribute, newAttributeValue);
}
}
}
示例3: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void onComponentTag(final ComponentTag tag) {
checkComponentTag(tag, "select");
super.onComponentTag(tag);
final IValueMap attrs = tag.getAttributes();
attrs.put("multiple", "multiple");
attrs.put("size", getPalette().getRows());
if (!palette.isPaletteEnabled()) {
attrs.put("disabled", "disabled");
}
avoidAjaxSerialization();
}
示例4: replaceAttributeValue
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
/**
* Checks the given component tag for an instance of the attribute to modify
* and if all criteria are met then replace the value of this attribute with
* the value of the contained model object.
*
* @param component The component
* @param tag The tag to replace the attribute value for
*/
private void replaceAttributeValue(final Component component, final ComponentTag tag) {
if (isEnabled(component)) {
final IValueMap attributes = tag.getAttributes();
final Object replacementValue = getReplacementOrNull(component);
if (VALUELESS_ATTRIBUTE_ADD == replacementValue) {
attributes.put(attribute, null);
} else if (VALUELESS_ATTRIBUTE_REMOVE == replacementValue) {
attributes.remove(attribute);
} else {
final String value = toStringOrNull(attributes.get(attribute));
final String newValue = newValue(value, toStringOrNull(replacementValue));
if (newValue != null) {
attributes.put(attribute, newValue);
}
}
}
}
示例5: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
@Override
public void onComponentTag(Component component, ComponentTag tag) {
super.onComponentTag(component, tag);
IValueMap attributes = tag.getAttributes();
attributes.put("data-header-selector", "#" + header.getMarkupId());
attributes.put("data-footer-selector", "#" + footer.getMarkupId());
}
示例6: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
final IValueMap attrs = tag.getAttributes();
final String onFocus = getPalette().getSelectionOnFocusJS();
if (onFocus != null) {
attrs.put("onfocus", onFocus);
}
tag.getAttributes().put("ondblclick", getPalette().getRemoveOnClickJS());
}
示例7: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
final IValueMap attrs = tag.getAttributes();
final String onFocus = getPalette().getChoicesOnFocusJS();
if (onFocus != null) {
attrs.put("onfocus", onFocus);
}
tag.getAttributes().put("ondblclick", getPalette().getAddOnClickJS());
}
示例8: onComponentTag
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
public void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
// get the attributes from the html-source
IValueMap attributeMap = tag.getAttributes();
// set the content type
String contentType = getContentType();
if (contentType != null && !"".equals(contentType))
attributeMap.put(ATTRIBUTE_CONTENTTYPE, contentType);
// set clsid and codebase for IE
if (getClientProperties().isBrowserInternetExplorer()) {
String clsid = getClsid();
String codeBase = getCodebase();
if (clsid != null && !"".equals(clsid))
attributeMap.put(ATTRIBUTE_CLASSID, clsid);
if (codeBase != null && !"".equals(codeBase))
attributeMap.put(ATTRIBUTE_CODEBASE, codeBase);
}
// add all attributes
for (String name : getAttributeNames()) {
String value = getValue(name);
if (value != null)
attributeMap.put(name, value);
}
}
示例9: addAttribute
import org.apache.wicket.util.value.IValueMap; //导入方法依赖的package包/类
private void addAttribute(Component component, IValueMap attributes, String attributeName, IModel<String> model) {
String label = getLabel(component, model);
if (label != null) {
attributes.put(attributeName, label);
}
}