001/* 002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Jean-Marc Orliaguet, Chalmers 011 * 012 * $Id$ 013 */ 014 015package org.nuxeo.theme; 016 017import java.util.Arrays; 018import java.util.List; 019 020import org.nuxeo.common.xmap.annotation.XNode; 021import org.nuxeo.common.xmap.annotation.XObject; 022import org.nuxeo.theme.types.Type; 023import org.nuxeo.theme.types.TypeFamily; 024 025@XObject("preview") 026public class PreviewType implements Type { 027 028 @XNode("@category") 029 protected String category; 030 031 @XNode("class") 032 protected String className; 033 034 @XNode("properties") 035 protected String properties = ""; 036 037 public TypeFamily getTypeFamily() { 038 return TypeFamily.PREVIEW; 039 } 040 041 public String getTypeName() { 042 return category; 043 } 044 045 public PreviewType() { 046 } 047 048 public PreviewType(String category, String className, String properties) { 049 this.category = category; 050 this.className = className; 051 this.properties = properties; 052 } 053 054 public String getCategory() { 055 return category; 056 } 057 058 public String getClassName() { 059 return className; 060 } 061 062 public List<String> getProperties() { 063 return Arrays.asList(properties.split(",")); 064 } 065 066}