Java Code Examples for org.apache.wicket.event.IEvent#stop()

The following examples show how to use org.apache.wicket.event.IEvent#stop() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LearningCurveChartPanel.java    From inception with Apache License 2.0 6 votes vote down vote up
@Override
public void onEvent(IEvent<?> event)
{
    super.onEvent(event);
    if (event.getPayload() instanceof DropDownEvent) {
        DropDownEvent dEvent = (DropDownEvent) event.getPayload();
        
        RecommenderEvaluationScoreMetricEnum aSelectedMetric = dEvent.getSelectedValue();
        AjaxRequestTarget target = dEvent.getTarget();
        
        target.add(this);

        selectedMetric = aSelectedMetric;
        LOG.debug("Option selected: " + aSelectedMetric);
        
        event.stop();
    }
}
 
Example 2
Source File: BeanListPropertyEditor.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 3
Source File: ProjectDependencyListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 4
Source File: ParamSpecListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 5
Source File: JobServiceListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 6
Source File: JobReportListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 7
Source File: JobDependencyListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 8
Source File: JobPrivilegeListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 9
Source File: JobTriggerListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 10
Source File: ActionListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 11
Source File: LocatorListEditPanel.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		onPropertyUpdating(((PropertyUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 12
Source File: PolymorphicPropertyEditor.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof BeanUpdating) {
		event.stop();
		onPropertyUpdating(((BeanUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 13
Source File: BeanPropertyEditor.java    From onedev with MIT License 5 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof BeanUpdating) {
		event.stop();
		onPropertyUpdating(((BeanUpdating)event.getPayload()).getHandler());
	}		
}
 
Example 14
Source File: UpdateOnActionPerformedEventBehavior.java    From Orienteer with Apache License 2.0 5 votes vote down vote up
@Override
public void onEvent(Component component, IEvent<?> wicketEvent) {
	Object payload = wicketEvent.getPayload();
	if(payload instanceof ActionPerformedEvent) {
		ActionPerformedEvent<?> event = (ActionPerformedEvent<?>)payload;
		if(event.isAjax() && match(component, event, wicketEvent)) {
			update(component, event, wicketEvent);
		}
		if(stopEvent) wicketEvent.stop();
	}
}
 
Example 15
Source File: BeanEditor.java    From onedev with MIT License 4 votes vote down vote up
@Override
public void onEvent(IEvent<?> event) {
	super.onEvent(event);
	
	if (event.getPayload() instanceof PropertyUpdating) {
		event.stop();
		PropertyUpdating propertyUpdating = (PropertyUpdating) event.getPayload();
		for (Component groupContainer: groupsView) {
			RepeatingView propertiesView = (RepeatingView) groupContainer.get("content").get("properties");
			for (Component propertyContainer: propertiesView) {
				@SuppressWarnings("unchecked")
				PropertyContext<Serializable> propertyContext = 
						(PropertyContext<Serializable>) propertyContainer.getDefaultModelObject(); 
				Set<String> checkedPropertyNames = new HashSet<>();
				if (hasTransitiveDependency(propertyContext.getPropertyName(), 
						propertyUpdating.getPropertyName(), checkedPropertyNames)) {
					/*
					 * Create new property container instead of simply refreshing it as some dependent 
					 * properties may only take effect when re-create the property container. For instance
					 * If default value of an issue field depends on input value of another issue field  
					 */
					PropertyContainer newPropertyContainer = 
							newPropertyContainer(propertyContainer.getId(), propertyContext);
					propertyContainer.replaceWith(newPropertyContainer);
					componentContexts.put(propertyContext.getPropertyName(), 
							new ComponentContext(newPropertyContainer));
					propertyUpdating.getHandler().add(newPropertyContainer);
					String script = String.format("$('#%s').addClass('no-autofocus');", 
							newPropertyContainer.getMarkupId());
					propertyUpdating.getHandler().appendJavaScript(script);
				}
			}
		}				
		
		convertInput();
		clearErrors();
		/**
		 * Bump up event even if some properties are invalid as we may need to do something with 
		 * partial properties of the bean. For instance to update issue description template
		 */
		send(this, Broadcast.BUBBLE, new BeanUpdating(propertyUpdating.getHandler()));
	}		
}