当前位置: 首页>>代码示例>>Java>>正文


Java Broadcast类代码示例

本文整理汇总了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);
            }
        }
    });
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:24,代码来源:ResultSetPanel.java

示例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);
            }
        }
    });
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:25,代码来源:Users.java

示例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);
            }
        }
    };
}
 
开发者ID:zutherb,项目名称:AppStash,代码行数:25,代码来源:LoginModalPanel.java

示例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;
}
 
开发者ID:zutherb,项目名称:AppStash,代码行数:22,代码来源:CartPanel.java

示例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;
}
 
开发者ID:apache,项目名称:syncope,代码行数:18,代码来源:AnySelectionDirectoryPanel.java

示例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);
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:21,代码来源:AjaxWizard.java

示例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);
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:18,代码来源:AjaxWizard.java

示例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;
    }
}
 
开发者ID:apache,项目名称:syncope,代码行数:17,代码来源:ActionPanel.java

示例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;
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:40,代码来源:ConcreteListPropertyEditor.java

示例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);
    }
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:34,代码来源:TreeRolePanel.java

示例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));
}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:11,代码来源:DesignerHelperPage.java

示例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;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:39,代码来源:DashboardViewPage.java

示例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;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:42,代码来源:DashboardViewPage.java

示例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;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:39,代码来源:DashboardViewPage.java

示例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;
}
 
开发者ID:U-QASAR,项目名称:u-qasar.platform,代码行数:39,代码来源:DashboardViewPage.java


注:本文中的org.apache.wicket.event.Broadcast类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。