KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > core > comp > renderer > RenderStrategy


1 /*
2  * Copyright (C) 2003 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: RenderStrategy.java,v 1.3 2004/02/01 05:16:27 christianc Exp $
19  */

20 package org.enhydra.barracuda.core.comp.renderer;
21
22
23 //csc_110201.1 - added
24
/**
25  * This class defines several basic render strategies.
26  * <strong>NEVER_SCRIPT</strong> indicates that we want to avoid scripting at
27  * all costs, even if the client supports it. <strong>CUSTOM_SCRIPT</strong> is
28  * exactly like NEVER_SCIPT, except that indicates to Barracuda
29  * (component renderers, mostly) not to throw exceptions in cases where the
30  * rendered markup wouldn't be able to work properly without scripting. One
31  * should use CUSTOM_SCRIPT in cases where developer-created custom client-side
32  * scripts are already in use and Barracuda shouldn't be interfering with them.
33  * <strong>SCRIPT_AS_NEEDED</strong> indicates the renderer should feel free to
34  * use scripting as desired (assuming the client supports it of course). The
35  * default render strategy, defined by <strong>DEFAULT_RENDER_STRATEGY</strong,
36  * is SCRIPT_AS_NEEDED (unless modified at runtime).
37  */

38 public class RenderStrategy {
39
40     //concrete instances of strategies
41
public static final RenderStrategy SCRIPT_AS_NEEDED = new RenderStrategy();
42     public static final RenderStrategy NEVER_SCRIPT = new RenderStrategy();
43     public static final RenderStrategy CUSTOM_SCRIPT = new RenderStrategy();
44
45     public static RenderStrategy DEFAULT_RENDER_STRATEGY = SCRIPT_AS_NEEDED;
46
47     /**
48      * Protected constructor to prevent external instantiation
49      */

50     protected RenderStrategy() {}
51     
52 }
53
Popular Tags