本文整理汇总了Java中org.apache.wicket.markup.html.link.AbstractLink.add方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractLink.add方法的具体用法?Java AbstractLink.add怎么用?Java AbstractLink.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.link.AbstractLink
的用法示例。
在下文中一共展示了AbstractLink.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newLink
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
private AbstractLink newLink(String markupId, MethodModel methodModel) {
AbstractLink link = new Link(markupId) {
@Override
public void onClick() {
if (null == methodModel.getRequestMediaType()) {
// execute method directly if no request media type is given
BrowserPage.this.executeMethod(null, methodModel);
} else {
// get request representation model
try {
AbstractRepresentationModel representation = IntercloudWebSession.get().getIntercloudService()
.getIntercloudClient(methodModel.getUri())
.getRepresentationModel(methodModel);
// display request
BrowserPage.this.requestForm.setModel(representation, methodModel);
// hide response
BrowserPage.this.responseContainer.setModel(null);
ComponentUtils.displayNone(alert);
} catch (Exception e) {
logError(e);
logger.error("Could not create request model.", e);
}
}
}
}.setBody(Model.of(methodModel.getMethodType()));
if (null == methodModel.getRequestMediaType()) {
link.add(new AttributeAppender("class", " btn-success"));
} else if ("xml/occi".equals(methodModel.getRequestMediaType())) {
link.add(new AttributeAppender("class", " btn-info"));
} else {
link.setEnabled(false);
link.add(new AttributeAppender("class", " disables"));
}
return link;
}
示例2: CalendarPage
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public CalendarPage(PageParameters parameters) {
super(parameters);
addBreadCrumbElement(new BreadCrumbElement(new ResourceModel("widgets.menu.calendar"), CalendarPage.linkDescriptor()));
add(new CalendarPanel("calendarPanel"));
CalendarPopupPanel calendarPopupPanel = new CalendarPopupPanel("calendarPopupPanel");
add(calendarPopupPanel);
AbstractLink calendarPopupButton = new AbstractLink("calendarPopupButton") {
private static final long serialVersionUID = 1L;
};
calendarPopupButton.add(new AjaxModalOpenBehavior(calendarPopupPanel, MouseEvent.CLICK));
add(calendarPopupButton);
}
示例3: WidgetActionsPanel
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public WidgetActionsPanel(String id, IModel<Widget> model) {
super(id, model);
IModel<List<WidgetAction>> actionsModel = new LoadableDetachableModel<List<WidgetAction>>() {
private static final long serialVersionUID = 1L;
@Override
protected List<WidgetAction> load() {
return dashboardContext.getWidgetActionsFactory().createWidgetActions(getWidget());
}
};
ListView<WidgetAction> actionsView = new ListView<WidgetAction>("action", actionsModel) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<WidgetAction> item) {
WidgetAction action = item.getModelObject();
AbstractLink link = action.getLink("link");
link.add(new Image("image", action.getImage()));
link.add(AttributeModifier.replace("title", action.getTooltip()));
item.add(link);
}
};
add(actionsView);
}
示例4: populateItem
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
/**
* Called by the ListView created by default via {@link #newBadgeListView(String, IModel)}. It populates the item
* with the link returned by {@link BadgeListItem#createLink(String)}, to which subsequently the Badge and Label is
* added.
*
* @param item the specific list item.
*/
protected void populateItem(ListItem<BadgeListItem> item) {
BadgeListItem model = item.getModelObject();
AbstractLink link = item.getModelObject().createLink("link");
link.add(model.createBadge("badge"));
link.add(model.createLabel("label"));
item.add(link);
}
示例5: ActionLinkPanel
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public ActionLinkPanel(final String id, final ActionLinkType actionLinkType, final String value)
{
super(id);
AbstractLink link1;
if (actionLinkType == ActionLinkType.CALL) {
add(link1 = getCallLink(value));
add(getInvisibleSmsLink());
} else if (actionLinkType == ActionLinkType.SMS) {
add(new Label("link", "[invisible]").setVisible(false));
add(getSmsLink(value));
} else if (actionLinkType == ActionLinkType.CALL_AND_SMS) {
add(link1 = getCallLink(value));
add(getSmsLink(value));
} else if (actionLinkType == ActionLinkType.MAIL) {
add(link1 = new ExternalLink("link", "mailto:" + value, value));
add(getInvisibleSmsLink());
} else {
final String url;
if (value != null && value.contains("://") == true) {
url = value;
} else {
url = "http://" + value;
}
add(link1 = new ExternalLink("link", url, value));
link1.add(AttributeModifier.append("target", "_blank"));
add(getInvisibleSmsLink());
}
}
示例6: TextLinkPanel
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
/**
* @param id
* @param link Must have component id {@link #LINK_ID}
* @param label The link text.
* @param tooltip
*/
public TextLinkPanel(final String id, final AbstractLink link, final String label, final String tooltip)
{
super(id);
this.link = link;
init(id, link, tooltip);
this.label = new Label("text", label);
link.add(this.label);
}
示例7: setLink
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public IconLinkPanel setLink(final AbstractLink link)
{
this.link = link;
add(link);
icon = new WebMarkupContainer("icon");
icon.add(AttributeModifier.append("class", type.getClassAttrValue()));
link.add(icon);
return this;
}
示例8: LinkFragment
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public LinkFragment(AbstractLink link, String label) {
super("linkFragment", "LINK_FRAGMENT", MenuPanel.this);
setRenderBodyOnly(true);
link.add(new Label(LINK_TEXT_ID, label));
add(link);
}
示例9: LinkImageTextFragment
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public LinkImageTextFragment(AbstractLink link, String image, String label) {
super("linkFragment", decorateMarkupId("LINK_IMAGE_TEXT_FRAGMENT", image), MenuPanel.this);
setRenderBodyOnly(true);
if (isFontawesome(image)) {
link.add(new TransparentWebMarkupContainer(LINK_IMAGE_ID).add(AttributeModifier.append("class", "fa-" + image)));
} else {
link.add(new ContextImage(LINK_IMAGE_ID, image));
}
link.add(new SimpleTooltipBehavior(label));
link.add(new Label(LINK_TEXT_ID, label));
add(link);
}
示例10: LinkImageFragment
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public LinkImageFragment(AbstractLink link, String image) {
super("linkFragment", decorateMarkupId("LINK_IMAGE_FRAGMENT", image), MenuPanel.this);
setRenderBodyOnly(true);
if (isFontawesome(image)) {
link.add(new TransparentWebMarkupContainer(LINK_IMAGE_ID).add(AttributeModifier.append("class", "fa-" + image)));
} else {
link.add(new ContextImage(LINK_IMAGE_ID, image));
}
add(link);
}
示例11: onInitialize
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
AbstractLink link = new ViewStateAwarePageLink<Void>("link",
CommitDetailPage.class,
CommitDetailPage.paramsOf(projectModel.getObject(), commitModel.getObject().name()));
add(link);
link.add(new Label("label", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return highlight(commitModel.getObject().getShortMessage());
}
}).setEscapeModelStrings(false));
add(new Label("detail", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return highlight(GitUtils.getDetailMessage(commitModel.getObject()));
}
}) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(GitUtils.getDetailMessage(commitModel.getObject()) != null);
}
}.setEscapeModelStrings(false));
WebMarkupContainer detailedToggle = new WebMarkupContainer("toggle") {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(GitUtils.getDetailMessage(commitModel.getObject()) != null);
}
};
add(detailedToggle);
}
示例12: addCancelBehavior
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
protected void addCancelBehavior(AbstractLink link) {
link.add(new AttributeModifier("data-dismiss", "modal"));
}
示例13: HashTableFileStoreTestPanel
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public HashTableFileStoreTestPanel(String id) {
super(id);
IModel<List<IDataUpgrade>> dataUpgrades = new LoadableDetachableModel<List<IDataUpgrade>>() {
private static final long serialVersionUID = 1L;
@Override
protected List<IDataUpgrade> load() {
return dataUpgradeService.listDataUpgrades();
}
};
ListView<IDataUpgrade> dataUpgradeListView = new ListView<IDataUpgrade>("dataUpgrades", dataUpgrades) {
private static final long serialVersionUID = 8364566356668905714L;
@Override
protected void populateItem(ListItem<IDataUpgrade> item) {
final boolean executee = propertyService.get(dataUpgrade(item.getModelObject()));
item.add(new Label("upgradeName", new PropertyModel<String>(item.getModel(), "name")));
AbstractLink executeLink = new Link<IDataUpgrade>("executeLink", item.getModel()) {
private static final long serialVersionUID = -2506223138809658833L;
@Override
public void onClick() {
try {
dataUpgradeService.executeDataUpgrade(getModelObject());
getSession().success(getString("console.maintenance.dataUpgrade.execute.success"));
} catch (Exception e) {
LOGGER.error("Erreur lors de l'exécution de la mise à jour '" + getModelObject() +"'", e);
getSession().error(getString("console.maintenance.dataUpgrade.execute.error"));
}
setResponsePage(getPage());
}
@Override
public void onConfigure() {
super.onConfigure();
setVisible(!executee);
}
};
executeLink.add(new AttributeModifier("title", getString("console.maintenance.dataUpgrade.execute")));
item.add(executeLink);
item.add(new PlaceholderContainer("alreadyExecutedContainer").condition(Condition.componentVisible(executeLink)));
}
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(!getModelObject().isEmpty());
}
};
add(dataUpgradeListView);
add(new PlaceholderContainer("emptyList").condition(Condition.componentVisible(dataUpgradeListView)));
}
示例14: DataUpgradePanel
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public DataUpgradePanel(String id) {
super(id);
IModel<List<IDataUpgrade>> dataUpgrades = new LoadableDetachableModel<List<IDataUpgrade>>() {
private static final long serialVersionUID = 1L;
@Override
protected List<IDataUpgrade> load() {
return dataUpgradeService.listDataUpgrades();
}
};
ListView<IDataUpgrade> dataUpgradeListView = new ListView<IDataUpgrade>("dataUpgrades", dataUpgrades) {
private static final long serialVersionUID = 8364566356668905714L;
@Override
protected void populateItem(ListItem<IDataUpgrade> item) {
final boolean executee = propertyService.get(dataUpgrade(item.getModelObject()));
item.add(new Label("upgradeName", new PropertyModel<String>(item.getModel(), "name")));
AbstractLink executeLink = new Link<IDataUpgrade>("executeLink", item.getModel()) {
private static final long serialVersionUID = -2506223138809658833L;
@Override
public void onClick() {
try {
dataUpgradeService.executeDataUpgrade(getModelObject());
getSession().success(getString("console.maintenance.dataUpgrade.execute.success"));
} catch (Exception e) {
LOGGER.error("Erreur lors de l'exécution de la mise à jour '" + getModelObject() +"'", e);
getSession().error(getString("console.maintenance.dataUpgrade.execute.error"));
}
setResponsePage(getPage());
}
@Override
public void onConfigure() {
super.onConfigure();
setVisible(!executee);
}
};
executeLink.add(new AttributeModifier("title", getString("console.maintenance.dataUpgrade.execute")));
item.add(executeLink);
item.add(new PlaceholderContainer("alreadyExecutedContainer").condition(Condition.componentVisible(executeLink)));
}
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(!getModelObject().isEmpty());
}
};
add(dataUpgradeListView);
add(new PlaceholderContainer("emptyList").condition(Condition.componentVisible(dataUpgradeListView)));
}
示例15: ActionItemLink
import org.apache.wicket.markup.html.link.AbstractLink; //导入方法依赖的package包/类
public ActionItemLink(IModel<String> label, IconType iconType, AbstractLink link) {
add(link);
WebMarkupContainer webMarkupContainer = new WebMarkupContainer("icon-type");
webMarkupContainer.add(new AttributeAppender("class", "glyphicon glyphicon-" + iconType.getCssName()));
link.add(webMarkupContainer);
}