Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
This file is part of Port@l Port@l 3.0 - Portal Engine and Management System Copyright (C) 2010 Isotrol, SA. http://www.isotrol.com Port@l 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, either version 3 of the License, or (at your option) any later version. Port@l 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 Port@l. If not, see <http://www.gnu.org/licenses/>.
 
 
 package com.isotrol.impe3.extensions.wurfl;
 
 import java.util.Map;
 
 
 		implements DeviceCapabilities {
 
 	private final String RESOLUTION_WIDTH = "resolution_width";
 	private final String XHTML_SUPPORT_LEVEL = "xhtml_support_level";
 	private final String HTML_WEB_4_0 = "html_web_4_0";
 	private final String FULL_FLASH_SUPPORT = "full_flash_support";
 	private final String MAX_IMAGE_WIDTH = "max_image_width";
 	private final String VIEWPORT_WIDTH = "viewport_width";
 	private final String VIEWPORT_DEVICE_WITH_TOKEN = "device_width_token";
 	private final String VIEWPORT_WIDTH_EQUALS_RESOLUTION_WIDTH = "width_equals_resolution_width";
 	private final String VIEWPORT_WIDTH_EQUALS_MAX_IMAGE_WIDTH = "width_equals_max_image_width";
 	
 	
 	private final Map<StringStringcaps;
 	
 	private final int width;
 	private final boolean flash;
 	private final boolean html4;
 	private final boolean xhtml;
 
 	public WURFLDeviceCapabilities(Map<StringStringoriginal) {
 		 = original == null ? ImmutableMap.<StringStringof()
 				: ImmutableMap.copyOf(original);
 		
 	}
 
 	private int guessWidth(Map<StringStringmap) {
 		final String viewport = map.get();
 		
 		final String w;
 		
 		if (viewport == null) {
 			w = map.get();
 		} else if (viewport.trim().length() == 0) {
 			w = map.get();
 		} else if (.equals(viewport)) {
 			w = map.get();
 		} else if (.equals(viewport)) {
 			w = map.get();
 		} else if (.equals(viewport)) {
 			w = map.get();
 		} else {
 			w = map.get();
 		}
 		
 		try {
 			return Integer.parseInt(w);	
 		} catch (Exception e) {
 			return 1024;
 		}
 	}
 	private boolean guessFlash(Map<StringStringmap) {
 		final String f = map.get();
 		return f != null && "true".equals(f.trim());
 	}
 	private boolean guessHtml4(Map<StringStringmap) {
 		final String h = map.get();
 		return h != null && "true".equals(h.trim());
 	}
 	private boolean guessXhtml(Map<StringStringmap) {
 		int level = -1;
 
 		try {
 			level = Integer.parseInt(map.get());
 		} catch(Exception e) {
 		}
 		
		return level >= 0;
	}
	public int getWidth() {
		return ;
	}
	public boolean isFlashSupported() {
		return ;
	}
	public boolean isHTML4Supported() {
		return ;
	}
	public boolean isXHTMLSupported() {
		return ;
	}
	protected Map<StringStringdelegate() {
		return ;
	}
New to GrepCode? Check out our FAQ X