本文整理汇总了Java中org.apache.wicket.ajax.IAjaxCallDecorator类的典型用法代码示例。如果您正苦于以下问题:Java IAjaxCallDecorator类的具体用法?Java IAjaxCallDecorator怎么用?Java IAjaxCallDecorator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IAjaxCallDecorator类属于org.apache.wicket.ajax包,在下文中一共展示了IAjaxCallDecorator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AjaxDecoratedCheckbox
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
public AjaxDecoratedCheckbox(final String id, final IModel<Boolean> model) {
super(id, model);
add(new AjaxEventBehavior("onclick") {
@Override
protected void onEvent(final AjaxRequestTarget target) {
onUpdate(target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelEventIfNoAjaxDecorator(
AjaxDecoratedCheckbox.this.getAjaxCallDecorator());
}
});
}
示例2: populateTreeItem
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected void populateTreeItem(final WebMarkupContainer item, int level) {
super.populateTreeItem(item, level);
item.get("nodeLink:label").add(new CssClass("node-label"));
item.get("nodeLink").add(new AjaxEventBehavior("oncontextmenu") {
@Override
protected void onEvent(AjaxRequestTarget target) {
onContextMenu(item, target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
});
}
示例3: scheduleMessageFetch
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
private void scheduleMessageFetch() {
add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new NoAjaxIndicatorDecorator();
}
@Override
protected void onTimer(AjaxRequestTarget target) {
stop();
final Message message = artifactoryUpdatesService.getCachedMessage();
if (message != null && message != ArtifactoryUpdatesService.PROCESSING_MESSAGE) {
setupMessage(message);
target.add(ArtifactoryUpdatesPanel.this);
}
}
});
}
示例4: populateItem
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected void populateItem(final ListItem<T> item) {
super.populateItem(item);
item.add(new AjaxEventBehavior("ondblclick") {
@SuppressWarnings({"unchecked"})
@Override
protected void onEvent(AjaxRequestTarget target) {
ModalHandler modalHandler = ModalHandler.getInstanceFor(RepoListPanel.this);
T itemObject = (T) item.getDefaultModelObject();
modalHandler.setModalPanel(newUpdateItemPanel(itemObject));
modalHandler.show(target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
});
}
示例5: newRowItem
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected Item<T> newRowItem(final String id, final int index, final IModel<T> model) {
Item<T> item = super.newRowItem(id, index, model);
if (canAddRowItemDoubleClickBehavior(model)) {
item.add(new AjaxEventBehavior("ondblclick") {
@Override
protected void onEvent(AjaxRequestTarget target) {
onRowItemEvent(id, index, model, target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
});
}
return item;
}
示例6: addLinks
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
protected void addLinks(List<AbstractLink> links, final T itemObject, String linkId) {
// add edit link
TitledAjaxLink editLink = getEditItemLink(itemObject, linkId);
editLink.add(new CssClass("icon-link"));
editLink.add(new CssClass("UpdateAction"));
links.add(editLink);
// add delete link
if (canAddDeleteItemLink(itemObject)) {
TitledAjaxLink deleteLink = new TitledAjaxLink(linkId, "Delete") {
@Override
public void onClick(AjaxRequestTarget target) {
deleteItem(itemObject, target);
target.add(BaseListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new ConfirmationAjaxCallDecorator(getDeleteConfirmationText(itemObject));
}
};
deleteLink.add(new CssClass("icon-link"));
deleteLink.add(new CssClass("DeleteAction"));
links.add(deleteLink);
}
}
示例7: newGroupByLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
private Component newGroupByLink(String id, final ISortStateLocator stateLocator, final String groupProperty) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
if (stateLocator instanceof IGroupStateLocator) {
IGroupStateLocator groupStateLocator = (IGroupStateLocator) stateLocator;
switchGroupState(groupStateLocator, groupProperty);
target.add(getTable());
}
}
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.put("title", "Group By");
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
};
}
示例8: newCheckBox
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected FormComponent<Boolean> newCheckBox(String id, IModel<Boolean> model, final T rowObject) {
final FormComponent<Boolean> checkbox = super.newCheckBox(id, model, rowObject);
checkbox.add(new AjaxFormComponentUpdatingBehavior("onclick") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
Boolean checked = checkbox.getModelObject();
AjaxCheckboxColumn.this.onUpdate(checkbox, rowObject, checked, target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return AjaxCheckboxColumn.this.getAjaxCallDecorator();
}
});
return checkbox;
}
示例9: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@SuppressWarnings("unchecked")
@Override
public void onClick(AjaxRequestTarget target) {
List<ConnectorInstanceMetaDTO> metas = (List<ConnectorInstanceMetaDTO>) MetaListPanel.this.getModelObject();
metas.remove(index);
target.addComponent(MetaListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", MetaListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}
示例10: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@SuppressWarnings("unchecked")
@Override
public void onClick(AjaxRequestTarget target) {
List<CopyFieldDTO> copyFields = (List<CopyFieldDTO>) CopyFieldListPanel.this.getModelObject();
copyFields.remove(index);
target.addComponent(CopyFieldListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", CopyFieldListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}
示例11: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
protected WebMarkupContainer createDeleteLink(String id, final IModel rowItemModel, final int index) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
onClickDeleteLink(rowItemModel, target, index);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", CRUDPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
@Override
public boolean isVisible() {
return super.isVisible() && isDeleteLink(rowItemModel, index);
}
};
}
示例12: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
AddEditGroupPanel addEditGroupPanel = (AddEditGroupPanel) findParent(AddEditGroupPanel.class);
addEditGroupPanel.getParticipations().remove(index);
target.addComponent(ParticipationListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", ParticipationListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}
示例13: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
AddEditAnalyzerFieldPanel addEditAnalyzerFieldPanel = (AddEditAnalyzerFieldPanel) findParent(AddEditAnalyzerFieldPanel.class);
addEditAnalyzerFieldPanel.getFilters().remove(index);
target.addComponent(FilterListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", FilterListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}
示例14: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
AddEditCategorizationRulePanel addEditCategorizationRulePanel =
(AddEditCategorizationRulePanel) findParent(AddEditCategorizationRulePanel.class);
addEditCategorizationRulePanel.getValues().remove(index);
target.addComponent(CategorizationRuleValueListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", CategorizationRuleValueListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}
示例15: createDeleteLink
import org.apache.wicket.ajax.IAjaxCallDecorator; //导入依赖的package包/类
@Override
protected WebMarkupContainer createDeleteLink(String id, final IModel entityModel, final int index) {
return new AjaxLink(id) {
@Override
public void onClick(AjaxRequestTarget target) {
AddEditCategorizationPanel addEditCategorizationPanel = (AddEditCategorizationPanel) findParent(AddEditCategorizationPanel.class);
addEditCategorizationPanel.getRules().remove(index);
target.addComponent(CategorizationRuleListPanel.this);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
@Override
public CharSequence decorateScript(CharSequence script) {
String confirmMsg = getLocalizer().getString("confirmDelete", CategorizationRuleListPanel.this);
return "if (confirm('" + confirmMsg + "')) {" + script + "} else { return false; }";
}
};
}
};
}