API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.web.view. JOTViewTag View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

/*
------------------------------------
JavaOnTracks          Thibaut Colar
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.web.view;

import java.util.Hashtable;

/**
 * Represents an individual HTML tags
 * So we can "customize" it on the fly: ie: redefine/add a property (class="myclass") or a flag (DISABLED) etc...
 * @author thibautc
 */
public class JOTViewTag extends JOTViewBlock
{
	/**
	 *  HTML TAG property
	 *  ie: class=mycssclass   border=1   etc ...
	 */
	Hashtable properties=new Hashtable();
	/**
	 * HTML FLags
	 * ie: DISABLED    CHECKED etc ....
	 */
	Hashtable flags=new Hashtable();
	
	public Hashtable getTagProperties()
	{
		return properties;
	}
	
	public Hashtable getFlags()
	{
		return flags;
	}
	/**
	 * This allows to redefine (or add new) HTML tags to the block.
	 * For example say you have this block: <div class="default" jotid="block1"/>
	 * You have added the following htmlTags using setHtmlTags: ["class","css1"] ["border","2"]
	 * The htmnl output will look like this:
	 * <div class="css1" border="2"/>
	 */
	public void setTagProperty(String name, String value)
	{
		properties.put(name, value);
	}
	
	/**
	 * Unset a tag property, so that it will be left alone.
	 * @param name
	 * @param value
	 */
	public void unsetTagProperty(String name)
	{
		properties.remove(name);
	}

	/**
	 * Used to set a FLAG on an html element.
	 * A flag is a property that as no value: for example things like "DISABLED" or "CHECKED"
	 * @param flack
	 */
	public void setFlag(String flag)
	{
		flags.put(flag,Boolean.TRUE);
	}
	/**
	 * Remove a flag from the HTML (if found)
	 * @param flag
	 */
	public void removeFlag(String flag)
	{
		flags.put(flag,Boolean.FALSE);
	}
	
}

Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar