本文整理汇总了Java中org.apache.wicket.event.IEvent类的典型用法代码示例。如果您正苦于以下问题:Java IEvent类的具体用法?Java IEvent怎么用?Java IEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEvent类属于org.apache.wicket.event包,在下文中一共展示了IEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof AjaxRequestTarget) {
AjaxRequestTarget target = (AjaxRequestTarget) event.getPayload();
if (target.getComponents().contains(this)) {
// if this component is being repainted by ajax, directly, we
// must destroy Select2 so it removes
// its elements from DOM
target.prependJavaScript(JQuery.execute("$('#%s').select2('destroy');", getJquerySafeMarkupId()));
}
}
}
示例2: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof ConnConfModEvent) {
final AjaxRequestTarget target =
((ConnConfModEvent) event.getPayload()).getTarget();
final List<ConnConfProperty> conf =
((ConnConfModEvent) event.getPayload()).getConfiguration();
mappings.removeAll();
addMappingBtn.setEnabled(
resourceTO.getConnectorId() != null
&& resourceTO.getConnectorId() > 0);
schemaNames = getResourceSchemaNames(
resourceTO.getConnectorId(),
new HashSet<ConnConfProperty>(conf));
target.add(mappingContainer);
}
}
示例3: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(IEvent<?> event) {
Object payload = event.getPayload();
if (payload instanceof ProfileEvent) {
ProfileEvent profileEvent = (ProfileEvent) payload;
boolean updatableProfile = authorizationService.isUpdatableProfile();
updateLink.setEnabled(updatableProfile);
cancelLink.setEnabled(updatableProfile);
ProfileModel userProfile = getUserProfile();
if (!ConstantValues.uiHideEncryptedPassword.getBoolean()) {
mavenSettingsPanel = new MavenSettingsPanel("mavenSettingsPanel", userProfile);
form.replace(mavenSettingsPanel);
}
bintrayProfilePanel.updateDefaultModel(userProfile, updatableProfile);
profileEvent.getTarget().add(this, bintrayProfilePanel);
}
}
示例4: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( IEvent event )
{
if ( event.getPayload() instanceof SaveModelEvent )
{
SaveModelEvent modelEvent = ( SaveModelEvent ) event.getPayload();
switch ( modelEvent.getOperation() )
{
case ADD:
add( modelEvent.getEntity() );
break;
case UPDATE:
modelChanged();
break;
case DELETE:
prune();
break;
default:
LOG.error( "onEvent caught invalid operation" );
break;
}
AjaxRequestTarget target = ( ( SaveModelEvent ) event.getPayload() ).getAjaxRequestTarget();
target.add(grid);
LOG.debug( ".onEvent AJAX - UserListPanel - SaveModelEvent: " + target.toString() );
}
}
示例5: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( IEvent event )
{
if ( event.getPayload() instanceof SaveModelEvent )
{
SaveModelEvent modelEvent = ( SaveModelEvent ) event.getPayload();
switch ( modelEvent.getOperation() )
{
case ADD:
add( modelEvent.getEntity() );
break;
case UPDATE:
modelChanged();
break;
case DELETE:
prune();
break;
default:
break;
}
AjaxRequestTarget target = ( ( SaveModelEvent ) event.getPayload() ).getAjaxRequestTarget();
target.add( grid );
log.debug( ".onEvent SaveModelEvent: " + target.toString() );
}
}
示例6: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( IEvent event )
{
if ( event.getPayload() instanceof SaveModelEvent )
{
SaveModelEvent modelEvent = ( SaveModelEvent ) event.getPayload();
switch ( modelEvent.getOperation() )
{
case ADD:
add( modelEvent.getEntity() );
break;
case UPDATE:
//modelEvent.
modelChanged();
break;
case DELETE:
prune();
break;
default:
log.error( "onEvent caught invalid operation" );
break;
}
AjaxRequestTarget target = ( ( SaveModelEvent ) event.getPayload() ).getAjaxRequestTarget();
log.debug( ".onEvent AJAX - GroupListPanel - SaveModelEvent: " + target.toString() );
}
}
示例7: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( IEvent event )
{
if ( event.getPayload() instanceof SaveModelEvent )
{
SaveModelEvent modelEvent = ( SaveModelEvent ) event.getPayload();
switch ( modelEvent.getOperation() )
{
case ADD:
add( modelEvent.getEntity() );
break;
case UPDATE:
modelChanged();
break;
case DELETE:
prune();
break;
default:
log.error( "onEvent caught invalid operation" );
break;
}
AjaxRequestTarget target = ( ( SaveModelEvent ) event.getPayload() ).getAjaxRequestTarget();
log.debug( ".onEvent AJAX - ObjectListPanel - SaveModelEvent: " + target.toString() );
}
}
示例8: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( final IEvent<?> event )
{
if ( event.getPayload() instanceof SelectModelEvent )
{
SelectModelEvent modelEvent = ( SelectModelEvent ) event.getPayload();
PwPolicy policy = ( PwPolicy ) modelEvent.getEntity();
this.setModelObject( policy );
String msg = "Policy: " + policy.getName() + " has been selected";
log.debug( ".onEvent SelectModelEvent: " + policy.getName() );
display.setMessage( msg );
component = editForm;
}
else if ( event.getPayload() instanceof AjaxRequestTarget )
{
// only add the form to ajax target if something has changed...
if ( component != null )
{
AjaxRequestTarget target = ( ( AjaxRequestTarget ) event.getPayload() );
log.debug( ".onEvent AjaxRequestTarget: " + target.toString() );
target.add( component );
component = null;
}
display.display( ( AjaxRequestTarget ) event.getPayload() );
}
}
示例9: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof DashboardEvent) {
DashboardEvent dashboardEvent = (DashboardEvent) event.getPayload();
DashboardEvent.EventType eventType = dashboardEvent.getType();
if (DashboardEvent.EventType.WIDGET_ADDED == eventType) {
onWidgetAdded(dashboardEvent);
} else if (DashboardEvent.EventType.WIDGET_REMOVED == eventType) {
onWidgetRemoved(dashboardEvent);
} else if (DashboardEvent.EventType.WIDGETS_SORTED == eventType) {
onWidgetsSorted(dashboardEvent);
}
}
}
示例10: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof EventDataWrapper) {
final EventDataWrapper data = (EventDataWrapper) event.getPayload();
if (data.getRows() < 1) {
updateResultTable(data.isCreate());
} else {
updateResultTable(data.isCreate(), data.getRows());
}
if (DirectoryPanel.this.container.isVisibleInHierarchy()) {
data.getTarget().add(DirectoryPanel.this.container);
}
}
super.onEvent(event);
}
示例11: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof EventSelectionChanged) {
final EventSelectionChanged eventSelectionChanged = (EventSelectionChanged) event.getPayload();
for (String toBeRemoved : eventSelectionChanged.getToBeRemoved()) {
model.getObject().remove(toBeRemoved);
}
for (String toBeAdded : eventSelectionChanged.getToBeAdded()) {
if (!model.getObject().contains(toBeAdded)) {
model.getObject().add(toBeAdded);
}
}
eventSelectionChanged.getTarget().add(selectionContainer);
}
}
示例12: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof CreateEvent) {
final CreateEvent resourceCreateEvent = CreateEvent.class.cast(event.getPayload());
final TopologyNode node = new TopologyNode(
resourceCreateEvent.getKey(),
resourceCreateEvent.getDisplayName(),
resourceCreateEvent.getKind());
newlyCreated.getModelObject().add(node);
resourceCreateEvent.getTarget().add(newlyCreatedContainer);
resourceCreateEvent.getTarget().appendJavaScript(String.format(
"window.Wicket.WebSocket.send('"
+ "{\"kind\":\"%s\",\"target\":\"%s\",\"source\":\"%s\",\"scope\":\"%s\"}"
+ "');",
SupportedOperation.ADD_ENDPOINT,
resourceCreateEvent.getKey(),
resourceCreateEvent.getParent(),
resourceCreateEvent.getKind()));
}
}
示例13: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
if (event.getPayload() instanceof UpdateEvent) {
final UpdateEvent updateEvent = UpdateEvent.class.cast(event.getPayload());
final String key = updateEvent.getKey();
final AjaxRequestTarget target = updateEvent.getTarget();
if (node.getKind() == Kind.CONNECTOR && key.equalsIgnoreCase(node.getKey())) {
ConnInstanceTO conn = new ConnectorRestClient().read(key);
String displayName =
// [SYNCOPE-1233]
StringUtils.isBlank(conn.getDisplayName()) ? conn.getBundleName() : conn.getDisplayName();
final String resourceName = displayName.length() > 14
? displayName.subSequence(0, 10) + "..."
: displayName;
label.setDefaultModelObject(resourceName);
target.add(label);
node.setDisplayName(displayName);
}
}
}
示例14: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof AjaxWizard.NewItemEvent) {
AjaxWizard.NewItemEvent<?> newItemEvent = AjaxWizard.NewItemEvent.class.cast(event.getPayload());
WizardModalPanel<?> modalPanel = newItemEvent.getModalPanel();
if (event.getPayload() instanceof AjaxWizard.NewItemActionEvent && modalPanel != null) {
final IModel<Serializable> model = new CompoundPropertyModel<>(modalPanel.getItem());
templateModal.setFormModel(model);
templateModal.header(newItemEvent.getResourceModel());
newItemEvent.getTarget().add(templateModal.setContent(modalPanel));
templateModal.show(true);
} else if (event.getPayload() instanceof AjaxWizard.NewItemCancelEvent) {
templateModal.close(newItemEvent.getTarget());
} else if (event.getPayload() instanceof AjaxWizard.NewItemFinishEvent) {
templateModal.close(newItemEvent.getTarget());
}
}
}
示例15: onEvent
import org.apache.wicket.event.IEvent; //导入依赖的package包/类
@Override
public void onEvent( final IEvent<?> event )
{
if ( event.getPayload() instanceof SelectModelEvent )
{
SelectModelEvent modelEvent = ( SelectModelEvent ) event.getPayload();
final Page3EO page3EO = ( Page3EO ) modelEvent.getEntity();
this.setModelObject(page3EO);
LOG.info("Received SelectModelEvent, customer: " + page3EO.getCustomer());
}
else if ( event.getPayload() instanceof AjaxRequestTarget )
{
AjaxRequestTarget target = ( ( AjaxRequestTarget ) event.getPayload() );
LOG.info( ".onEvent AjaxRequestTarget: " + target.toString() );
target.add( editForm );
}
}