當前位置: 首頁>>代碼示例>>Java>>正文


Java ComponentTag.getAttributes方法代碼示例

本文整理匯總了Java中org.apache.wicket.markup.ComponentTag.getAttributes方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentTag.getAttributes方法的具體用法?Java ComponentTag.getAttributes怎麽用?Java ComponentTag.getAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.markup.ComponentTag的用法示例。


在下文中一共展示了ComponentTag.getAttributes方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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);
	}
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:19,代碼來源:ConfirmContentBehavior.java

示例2: replaceAttributeValue

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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);
		}
	}
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:22,代碼來源:AttributeRemover.java

示例3: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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();
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:20,代碼來源:AOptions.java

示例4: replaceAttributeValue

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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);
			}
		}
	}
}
 
開發者ID:U-QASAR,項目名稱:u-qasar.platform,代碼行數:27,代碼來源:UserProfilePictureBackgroundBehaviour.java

示例5: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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());
}
 
開發者ID:openwide-java,項目名稱:owsi-core-parent,代碼行數:9,代碼來源:ModalHeaderFooterBehavior.java

示例6: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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());
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:13,代碼來源:Selection.java

示例7: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的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());
}
 
開發者ID:subes,項目名稱:invesdwin-nowicket,代碼行數:12,代碼來源:Choices.java

示例8: onComponentTag

import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
public void onComponentTag(Component component, ComponentTag tag) {
    super.onComponentTag(component, tag);
    IValueMap attributes = tag.getAttributes();
    attributes.remove("href");
    attributes.remove("onclick");
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:8,代碼來源:DisabledAddonBehavior.java


注:本文中的org.apache.wicket.markup.ComponentTag.getAttributes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。