gt: 		retVal[2] = getFileTypeCBItem(FileType.PICTURES);
context: /*
   * PS3 Media Server, for streaming any medias to your PS3.
   * Copyright (C) 2012  Ph.Waeber
   *
   * This program is free software; you can redistribute it and/or
   * modify it under the terms of the GNU General Public License
   * as published by the Free Software Foundation; version 2
   * of the License only.
   *
   * This program is distributed in the hope that it will be useful,
   * but WITHOUT ANY WARRANTY; without even the implied warranty of
   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   * GNU General Public License for more details.
   *
   * You should have received a copy of the GNU General Public License
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
   */
  package net.pms.medialibrary.commons.helpers;
  
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.HashMap;
  import java.util.List;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import net.pms.Messages;
  import net.pms.medialibrary.commons.dataobjects.comboboxitems.ConditionOperatorCBItem;
  import net.pms.medialibrary.commons.dataobjects.comboboxitems.ConditionTypeCBItem;
  import net.pms.medialibrary.commons.dataobjects.comboboxitems.ConditionUnitCBItem;
  import net.pms.medialibrary.commons.dataobjects.comboboxitems.FileTypeCBItem;
  import net.pms.medialibrary.commons.enumarations.ConditionOperator;
  import net.pms.medialibrary.commons.enumarations.ConditionType;
  import net.pms.medialibrary.commons.enumarations.ConditionUnit;
  import net.pms.medialibrary.commons.enumarations.ConditionValueType;
  import net.pms.medialibrary.commons.enumarations.FileType;
  import net.pms.medialibrary.storage.MediaLibraryStorage;
  
  public class FolderHelper {
  	private static final Logger log = LoggerFactory.getLogger(FolderHelper.class);
  	public HashMap<ConditionType, ConditionOperatorCBItem[]> typeOperators;
  	private static FolderHelper staticHelper;
  
  	private FolderHelper() {
  		init();
  	}
  
  	public static FolderHelper getInstance() {
  		if (staticHelper == null) {
  			staticHelper = new FolderHelper();
  		}
  		return staticHelper;
  	}
  
  	private void init() {
  		this.typeOperators = new HashMap<ConditionType, ConditionOperatorCBItem[]>();
  
  		for (ConditionType ct : ConditionType.values()) {
  			ConditionOperator[] operators = getConditionOperatorForType(ct);
  			ConditionOperatorCBItem[] op = new ConditionOperatorCBItem[operators.length];
  			int i = 0;
  			for (ConditionOperator co : operators) {
  				try {
  					String name;
  					if (ct.toString().contains("_CONTAINS_")) {
  						// use a different localization string for these conditions
  						name = Messages.getString("ML.Condition.Operator.Contains." + co.toString());
  					} else {
  						name = Messages.getString("ML.Condition.Operator." + co.toString());
  					}
  					op[i++] = new ConditionOperatorCBItem(co, name);
  				} catch (Exception ex) {
  					log.error("Failed to initialize FolderHelper", ex);
  				}
  			}
  			this.typeOperators.put(ct, op);
  		}
  
  	}
  
  	private ConditionOperator[] getConditionOperatorForType(ConditionType conditionType) {
  		ConditionOperator[] retVal = new ConditionOperator[0];
  
  		if (conditionType == ConditionType.FILE_TYPE
  				|| conditionType == ConditionType.VIDEO_MUXABLE) {
  			retVal = new ConditionOperator[2];
  			retVal[0] = ConditionOperator.IS;
  			retVal[1] = ConditionOperator.IS_NOT;
  		} else if (conditionType == ConditionType.FILE_FILENAME
  				|| conditionType == ConditionType.FILE_FOLDERPATH
  				|| conditionType == ConditionType.FILE_THUMBNAILPATH
  				|| conditionType == ConditionType.VIDEO_ORIGINALNAME
  				|| conditionType == ConditionType.VIDEO_IMDBID
  				|| conditionType == ConditionType.VIDEO_HOMEPAGEURL
  				|| conditionType == ConditionType.VIDEO_TRAILERURL
  				|| conditionType == ConditionType.VIDEO_CERTIFICATION
  				|| conditionType == ConditionType.VIDEO_CERTIFICATIONREASON
  				|| conditionType == ConditionType.VIDEO_ASPECTRATIO
  				|| conditionType == ConditionType.VIDEO_BITRATE
  				|| conditionType == ConditionType.VIDEO_DIRECTOR
  				|| conditionType == ConditionType.VIDEO_FRAMERATE
  				|| conditionType == ConditionType.VIDEO_NAME
  				|| conditionType == ConditionType.VIDEO_SORTNAME
  				|| conditionType == ConditionType.VIDEO_CODECV
  				|| conditionType == ConditionType.VIDEO_MODEL
  				|| conditionType == ConditionType.VIDEO_CONTAINER
  				|| conditionType == ConditionType.VIDEO_MIMETYPE
  				|| conditionType == ConditionType.VIDEO_OVERVIEW
  				|| conditionType == ConditionType.VIDEO_TAGLINE
  				|| conditionType == ConditionType.VIDEO_MUXINGMODE
  				|| conditionType == ConditionType.AUDIO_LANG
  				|| conditionType == ConditionType.AUDIO_NRAUDIOCHANNELS
  				|| conditionType == ConditionType.AUDIO_CODECA
  				|| conditionType == ConditionType.AUDIO_ALBUM
  				|| conditionType == ConditionType.AUDIO_ARTIST
  				|| conditionType == ConditionType.AUDIO_SONGNAME
  				|| conditionType == ConditionType.AUDIO_GENRE
  				|| conditionType == ConditionType.AUDIO_SAMPLEFREQ) {
  			retVal = new ConditionOperator[8];
  			retVal[0] = ConditionOperator.IS;
  			retVal[1] = ConditionOperator.IS_NOT;
  			retVal[2] = ConditionOperator.STARTS_WITH;
  			retVal[3] = ConditionOperator.DOES_NOT_START_WITH;
  			retVal[4] = ConditionOperator.ENDS_WITH;
  			retVal[5] = ConditionOperator.DOES_NOT_END_WITH;
  			retVal[6] = ConditionOperator.CONTAINS;
  			retVal[7] = ConditionOperator.DOES_NOT_CONTAIN;
  		} else if (conditionType == ConditionType.FILE_DATELASTUPDATEDDB
  				|| conditionType == ConditionType.FILE_DATEINSERTEDDB
  				|| conditionType == ConditionType.FILE_DATEMODIFIEDOS
  				|| conditionType == ConditionType.FILEPLAYS_DATEPLAYEND) {
  			retVal = new ConditionOperator[4];
  			retVal[0] = ConditionOperator.IS_AFTER;
  			retVal[1] = ConditionOperator.IS_BEFORE;
  			retVal[2] = ConditionOperator.IS_IN_THE_LAST_SEC;
  			retVal[3] = ConditionOperator.IS_NOT_IN_THE_LAST_SEC;
  		} else if (conditionType == ConditionType.FILE_SIZEBYTE
  				|| conditionType == ConditionType.FILE_PLAYCOUNT
  				|| conditionType == ConditionType.VIDEO_BUDGET
  				|| conditionType == ConditionType.VIDEO_REVENUE
  				|| conditionType == ConditionType.VIDEO_TMDBID
  				|| conditionType == ConditionType.VIDEO_RATINGPERCENT
  				|| conditionType == ConditionType.VIDEO_RATINGVOTERS
  				|| conditionType == ConditionType.VIDEO_BITSPERPIXEL
  				|| conditionType == ConditionType.VIDEO_DURATIONSEC
  				|| conditionType == ConditionType.VIDEO_HEIGHT
  				|| conditionType == ConditionType.VIDEO_WIDTH
  				|| conditionType == ConditionType.VIDEO_YEAR
  				|| conditionType == ConditionType.VIDEO_DVDTRACK
  				|| conditionType == ConditionType.IMAGE_WIDTH
  				|| conditionType == ConditionType.IMAGE_HEIGHT
  				|| conditionType == ConditionType.AUDIO_BITSPERSAMPLE
  				|| conditionType == ConditionType.AUDIO_YEAR
  				|| conditionType == ConditionType.AUDIO_TRACK
  				|| conditionType == ConditionType.AUDIO_DELAYMS
  				|| conditionType == ConditionType.AUDIO_DURATION_SEC) {
  			retVal = new ConditionOperator[4];
  			retVal[0] = ConditionOperator.IS;
  			retVal[1] = ConditionOperator.IS_NOT;
  			retVal[2] = ConditionOperator.IS_GREATER_THAN;
  			retVal[3] = ConditionOperator.IS_LESS_THAN;
  		} else if (conditionType == ConditionType.FILE_CONTAINS_TAG
  				|| conditionType == ConditionType.VIDEO_CONTAINS_GENRE
  				|| conditionType == ConditionType.VIDEO_CONTAINS_SUBTITLES
  				|| conditionType == ConditionType.VIDEO_CONTAINS_VIDEOAUDIO) {
  			retVal = new ConditionOperator[4];
  			retVal[0] = ConditionOperator.IS;
  			retVal[1] = ConditionOperator.CONTAINS;
  			retVal[2] = ConditionOperator.STARTS_WITH;
  			retVal[3] = ConditionOperator.ENDS_WITH;
  		}
  
  		return retVal;
  	}
  
  	public ConditionOperatorCBItem[] getConditionOperators(ConditionType conditionType) {
  		return this.typeOperators.get(conditionType);
  	}
  
  	public ConditionOperatorCBItem getConditionOperatorCBItem(ConditionOperator conditionOperator) {
  		String name = Messages.getString("ML.Condition.Operator." + conditionOperator.toString());
  		return new ConditionOperatorCBItem(conditionOperator, name);
  	}
  
  	public ConditionTypeCBItem getConditionTypeCBItem(ConditionType conditionType) {
  		String name = Messages.getString("ML.Condition.Type." + conditionType.toString());
  		return new ConditionTypeCBItem(conditionType, name);
  	}
  
  	public ConditionTypeCBItem getMaskCBItem(ConditionType conditionType) {
  		return new ConditionTypeCBItem(conditionType, Messages.getString("ML.Condition.Header.Type." + conditionType));
  	}
  
  	public ConditionUnitCBItem getConditionUnitCBItem(ConditionUnit unit) {
  		return new ConditionUnitCBItem(unit, Messages.getString("ML.Condition.Unit." + unit));
  	}
  
  	public FileTypeCBItem[] getAllFileTypeCBItems() {
  		FileTypeCBItem[] retVal = new FileTypeCBItem[4];
  		retVal[0] = getFileTypeCBItem(FileType.VIDEO);
  		retVal[1] = getFileTypeCBItem(FileType.AUDIO);
  