2016-04-22 15:49:49 +02:00
|
|
|
package org.gcube.portlets.user.dataminermanager.client.events;
|
|
|
|
|
|
|
|
import org.gcube.portlets.user.dataminermanager.client.type.OperatorsClassificationRequestType;
|
2016-09-14 14:27:54 +02:00
|
|
|
import org.gcube.portlets.user.dataminermanager.shared.process.OperatorsClassification;
|
2016-04-22 15:49:49 +02:00
|
|
|
|
|
|
|
import com.google.gwt.event.shared.EventHandler;
|
|
|
|
import com.google.gwt.event.shared.GwtEvent;
|
|
|
|
import com.google.gwt.event.shared.HandlerRegistration;
|
|
|
|
import com.google.gwt.event.shared.HasHandlers;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Operators Classification Event
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author "Giancarlo Panichi" <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public class OperatorsClassificationEvent
|
|
|
|
extends
|
|
|
|
GwtEvent<OperatorsClassificationEvent.OperatorsClassificationEventHandler> {
|
|
|
|
|
|
|
|
public static Type<OperatorsClassificationEventHandler> TYPE = new Type<OperatorsClassificationEventHandler>();
|
|
|
|
private OperatorsClassificationRequestType operatorsClassificationRequestType;
|
|
|
|
private String classificationName;
|
|
|
|
private OperatorsClassification operatorsClassification;
|
2016-07-13 11:07:49 +02:00
|
|
|
private String operatorId;
|
|
|
|
|
|
|
|
public interface OperatorsClassificationEventHandler extends EventHandler {
|
2016-04-22 15:49:49 +02:00
|
|
|
void onOperatorsClassification(OperatorsClassificationEvent event);
|
|
|
|
}
|
|
|
|
|
2016-07-13 11:07:49 +02:00
|
|
|
public interface HasOperatorsClassificationEventHandler extends HasHandlers {
|
2016-04-22 15:49:49 +02:00
|
|
|
public HandlerRegistration addOperatorsClassificationEventHandler(
|
|
|
|
OperatorsClassificationEventHandler handler);
|
|
|
|
}
|
|
|
|
|
2016-07-13 11:07:49 +02:00
|
|
|
public OperatorsClassificationEvent(
|
|
|
|
OperatorsClassification operatorsClassification) {
|
2016-04-22 15:49:49 +02:00
|
|
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
2016-07-13 11:07:49 +02:00
|
|
|
this.operatorsClassification = operatorsClassification;
|
|
|
|
this.operatorId = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public OperatorsClassificationEvent(String classificationName,
|
|
|
|
OperatorsClassification operatorsClassification) {
|
|
|
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
|
|
|
this.classificationName = classificationName;
|
|
|
|
this.operatorsClassification = operatorsClassification;
|
|
|
|
this.operatorId = null;
|
2016-04-22 15:49:49 +02:00
|
|
|
}
|
2016-07-13 11:07:49 +02:00
|
|
|
|
2016-04-22 15:49:49 +02:00
|
|
|
public OperatorsClassificationEvent(
|
2016-07-13 11:07:49 +02:00
|
|
|
OperatorsClassification operatorsClassification, String operatorId) {
|
|
|
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.Default;
|
|
|
|
this.operatorsClassification = operatorsClassification;
|
|
|
|
this.operatorId = operatorId;
|
|
|
|
}
|
|
|
|
|
|
|
|
public OperatorsClassificationEvent(String classificationName,
|
|
|
|
OperatorsClassification operatorsClassification, String operatorId) {
|
2016-04-22 15:49:49 +02:00
|
|
|
this.operatorsClassificationRequestType = OperatorsClassificationRequestType.ByName;
|
2016-07-13 11:07:49 +02:00
|
|
|
this.classificationName = classificationName;
|
|
|
|
this.operatorsClassification = operatorsClassification;
|
|
|
|
this.operatorId = operatorId;
|
2016-04-22 15:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void dispatch(OperatorsClassificationEventHandler handler) {
|
|
|
|
handler.onOperatorsClassification(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Type<OperatorsClassificationEventHandler> getAssociatedType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Type<OperatorsClassificationEventHandler> getType() {
|
|
|
|
return TYPE;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void fire(HasHandlers source,
|
|
|
|
OperatorsClassificationEvent event) {
|
|
|
|
source.fireEvent(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
public OperatorsClassificationRequestType getOperatorsClassificationRequestType() {
|
|
|
|
return operatorsClassificationRequestType;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getClassificationName() {
|
|
|
|
return classificationName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public OperatorsClassification getOperatorsClassification() {
|
|
|
|
return operatorsClassification;
|
|
|
|
}
|
|
|
|
|
2016-07-13 11:07:49 +02:00
|
|
|
public String getOperatorId() {
|
|
|
|
return operatorId;
|
|
|
|
}
|
|
|
|
|
2016-04-22 15:49:49 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return "OperatorsClassificationEvent [operatorsClassificationRequestType="
|
|
|
|
+ operatorsClassificationRequestType
|
|
|
|
+ ", classificationName="
|
|
|
|
+ classificationName
|
|
|
|
+ ", operatorsClassification="
|
2016-07-13 11:07:49 +02:00
|
|
|
+ operatorsClassification + ", operatorId=" + operatorId + "]";
|
2016-04-22 15:49:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|