本文整理匯總了Java中org.apache.wicket.markup.ComponentTag.put方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentTag.put方法的具體用法?Java ComponentTag.put怎麽用?Java ComponentTag.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.ComponentTag
的用法示例。
在下文中一共展示了ComponentTag.put方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: linkCubesQuery
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
/**
* @return
*/
private ExternalLink linkCubesQuery(
final CubesMetricMeasurement cubesMetricMeasurement) {
ExternalLink link = new ExternalLink("linkCubesQuery", cubesMetricMeasurement.getSelf()){
private static final long serialVersionUID = 1L;
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("target","_blank");
}
};
link.add(new Label("cubesMetric", new PropertyModel<String>(
cubesMetricMeasurement, "cubesMetric")));
// tooltip config
TooltipConfig confConfig = new TooltipConfig()
.withPlacement(TooltipConfig.Placement.top);
link.add(new TooltipBehavior(new PropertyModel<String>(cubesMetricMeasurement,
"self"), confConfig));
return link;
}
示例2: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag)
{
super.onComponentTag(tag);
if (isEnabledInHierarchy())
{
if (tag.getName().equalsIgnoreCase("a"))
{
tag.put("href", "#");
}
}
else
{
disableLink(tag);
}
}
示例3: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (isEnabledInHierarchy() == false) {
disableLink(tag);
} else if (getDefaultModel() != null) {
Object hrefValue = getDefaultModelObject();
if (hrefValue != null) {
String url = MAILTO_PREFIX + hrefValue.toString();
// if the tag is an anchor proper
if (tag.getName().equalsIgnoreCase("a") || tag.getName().equalsIgnoreCase("link")
|| tag.getName().equalsIgnoreCase("area")) {
// generate the href attribute
tag.put("href", url);
}
}
}
}
示例4: 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);
}
}
示例5: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.setName("img");
tag.append("class", "avatar", " ");
tag.put("src", url);
}
示例6: createRoleLink
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
private Component createRoleLink(String id, IModel<PrismObject<R>> model) {
AjaxLink<PrismObject<R>> button = new AjaxLink<PrismObject<R>>(id, model) {
@Override
public IModel<?> getBody() {
return new Model<String>(getModel().getObject().asObjectable().getName().getOrig());
}
@Override
public void onClick(AjaxRequestTarget target) {
LOGGER.trace("{} CLICK: {}", this, getModel().getObject());
toggleRole(getModel().getObject());
target.add(this);
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
PrismObject<R> role = getModel().getObject();
if (isSelected(role)) {
tag.put("class", "list-group-item active");
} else {
tag.put("class", "list-group-item");
}
String description = role.asObjectable().getDescription();
if (description != null) {
tag.put("title", description);
}
}
};
button.setOutputMarkupId(true);
return button;
}
示例7: createParamLink
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
private Component createParamLink(String id, IModel<String> itemModel) {
AjaxLink<String> button = new AjaxLink<String>(id, itemModel) {
@Override
public IModel<?> getBody() {
return new Model<String>(getModel().getObject());
}
@Override
public void onClick(AjaxRequestTarget target) {
LOGGER.trace("{} CLICK param: {}", this, getModel().getObject());
toggleParam(getModel().getObject());
target.add(SimpleParametricRoleSelector.this);
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
String param = getModel().getObject();
if (param.equals(selectedParam)) {
tag.put("class", "list-group-item active");
} else {
tag.put("class", "list-group-item");
}
}
};
button.setOutputMarkupId(true);
return button;
}
示例8: 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());
}
};
}
示例9: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if (!isEnabled()) {
tag.put("disabled", "disabled");
}
if (tag.isOpenClose()) {
tag.setType(XmlTag.TagType.OPEN);
}
}
示例10: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
/**
* Handles this frame's tag.
*
* @param tag the component tag
* @see org.apache.wicket.Component#onComponentTag(ComponentTag)
*/
@Override
protected final void onComponentTag(final ComponentTag tag) {
this.checkComponentTag(tag, "iframe");
// generate the src attribute
tag.put("src", this.URL);
super.onComponentTag(tag);
}
示例11: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected final void onComponentTag(final ComponentTag tag) {
this.checkComponentTag(tag, "span");
// generate the class attribute
tag.put("class", this.textEmphasisClass.getClassValue());
super.onComponentTag(tag);
}
示例12: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(ComponentTag tag) {
if(style != null && !"null".equals(style)) {
tag.put("style", style);
}
super.onComponentTag(tag);
}
示例13: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
checkComponentTag(tag, "a");
final String userUuid = this.getDefaultModelObjectAsString();
// image url, cached for a minute
final String imageUrl = "/direct/profile/" + userUuid + "/image/thumb" + "?t="
+ TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis());
// output image
tag.put("style", "background-image:url(" + imageUrl + ")");
}
示例14: disableLink
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void disableLink(final ComponentTag tag) {
if (isBootstrapButtonStyle(tag)) {
tag.setName("button");
tag.put("type", "button");
tag.append("class", "btn-disabled", " ");
}
super.disableLink(tag);
tag.setName("a"); //for bootstrap it should be a and not span
}
示例15: onComponentTag
import org.apache.wicket.markup.ComponentTag; //導入方法依賴的package包/類
@Override
protected void onComponentTag(final ComponentTag tag) {
maybeSetTargetBlank(tag);
if ("iframe".equals(tag.getName())) {
//add support for iframe
final String url = getURL().toString();
tag.put("src", url);
} else {
super.onComponentTag(tag);
}
}