本文整理匯總了Java中org.apache.wicket.markup.ComponentTag.getAttribute方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentTag.getAttribute方法的具體用法?Java ComponentTag.getAttribute怎麽用?Java ComponentTag.getAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.ComponentTag
的用法示例。
在下文中一共展示了ComponentTag.getAttribute方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
public void onComponentTag(Component component, ComponentTag tag) {
String original = tag.getAttribute("title");
super.onComponentTag(component, tag);
// hack here
String current = tag.getAttribute("title");
if (!Strings.isNullOrEmpty(original) && Strings.isNullOrEmpty(current)) {
tag.put("title", original);
}
}
示例2: newTabContainer
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
/**
* Generates a loop item used to represent a specific tab's <code>li</code> element.
*
* @param tabIndex
* @return new loop item
*/
protected LoopItem newTabContainer(final int tabIndex) {
return new LoopItem(tabIndex) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(getVisiblityCache().isVisible(tabIndex));
}
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
String cssClass = tag.getAttribute("class");
if (cssClass == null) {
cssClass = " ";
}
cssClass += " tab" + getIndex();
if (getIndex() == getSelectedTab()) {
cssClass += ' ' + getSelectedTabCssClass();
}
if (getVisiblityCache().getLastVisible() == getIndex()) {
cssClass += ' ' + getLastTabCssClass();
}
tag.put("class", cssClass.trim());
}
};
}
示例3: onComponentTagBody
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
final String vis = openTag.getAttribute(markupStream.getWicketNamespace() + WICKET_VISIBLE);
if (vis != null && Boolean.FALSE.equals(Boolean.valueOf(vis))) {
//skip the body
return;
}
super.onComponentTagBody(markupStream, openTag);
}
示例4: merge
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
public static void merge(final ComponentTag tag, final String attribute, final String value) {
String newValue = tag.getAttribute(attribute);
if (Strings.isBlank(newValue)) {
newValue = value;
} else {
newValue += " " + value;
}
tag.put(attribute, newValue);
}
示例5: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
public void onComponentTag(Component component, ComponentTag tag) {
FormComponent<?> fc = (FormComponent<?>) component;
if (!fc.isValid()) {
String c1 = tag.getAttribute("class");
if (c1 == null) {
tag.put("class", "errorField");
} else {
tag.put("class", " errorField " + c1);
}
}
}