本文整理汇总了Java中org.apache.wicket.event.Broadcast类的典型用法代码示例。如果您正苦于以下问题:Java Broadcast类的具体用法?Java Broadcast怎么用?Java Broadcast使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Broadcast类属于org.apache.wicket.event包,在下文中一共展示了Broadcast类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setWindowClosedReloadCallback
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private void setWindowClosedReloadCallback(final ModalWindow window) {
window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 8804221891699487139L;
@Override
public void onClose(final AjaxRequestTarget target) {
final EventDataWrapper data = new EventDataWrapper();
data.setTarget(target);
send(getParent(), Broadcast.BREADTH, data);
if (page.isModalResult()) {
// reset modal result
page.setModalResult(false);
// set operation succeded
getSession().info(getString("operation_succeded"));
// refresh feedback panel
target.add(feedbackPanel);
}
}
});
}
示例2: setWindowClosedReloadCallback
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private void setWindowClosedReloadCallback(final ModalWindow window) {
window.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
private static final long serialVersionUID = 8804221891699487139L;
@Override
public void onClose(final AjaxRequestTarget target) {
final EventDataWrapper data = new EventDataWrapper();
data.setTarget(target);
data.setCreate(true);
send(getPage(), Broadcast.BREADTH, data);
if (isModalResult()) {
// reset modal result
setModalResult(false);
// set operation succeded
getSession().info(getString("operation_succeded"));
// refresh feedback panel
target.add(feedbackPanel);
}
}
});
}
示例3: loginPanel
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private LoginPanel loginPanel() {
return new LoginPanel("loginPanel") {
@Override
protected boolean isSubmitLinkVisible() {
return false;
}
@Override
protected void submitLoginForm(AjaxRequestTarget target, LoginInfo loginInfo) {
boolean authenticate = authenticate(loginInfo);
if (authenticate) {
Session.get().info(getString("authentication.success"));
setResponsePage(getPage());
send(getPage(), Broadcast.BREADTH, new LoginEvent(LoginModalPanel.this, target));
} else {
error(getString("authentication.failed"));
target.add(modalContainer);
}
}
};
}
示例4: cartView
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private Component cartView() {
cartView = new ListView<CartItemInfo>("cart", cartListModel()) {
@Override
protected void populateItem(ListItem<CartItemInfo> item) {
WebMarkupContainer cartItem = new WebMarkupContainer("item");
cartItem.add(new Label("name", new PropertyModel<String>(item.getModel(), "product.name")));
cartItem.add(new IndicatingAjaxLink<Void>("delete") {
@Override
public void onClick(AjaxRequestTarget target) {
IModel<CartItemInfo> model = item.getModel();
send(CartPanel.this, Broadcast.BREADTH, new RemoveFromCartEvent(model.getObject(), target));
}
});
cartItem.add(new Label("price", new PriceModel(new PropertyModel<>(item.getModel(), "totalSum"))));
item.add(cartItem);
}
};
cartView.setReuseItems(false);
cartView.setOutputMarkupId(true);
return cartView;
}
示例5: getActions
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
@Override
public ActionsPanel<A> getActions(final IModel<A> model) {
final ActionsPanel<A> panel = super.getActions(model);
panel.add(new ActionLink<A>() {
private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target, final A ignore) {
send(AnySelectionDirectoryPanel.this,
Broadcast.BUBBLE, new ItemSelection<>(target, model.getObject()));
}
}, ActionType.SELECT, AnyEntitlement.READ.getFor(type));
return panel;
}
示例6: onCancel
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
/**
* @see org.apache.wicket.extensions.wizard.Wizard#onCancel()
*/
@Override
public final void onCancel() {
final AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
try {
onCancelInternal();
if (eventSink == null) {
send(AjaxWizard.this, Broadcast.BUBBLE, new NewItemCancelEvent<>(item, target));
} else {
send(eventSink, Broadcast.EXACT, new NewItemCancelEvent<>(item, target));
}
} catch (Exception e) {
LOG.warn("Wizard error on cancel", e);
SyncopeConsoleSession.get().error(StringUtils.isBlank(e.getMessage())
? e.getClass().getName() : e.getMessage());
((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target);
}
}
示例7: onApply
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private Serializable onApply(final AjaxRequestTarget target) throws TimeoutException {
try {
final Future<Pair<Serializable, Serializable>> executor
= SyncopeConsoleSession.get().execute(new ApplyFuture(target));
final Pair<Serializable, Serializable> res
= executor.get(SyncopeConsoleApplication.get().getMaxWaitTimeInSeconds(), TimeUnit.SECONDS);
if (res.getLeft() != null) {
send(pageRef.getPage(), Broadcast.BUBBLE, res.getLeft());
}
return res.getRight();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);
}
}
示例8: beforeOnClick
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
protected void beforeOnClick(final AjaxRequestTarget target) {
switch (this.action.getType()) {
case DELETE:
case CREATE:
case MEMBERS:
case MAPPING:
case SET_LATEST_SYNC_TOKEN:
case REMOVE_SYNC_TOKEN:
case EDIT_APPROVAL:
case CLAIM:
send(this, Broadcast.BUBBLE, new ActionLinksTogglePanel.ActionLinkToggleCloseEventPayload(target));
break;
default:
break;
}
}
示例9: addRow
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private WebMarkupContainer addRow(final RepeatingView rows, Serializable element) {
final WebMarkupContainer row = new WebMarkupContainer(rows.newChildId());
row.setOutputMarkupId(true);
rows.add(row);
RepeatingView columns = new RepeatingView("properties");
row.add(columns);
for (PropertyContext<Serializable> propertyContext: propertyContexts) {
WebMarkupContainer column = new WebMarkupContainer(columns.newChildId());
column.add(AttributeAppender.append("class", " " + propertyContext.getPropertyName()));
columns.add(column);
Serializable propertyValue = (Serializable) propertyContext.getPropertyValue(element);
PropertyEditor<?> propertyEditor = propertyContext.renderForEdit("propertyEditor", Model.of(propertyValue));
column.add(propertyEditor);
column.add(new FencedFeedbackPanel("feedback", propertyEditor));
}
row.add(new AjaxButton("deleteElement") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
super.onSubmit(target, form);
target.appendJavaScript($(row).chain("remove").get());
rows.remove(row);
if (rows.size() == 0) {
WebMarkupContainer table = (WebMarkupContainer) ConcreteListPropertyEditor.this.get("listEditor");
target.add(table.get("noElementsRow"));
}
send(ConcreteListPropertyEditor.this, Broadcast.BUBBLE, new EditorChanged(target));
}
}.setDefaultFormProcessing(false));
return row;
}
示例10: updateTree
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
private void updateTree() {
tree = new LinkTree("treeTable", roleTreeBuilder.build()) {
private static final long serialVersionUID = -5514696922119256101L;
@Override
protected IModel getNodeTextModel(final IModel model) {
return new PropertyModel(model, "userObject.displayName");
}
@Override
protected void onNodeLinkClicked(final Object node,
final BaseTree baseTree, final AjaxRequestTarget target) {
DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;
RoleTO unitObject = (RoleTO) treeNode.getUserObject();
send(getPage(), Broadcast.BREADTH,
new TreeNodeClickUpdate(target, unitObject.getId()));
}
};
MetaDataRoleAuthorizationStrategy.authorize(
tree, ENABLE,
xmlRolesReader.getAllAllowedRoles("Roles", "read"));
tree.setOutputMarkupId(true);
tree.getTreeState().expandAll();
treeContainer.addOrReplace(tree);
}
示例11: openModalWindow
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
public void openModalWindow(AjaxRequestTarget ajaxRequestTarget, LogicalModelItem modelItem, boolean configOverride) {
modalServiceView.setUseInitialHeight(false);
modalServiceView.setInitialWidth(750);
Panel serviceFormPanel = getServicePanel(modalServiceView.getContentId(), modelItem, this, false, true, configOverride);
modalServiceView.setContent(serviceFormPanel);
modalServiceView.show(ajaxRequestTarget);
// Send a refresh event in case the modal window contains a CodeMirror instance
send(serviceFormPanel, Broadcast.BREADTH, new CodeMirrorTextArea.CodeMirrorRefresh(ajaxRequestTarget));
}
示例12: getNewProjectQualityChartWidgetLink
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
/**
*
* @return
*/
private BootstrapAjaxLink<String> getNewProjectQualityChartWidgetLink() {
BootstrapAjaxLink<String> link = new BootstrapAjaxLink<String>(
"link.dashboard.node.new.projectquality",
new StringResourceModel(
"button.dashboard.new.projectqualitywidget",
this, null), Buttons.Type.Link) {
private static final long serialVersionUID = -3891261827414844194L;
@Override
public void onClick(final AjaxRequestTarget target) {
WidgetDescriptor descriptor =
dashboardContext.getWidgetRegistry().
getWidgetDescriptorByClassName(
ProjectQualityChartWidget.class.getName());
WidgetFactory widgetFactory =
dashboardContext.getWidgetFactory();
Model<WidgetDescriptor> item =
new Model<>(descriptor);
Widget widget = widgetFactory.createWidget(item.getObject());
send(getPage(), Broadcast.BREADTH, new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
DashboardUtils.updateWidgetLocations(dashboard,
new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
dashboard.addWidget(widget);
dashboardContext.getDashboardPersiter().save(dashboard);
target.add(dashboardPanel);
}
};
link.setOutputMarkupId(true);
return link;
}
示例13: getNewProjectQualityGoogleChartWidgetLink
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
/**
*
* @return
*/
private BootstrapAjaxLink<String> getNewProjectQualityGoogleChartWidgetLink() {
BootstrapAjaxLink<String> link = new BootstrapAjaxLink<String>(
"link.dashboard.node.new.projectqualitygooglechart",
new StringResourceModel(
"button.dashboard.new.projectqualitygooglechartwidget",
this, null), Buttons.Type.Link) {
/**
*
*/
private static final long serialVersionUID = -7142515721241176452L;
@Override
public void onClick(final AjaxRequestTarget target) {
WidgetDescriptor descriptor =
dashboardContext.getWidgetRegistry().
getWidgetDescriptorByClassName(
ProjectQualityGoogleChartWidget.class.getName());
WidgetFactory widgetFactory =
dashboardContext.getWidgetFactory();
Model<WidgetDescriptor> item =
new Model<>(descriptor);
Widget widget = widgetFactory.createWidget(item.getObject());
send(getPage(), Broadcast.BREADTH, new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
DashboardUtils.updateWidgetLocations(dashboard,
new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
dashboard.addWidget(widget);
dashboardContext.getDashboardPersiter().save(dashboard);
target.add(dashboardPanel);
}
};
link.setOutputMarkupId(true);
return link;
}
示例14: getNewWidgetForJIRALink
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
/**
*
* @return
*/
private BootstrapAjaxLink<String> getNewWidgetForJIRALink() {
BootstrapAjaxLink<String> link = new BootstrapAjaxLink<String>(
"link.dashboard.node.new.widgetforjira", new StringResourceModel(
"button.dashboard.new.widgetforjira",
this, null), Buttons.Type.Link) {
private static final long serialVersionUID = -6558356540387024146L;
@Override
public void onClick(final AjaxRequestTarget target) {
WidgetDescriptor descriptor =
dashboardContext.getWidgetRegistry().
getWidgetDescriptorByClassName(
WidgetForJira.class.getName());
WidgetFactory widgetFactory =
dashboardContext.getWidgetFactory();
Model<WidgetDescriptor> item =
new Model<>(descriptor);
Widget widget = widgetFactory.createWidget(item.getObject());
send(getPage(), Broadcast.BREADTH, new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
DashboardUtils.updateWidgetLocations(dashboard,
new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
dashboard.addWidget(widget);
dashboardContext.getDashboardPersiter().save(dashboard);
// Update the panel
target.add(dashboardPanel);
}
};
link.setOutputMarkupId(true);
return link;
}
示例15: getNewSonarQualityWidgetLink
import org.apache.wicket.event.Broadcast; //导入依赖的package包/类
/**
*
* @return
*/
private BootstrapAjaxLink<String> getNewSonarQualityWidgetLink() {
BootstrapAjaxLink<String> link = new BootstrapAjaxLink<String>(
"link.dashboard.node.new.sonarquality", new StringResourceModel(
"button.dashboard.new.sonarqualitywidget", this, null),
Buttons.Type.Link) {
private static final long serialVersionUID = 1106818355620419798L;
@Override
public void onClick(final AjaxRequestTarget target) {
WidgetDescriptor descriptor =
dashboardContext.getWidgetRegistry().
getWidgetDescriptorByClassName(
SonarQualityWidget.class.getName());
WidgetFactory widgetFactory =
dashboardContext.getWidgetFactory();
Model<WidgetDescriptor> item =
new Model<>(descriptor);
Widget widget = widgetFactory.createWidget(item.getObject());
send(getPage(), Broadcast.BREADTH, new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
DashboardUtils.updateWidgetLocations(dashboard,
new DashboardEvent(target,
DashboardEvent.EventType.WIDGET_ADDED, widget));
dashboard.addWidget(widget);
dashboardContext.getDashboardPersiter().save(dashboard);
// Update the dashboard
target.add(dashboardPanel);
}
};
link.setOutputMarkupId(true);
return link;
}