本文整理匯總了Java中org.apache.wicket.ajax.markup.html.AjaxLink類的典型用法代碼示例。如果您正苦於以下問題:Java AjaxLink類的具體用法?Java AjaxLink怎麽用?Java AjaxLink使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AjaxLink類屬於org.apache.wicket.ajax.markup.html包,在下文中一共展示了AjaxLink類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCloseButton
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
private void createCloseButton(boolean visible) {
closeLink = new AjaxLink("close") {
@Override
public void onClick(AjaxRequestTarget target) {
workflowService.changeState(docData, StateEnum.CLOSED, user);
stateLabel.setDefaultModel(new Model(workflow.getState().getCurrentState().getName()));
setVisibility(false, closeLink, submitLink, startProgressLink, signLink, releaseLink,
approveLink, declineLink, documentLabels.getSubmittedlabel(),
documentLabels.getFreezedLabel());
reopenLink.setVisible(true);
tabs.refreshTabs(docData.getMetadata().getRev());
documentLabels.refreshLabels(docData.getWorkflow(), target);
target.add(stateLabel, closeLink, submitLink, startProgressLink, signLink,
reopenLink, approveLink, declineLink, documentLabels, releaseLink, tabs);
}
};
addComponent(closeLink, visible);
}
示例2: populateItem
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
@Override
protected void populateItem(Item<Var> item) {
String name = item.getModel().getObject().getName();
item.add(new AjaxLink("show") {
@Override
public void onClick(AjaxRequestTarget target) {
selectedName = name;
Component headerPanel = getPage().get(BasePage.STICKY_HEADER_ID);
VarModel varModel = new VarModel(model.getSessionId(), name);
VarPanel varPanel = new VarPanel(BasePage.STICKY_HEADER_ID, varModel, VarsRefreshingView.this);
headerPanel = headerPanel.replaceWith(varPanel);
target.add(headerPanel);
Component varsPanel = getPage().get(BasePage.LEFT_NAV_ID);
target.add(varsPanel);
}
}.add(new Label("name", name)));
String type = item.getModel().getObject().getValue().getTypeAsShortString();
item.add(new Label("type", type));
if (name.equals(selectedName)) {
item.add(new AttributeModifier("class", "success"));
}
}
示例3: render
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
@Override
public Component render(String componentId) {
return new ActionTabLink(componentId, this) {
@Override
protected WebMarkupContainer newLink(String id, ActionTab tab) {
return new AjaxLink<Void>("link") {
@Override
public void onClick(AjaxRequestTarget target) {
selectTab(this);
}
};
}
};
}
示例4: newAddReplyContainer
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
private WebMarkupContainer newAddReplyContainer() {
WebMarkupContainer addReplyContainer = new Fragment("addReply", "addReplyFrag", this) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(SecurityUtils.getUser() != null);
}
};
addReplyContainer.setOutputMarkupId(true);
addReplyContainer.add(new AjaxLink<Void>("reply") {
@Override
public void onClick(AjaxRequestTarget target) {
onAddReply(target, false, null);
}
});
return addReplyContainer;
}
示例5: populateCrawlRow
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的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());
}
});
}
示例6: initLayout
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
public void initLayout(final String messageKey){
WebMarkupContainer content = new WebMarkupContainer(ID_CONTENT);
add(content);
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(messageKey);
}
});
helpLabel.setEscapeModelStrings(false);
content.add(helpLabel);
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {
@Override
public void onClick(AjaxRequestTarget target) {
closePerformed(target);
}
};
content.add(ok);
}
示例7: initButtons
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
protected void initButtons(ListItem<T> item, WebMarkupContainer parent) {
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP); {
buttonGroup.setOutputMarkupId(true);
AjaxLink remove = new AjaxLink(ID_REMOVE) {
@Override
public void onClick(AjaxRequestTarget target) {
removeValuePerformed(target, item.getModelObject());
}
};
remove.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return isRemoveButtonVisible();
}
});
buttonGroup.add(remove);
}
parent.add(buttonGroup);
}
示例8: initLayout
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
private void initLayout() {
setOutputMarkupId(true);
ListView<PrismObject<R>> list = new ListView<PrismObject<R>>(ID_LIST, availableRoles) {
@Override
protected void populateItem(ListItem<PrismObject<R>> item) {
item.add(createRoleLink(ID_ITEM, item.getModel()));
}
};
list.setOutputMarkupId(true);
add(list);
AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {
@Override
public void onClick(AjaxRequestTarget target) {
reset();
target.add(SimpleRoleSelector.this);
}
};
buttonReset.setBody(createStringResource("SimpleRoleSelector.reset"));
add(buttonReset);
}
示例9: initLayout
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
private void initLayout(IModel<String> model, IModel<String> titleModel) {
AjaxLink link = new AjaxLink(ID_LINK) {
@Override
public void onClick(AjaxRequestTarget target) {
onClickPerformed(target);
}
};
Label image = new Label(ID_IMAGE);
image.add(AttributeModifier.replace("class", model));
if (titleModel != null) {
image.add(AttributeModifier.replace("title", titleModel));
}
link.add(image);
link.setOutputMarkupId(true);
add(link);
}
示例10: initLayout
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
protected void initLayout() {
WebMarkupContainer cogButton = new WebMarkupContainer(ID_COG_BUTTON);
cogButton.setOutputMarkupId(true);
add(cogButton);
WebMarkupContainer pageSize = new WebMarkupContainer(ID_PAGE_SIZE);
pageSize.setOutputMarkupId(true);
cogButton.add(pageSize);
AjaxLink tableColumns = new AjaxLink(ID_TABLE_COLUMNS) {
@Override
public void onClick(AjaxRequestTarget target) {
tableColumnsPerformed(target);
}
};
cogButton.add(tableColumns);
tableColumns.setVisible(false); //todo implement [lazyman]
initPopoverLayout();
}
示例11: initLayout
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
public void initLayout(WebMarkupContainer content){
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return getString(determineHelpKey());
}
});
helpLabel.setEscapeModelStrings(false);
content.add(helpLabel);
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) {
@Override
public void onClick(AjaxRequestTarget target) {
closePerformed(target);
}
};
content.add(ok);
}
示例12: createCapabilityButton
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
private void createCapabilityButton(String id) {
AjaxLink<Boolean> button = new AjaxLink<Boolean>(id, new PropertyModel<Boolean>(getModel(), id)) {
@Override
public void onClick(AjaxRequestTarget target) {
// TODO:
}
};
button.add(new AttributeModifier("class",
button.getModelObject() ? "btn btn-app btn-resource-capability bg-light-blue"
: "btn btn-app btn-resource-capability bg-gray text-light-blue"));
button.add(new Label("label", new ResourceModel("CapabilitiesType." + id)));
add(button);
}
示例13: addDeleteDependencyButton
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
/**
* Create and add a link to delete the selected attribute dependency.
*/
private void addDeleteDependencyButton() {
AjaxLink deleteDependencyButton = new AjaxLink<Void>("deleteDependencyButton") {
private static final long serialVersionUID = 1L;
@Override
public void onClick(final AjaxRequestTarget target) {
AttributeDependency dependency = AttributeDependency
.getAttributeDependencyIfExists(selectedEventType, selectedBaseAttribute, selectedDependentAttribute);
if (dependency == null) {
DependenciesPanel.this.page.getFeedbackPanel().error("Error while deleting dependency. "
+ "Dependency is already deleted.");
} else if (dependency.remove() == null) {
DependenciesPanel.this.page.getFeedbackPanel().error("Error while deleting dependency. "
+ "Please delete the corresponding values first.");
} else {
DependenciesPanel.this.page.getFeedbackPanel().success("Dependency deleted.");
}
target.add(DependenciesPanel.this.page.getFeedbackPanel());
}
};
dependencyForm.add(deleteDependencyButton);
}
示例14: UriResponsePanel
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
public UriResponsePanel(String id, IModel<UriListRepresentationModel> representationModel) {
super(id);
this.add(new ListView<String>("uriList", new ListModel<>(representationModel.getObject().getUriList())) {
@Override
protected void populateItem(ListItem<String> listItem) {
AjaxLink link = new AjaxLink("uri") {
@Override
public void onClick(AjaxRequestTarget target) {
try {
XmppURI uri = new XmppURI(listItem.getModelObject());
setResponsePage(new BrowserPage(Model.of(uri)));
} catch (URISyntaxException e) {
logger.error("Could not parse Xmpp Uri. {}", listItem.getModelObject(), e);
target.appendJavaScript("alert('Could not parse Xmpp Uri.');");
}
}
};
link.setBody(listItem.getModel());
listItem.add(link);
}
});
}
示例15: create
import org.apache.wicket.ajax.markup.html.AjaxLink; //導入依賴的package包/類
@Override
public AjaxLink<T> create(String wicketId, final IModel<T> parameter) {
AjaxLink<T> link = new AjaxLink<T>(wicketId, parameter) {
private static final long serialVersionUID = 1L;
@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
super.updateAjaxAttributes(attributes);
action.updateAjaxAttributes(attributes, parameter);
}
@Override
public void onClick(AjaxRequestTarget target) {
action.execute(target, parameter);
}
};
link.add(
action.getActionAvailableCondition(parameter).thenShowInternal()
);
return link;
}