本文整理匯總了Java中org.apache.wicket.markup.html.link.Link類的典型用法代碼示例。如果您正苦於以下問題:Java Link類的具體用法?Java Link怎麽用?Java Link使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Link類屬於org.apache.wicket.markup.html.link包,在下文中一共展示了Link類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: newManageContainer
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private WebMarkupContainer newManageContainer() {
WebMarkupContainer container = new WebMarkupContainer("manage");
container.setVisible(SecurityUtils.canModify(getPullRequest()));
container.add(new Link<Void>("synchronize") {
@Override
public void onClick() {
GitPlex.getInstance(PullRequestManager.class).check(getPullRequest());
Session.get().success("Pull request is synchronized");
}
});
container.add(new Link<Void>("delete") {
@Override
public void onClick() {
PullRequest request = getPullRequest();
GitPlex.getInstance(PullRequestManager.class).delete(request);
Session.get().success("Pull request #" + request.getNumber() + " is deleted");
setResponsePage(RequestListPage.class, RequestListPage.paramsOf(getProject()));
}
}.add(new ConfirmOnClick("Do you really want to delete this pull request?")));
return container;
}
示例2: newAcceptedFrag
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private Fragment newAcceptedFrag() {
Fragment fragment = new Fragment("status", "mergedFrag", this);
fragment.add(new BranchLink("sourceBranch", getPullRequest().getSource(), null));
fragment.add(new BranchLink("targetBranch", getPullRequest().getTarget(), null));
fragment.add(new Link<Void>("swapBranches") {
@Override
public void onClick() {
setResponsePage(
NewRequestPage.class,
paramsOf(getProject(), getPullRequest().getSource(), getPullRequest().getTarget()));
}
});
return fragment;
}
示例3: createEditor
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private Link<Void> createEditor(String id, final PortDto port,
final PortDto neighbor) {
Link<Void> link = new Link<Void>(id) {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
port.renew();
String nodeName = NodeUtil.getNodeName(neighbor);
LinkNeighborPortSelectionPage page = new LinkNeighborPortSelectionPage(
LinkEditPage.this, getBackPage(), port, nodeName);
setResponsePage(page);
}
};
return link;
}
示例4: createHeader
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void createHeader() {
ExternalLink topLink = UrlUtil.getTopLink("top");
add(topLink);
Link<Void> reloadLink = new BookmarkablePageLink<Void>("refresh",
LocationViewPage.class, LocationUtil.getParameters(current));
add(reloadLink);
Label categoryLabel = new Label("category", Model.of(LocationRenderer.getLocationType(current)));
add(categoryLabel);
String buildingCode = LocationRenderer.getBuildingCode(current);
if (buildingCode != null) {
buildingCode = "Building Code: " + buildingCode;
}
Label addressLabel = new Label("buildingCode", Model.of(buildingCode));
add(addressLabel);
String popName = LocationRenderer.getPopName(current);
if (popName != null) {
popName = "POP Name: " + popName;
}
Label popNameLabel = new Label("popName", Model.of(popName));
add(popNameLabel);
}
示例5: createAddLocationLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void createAddLocationLink() {
Link<Void> link = new Link<Void>("addLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationAddPage page = new LocationAddPage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (LocationUtil.isTrash(current)) {
link.setEnabled(false);
link.setVisible(false);
}
LocationType type = LocationType.getByCaption(LocationRenderer.getLocationType(current));
if (LocationType.RACK.equals(type)) {
link.add(new Label("label", ""));
} else {
link.add(new Label("label", "Add child location"));
}
add(link);
}
示例6: createEditLocationLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void createEditLocationLink() {
Link<Void> link = new Link<Void>("editLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationEditPage page = new LocationEditPage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (!LocationUtil.isEditable(current)) {
link.setEnabled(false);
link.setVisible(false);
}
add(link);
}
示例7: createDeleteLocationLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void createDeleteLocationLink() {
Link<Void> link = new Link<Void>("deleteLocation") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
LocationDeletePage page = new LocationDeletePage(LocationViewPage.this, current);
setResponsePage(page);
}
};
if (!LocationUtil.isEditable(current)) {
link.setEnabled(false);
link.setVisible(false);
}
add(link);
}
示例8: createAddNodeLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void createAddNodeLink() {
final WebPage page;
if (LocationUtil.isNodeAssignable(current)) {
page = new NodeEditPage(LocationViewPage.this, null, current);
} else {
page = null;
}
Link<Void> link = new Link<Void>("addNode") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(page);
}
};
boolean editable = LocationUtil.isNodeAssignable(current);
link.setEnabled(editable);
link.setVisible(editable);
add(link);
}
示例9: VportEditPage
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
public VportEditPage(final WebPage backPage) {
try {
AAAWebUtil.checkAAA(this, OPERATION_NAME);
this.backPage = backPage;
Link<Void> backLink = new Link<Void>("back") {
private static final long serialVersionUID = 1L;
@Override
public void onClick() {
setResponsePage(getBackPage());
}
};
add(backLink);
} catch (Exception e) {
throw ExceptionUtils.throwAsRuntime(e);
}
}
示例10: createNodeLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
public static Link<Void> createNodeLink(final String id, final PortDto port) {
final PageParameters param;
final String nodeName;
if (port != null) {
param = NodeUtil.getParameters(port.getNode());
nodeName = port.getNode().getName();
} else {
param = null;
nodeName = null;
}
BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, SimpleNodeDetailPage.class, param);
link.setEnabled(port != null);
Label label = new Label("nodeName", nodeName);
link.add(label);
return link;
}
示例11: populateCrawlRow
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private void populateCrawlRow(Item<Crawl> item) {
item.add(new AjaxLink<Crawl>("edit", item.getModel()) {
@Override
public void onClick(AjaxRequestTarget target) {
editCrawl(target, getModel());
}
}.add(new Label("crawlName")));
item.add(new Label("seedList.name"));
item.add(new Label("progress"));
item.add(createStatusLabel());
item.add(new Link<Crawl>("start", item.getModel()) {
@Override
public void onClick() {
crawlService.startCrawl(getModelObject().getId(), getCurrentInstance());
}
});
item.add(new Link<Crawl>("delete", item.getModel()) {
@Override
public void onClick() {
crawlService.deleteCrawl(getModelObject().getId());
}
});
}
示例12: addFacetValue
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
/**
* Adds an individual facet value selection link to a dataview item
*
* @param item item to add link to
*/
private void addFacetValue(String id, final ListItem<Count> item) {
item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));
// link to select an individual facet value
final Link selectLink = new IndicatingAjaxFallbackLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
// reset filter
((NameAndCountFieldValuesFilter) filterModel.getObject()).setName(null);
// call callback
onValuesSelected(
// for now only single values can be selected
Collections.singleton(item.getModelObject().getName()),
target);
}
};
item.add(selectLink);
// 'name' field from Count (name of value)
selectLink.add(new FieldValueLabel("name", fieldNameModel));
// 'count' field from Count (document count for value)
selectLink.add(new Label("count"));
}
示例13: createAllValuesLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
/**
* Creates a link that leads to the 'all facet values' view, either as a
* modal window (if JavaScript is enabled, see {@link #createAllValuesWindow(java.lang.String)
* }) or by redirecting to {@link AllFacetValuesPage}
*
* @param id component id
* @return 'show all values' link
*/
private Link createAllValuesLink(String id) {
final Link link = new IndicatingAjaxFallbackLink<FacetField>(id, getModel()) {
@Override
public void onClick(AjaxRequestTarget target) {
if (target == null) {
// no JavaScript, open a new page with values
setResponsePage(new AllFacetValuesPage(getModel(), selectionModel));
} else {
// JavaScript enabled, show values in a modal popup
valuesWindow.show(target);
}
}
@Override
protected void onConfigure() {
super.onConfigure();
// only show if there actually are more values!
setVisible(getModelObject().getValueCount() > MAX_NUMBER_OF_FACETS_TO_SHOW);
}
};
return link;
}
示例14: createFacetSelectLink
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
private Link createFacetSelectLink(String id, final IModel<String> facetNameModel, final IModel valueModel) {
return new Link(id) {
@Override
public void onClick() {
final FacetSelection facetSelection = new FacetSelection(Collections.singleton(valueModel.getObject().toString()));
final QueryFacetsSelection selection = new QueryFacetsSelection(Collections.singletonMap(facetNameModel.getObject(), facetSelection));
setResponsePage(FacetedSearchPage.class, paramsConverter.toParameters(selection));
}
@Override
protected void onConfigure() {
super.onConfigure();
// only show for facet fields
setVisible(isShowFacetSelectLinks()
&& vloConfig.getFacetsInSearch().contains(facetNameModel.getObject()));
}
};
}
示例15: AjaxFallbackLinkLabel
import org.apache.wicket.markup.html.link.Link; //導入依賴的package包/類
public AjaxFallbackLinkLabel(String id, IModel<T> linkModel, IModel<?> contentModel, boolean indicator) {
super(id);
final Link link;
if (indicator) {
link = new IndicatingAjaxFallbackLink<T>("link", linkModel) {
@Override
public void onClick(AjaxRequestTarget target) {
AjaxFallbackLinkLabel.this.onClick(target);
}
};
} else {
link = new AjaxFallbackLink<T>("link", linkModel) {
@Override
public void onClick(AjaxRequestTarget target) {
AjaxFallbackLinkLabel.this.onClick(target);
}
};
}
add(link);
link.add(new Label("content", contentModel));
}