package com.onaro.sanscreen.client.view.tabular;
import java.util.EventObject;
/**
* Describes a change to the grouping configuration.
*/
public class GroupingConfigEvent extends EventObject {
private static final long serialVersionUID = 1L;
/**
* The active schema before the change occured. Relevent only if the change
* describes a change to the active schema.
*/
private GroupingConfig.Schema oldSchema;
/**
* The active schema after the change occured. Relevent only if the change
* describes a change to the active schema.
*/
private GroupingConfig.Schema newSchema;
/**
* True if this change describes a change in the active schema.
*/
private boolean currentSchemaChanged;
/**
* Crates an event reporting on a change to the active schema.
* @param source the {@link GroupingConfig} that changed
* @param oldSchema the active schema before the change
* @param newSchema the active schema after the change
*/
public GroupingConfigEvent(Object source, GroupingConfig.Schema oldSchema,
GroupingConfig.Schema newSchema) {
super(source);
this.oldSchema = oldSchema;
this.newSchema = newSchema;
currentSchemaChanged = true;
}
/**
* Gets the active schema before the change occured. Relevent only if the change
* describes a change to the active schema.
* @return the active schema before the change
*/
public GroupingConfig.Schema getOldSchema() {
return oldSchema;
}
/**
* Gets the active schema after the change occured. Relevent only if the change
* describes a change to the active schema.
* @return the active schema after the change
*/
public GroupingConfig.Schema getNewSchema() {
return newSchema;
}
/**
* Tells if this change tells that the active schema changed.
* @return true if the active schema changed
*/
public boolean isCurrentSchemaChanged() {
return currentSchemaChanged;
}
}