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.fragments; 016 017import org.nuxeo.theme.models.Model; 018import org.nuxeo.theme.models.Region; 019import org.nuxeo.theme.properties.FieldInfo; 020 021public final class RegionFragment extends AbstractFragment { 022 023 @FieldInfo(type = "string", label = "region name", description = "The name of the region from which content is inserted.") 024 public String name = ""; 025 026 @FieldInfo(type = "text area", label = "default body", description = "The default HTML content to insert if the region is not filled.") 027 public String defaultBody = ""; 028 029 @FieldInfo(type = "string", label = "default source", description = "The source of the HTML content to insert if the region is not filled.") 030 public String defaultSrc = ""; 031 032 public RegionFragment() { 033 } 034 035 public RegionFragment(String name, String defaultBody, String defaultSrc) { 036 this.name = name; 037 this.defaultBody = defaultBody; 038 this.defaultSrc = defaultSrc; 039 } 040 041 @Override 042 public Model getModel() { 043 return new Region(name, defaultBody, defaultSrc); 044 } 045 046}