KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portal > model > Component


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

5 package org.exoplatform.services.portal.model;
6
7 /**
8  * May 13, 2004
9  * @author: Tuan Nguyen
10  * @email: tuan08@users.sourceforge.net
11  * @version: $Id: Component.java,v 1.6 2004/11/03 01:23:55 tuan08 Exp $
12  **/

13 abstract public class Component implements Cloneable JavaDoc {
14     private String JavaDoc id = "" ;
15     private String JavaDoc renderer = "default";
16   private String JavaDoc decorator = "default";
17   private String JavaDoc width ;
18   private String JavaDoc height ;
19   
20   public Component() {
21     /* TODO : Test of user-agent and MIME type or markup parameters found
22      * in ExoPortalInfo instance (no yet implemented) to choose correct
23      * renderer (in order to adapt output with markup requested by client)
24      * for example :
25      * renderer = "xhtmlmp";
26      * for a mobile phone browser.
27      *
28      */

29   }
30   
31   public Component(String JavaDoc renderer, String JavaDoc style, String JavaDoc width, String JavaDoc height) {
32     this.renderer = renderer ;
33     this.decorator = style ;
34     this.width = width ;
35     this.height = height ;
36   }
37   
38   public String JavaDoc getId() { return id ;}
39   public void setId(String JavaDoc s) { id = s ; }
40   
41   public String JavaDoc getRenderer() { return renderer ; }
42   public void setRenderer(String JavaDoc s) {
43     if(s == null) renderer = "default" ;
44     else renderer = s ;
45   }
46   
47   public String JavaDoc getDecorator() { return decorator ; }
48   public void setDecorator(String JavaDoc s) {
49     if (s == null) decorator = "default" ;
50     else decorator = s ;
51   }
52   
53   public String JavaDoc getWidth() { return width ; }
54   public void setWidth(String JavaDoc s) { width = s ;}
55   
56   public String JavaDoc getHeight() { return height ; }
57   public void setHeight(String JavaDoc s) { height = s ;}
58   
59   public Object JavaDoc deepCloneObject() throws Exception JavaDoc {
60     return super.clone() ;
61   }
62   
63   abstract public Component softCloneObject() ;
64   
65   protected void copyBasicProperties(Component comp) {
66     id = comp.getId() ;
67     renderer = comp.getRenderer() ;
68     decorator = comp.getDecorator() ;
69     width = comp.getWidth() ;
70     height = comp.getHeight() ;
71   }
72 }
Popular Tags