76 lines
1.7 KiB
Java
76 lines
1.7 KiB
Java
package org.gcube.portlets.user.td.columnwidget.client.store;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
/**
|
|
*
|
|
* @author "Giancarlo Panichi" <a
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
*
|
|
*/
|
|
public class ShowOccurrencesTypeStore implements Serializable {
|
|
|
|
private static final long serialVersionUID = -1908324094430432681L;
|
|
private final static String ONLYERRORS="Only Errors";
|
|
private final static String ALL="All";
|
|
|
|
protected static ArrayList<ShowOccurrencesTypeElement> store;
|
|
|
|
public static ShowOccurrencesTypeElement onlyErrorsElement=new ShowOccurrencesTypeElement(1,ONLYERRORS);
|
|
public static ShowOccurrencesTypeElement allElement=new ShowOccurrencesTypeElement(2,ALL);
|
|
|
|
|
|
public static ArrayList<ShowOccurrencesTypeElement> getShowOccurrencesType(){
|
|
store=new ArrayList<ShowOccurrencesTypeElement>();
|
|
store.add(onlyErrorsElement);
|
|
store.add(allElement);
|
|
return store;
|
|
}
|
|
|
|
public static int selectedShowOccurrencesTypePosition(String selected){
|
|
int position=0;
|
|
if(selected.compareTo(ONLYERRORS)==0){
|
|
position=1;
|
|
} else {
|
|
if(selected.compareTo(ALL)==0){
|
|
position=2;
|
|
} else {
|
|
}
|
|
}
|
|
return position;
|
|
}
|
|
|
|
|
|
public static String selectedShowOccurrencesType(String selected){
|
|
if(selected.compareTo(ONLYERRORS)==0){
|
|
return ONLYERRORS;
|
|
} else {
|
|
if(selected.compareTo(ALL)==0){
|
|
return ALL;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
public static ShowOccurrencesTypeElement selectedShowOccurrencesTypeElement(String selected){
|
|
if(selected.compareTo(ONLYERRORS)==0){
|
|
return onlyErrorsElement;
|
|
} else {
|
|
if(selected.compareTo(ALL)==0){
|
|
return allElement;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|