ckan-content-moderator-widget/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/events/SelectItemsWithItemStatusEv...

109 lines
2.5 KiB
Java
Raw Normal View History

2021-06-25 16:56:43 +02:00
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
2022-04-22 15:38:57 +02:00
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemFieldDV;
2021-06-25 16:56:43 +02:00
2022-02-18 14:17:19 +01:00
import com.github.gwtbootstrap.client.ui.constants.AlertType;
2021-06-25 16:56:43 +02:00
import com.google.gwt.event.shared.GwtEvent;
/**
2021-06-28 15:40:53 +02:00
* The Class SelectItemsWithItemStatusEvent.
2021-06-25 16:56:43 +02:00
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
2022-02-18 14:17:19 +01:00
* Jun 28, 2021
2021-06-25 16:56:43 +02:00
*/
2021-06-28 15:40:53 +02:00
public class SelectItemsWithItemStatusEvent extends GwtEvent<SelectItemsWithItemStatusEventHandler> {
public static Type<SelectItemsWithItemStatusEventHandler> TYPE = new Type<SelectItemsWithItemStatusEventHandler>();
2021-06-25 16:56:43 +02:00
private ItemStatus itemStatus;
2021-06-29 17:56:15 +02:00
private String displayMessage;
2022-02-18 14:17:19 +01:00
private AlertType alertType = AlertType.INFO;
2022-04-22 15:38:57 +02:00
private ItemFieldDV sortBy;
2021-06-25 16:56:43 +02:00
/**
* Instantiates a new click item event.
*
2022-02-18 14:17:19 +01:00
* @param itemStatus the item status
2021-06-29 17:56:15 +02:00
* @param displayMessage the display message
2022-02-18 14:17:19 +01:00
* @param alerType the aler type
2022-04-22 15:38:57 +02:00
* @param sortBy the sort by
*/
public SelectItemsWithItemStatusEvent(ItemStatus itemStatus, String displayMessage, AlertType alerType,
ItemFieldDV sortBy) {
this.itemStatus = itemStatus;
this.displayMessage = displayMessage;
this.alertType = alerType;
this.sortBy = sortBy;
}
/**
* Instantiates a new select items with item status event.
*
* @param itemStatus the item status
* @param displayMessage the display message
* @param alerType the aler type
2021-06-25 16:56:43 +02:00
*/
2022-02-18 14:17:19 +01:00
public SelectItemsWithItemStatusEvent(ItemStatus itemStatus, String displayMessage, AlertType alerType) {
2021-06-25 16:56:43 +02:00
this.itemStatus = itemStatus;
2021-06-29 17:56:15 +02:00
this.displayMessage = displayMessage;
2022-02-18 14:17:19 +01:00
this.alertType = alerType;
2021-06-25 16:56:43 +02:00
}
/**
* Gets the associated type.
*
* @return the associated type
*/
@Override
2021-06-28 15:40:53 +02:00
public Type<SelectItemsWithItemStatusEventHandler> getAssociatedType() {
2021-06-25 16:56:43 +02:00
return TYPE;
}
/**
* Dispatch.
*
* @param handler the handler
*/
@Override
2021-06-28 15:40:53 +02:00
protected void dispatch(SelectItemsWithItemStatusEventHandler handler) {
2021-06-25 16:56:43 +02:00
handler.onValueChanged(this);
}
/**
* Gets the item status.
*
* @return the item status
*/
public ItemStatus getItemStatus() {
return itemStatus;
}
2022-02-18 14:17:19 +01:00
2021-06-29 17:56:15 +02:00
/**
* Gets the display message.
*
* @return the display message
*/
public String getDisplayMessage() {
return displayMessage;
}
2021-06-25 16:56:43 +02:00
2022-02-18 14:17:19 +01:00
/**
* Gets the alert type.
*
* @return the alert type
*/
public AlertType getAlertType() {
return alertType;
}
2022-04-22 15:38:57 +02:00
/**
* Gets the sort by.
*
* @return the sort by
*/
public ItemFieldDV getSortBy() {
return sortBy;
}
2021-06-25 16:56:43 +02:00
}