KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > plaf > css > AnchorCG


1 /*
2  * $Id: AnchorCG.java,v 1.17 2005/05/26 13:18:09 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings.plaf.css;
15
16
17 import java.io.IOException JavaDoc;
18
19 import org.wings.SAnchor;
20 import org.wings.SComponent;
21 import org.wings.io.Device;
22
23 public class AnchorCG
24         extends AbstractComponentCG
25         implements org.wings.plaf.AnchorCG {
26     public void writeContent(final Device device,
27                              final SComponent _c)
28             throws IOException JavaDoc {
29         final SAnchor component = (SAnchor) _c;
30
31         device.print("<a HREF=\"");
32         device.print(component.getURL());
33         device.print("\"");
34
35         Utils.printCSSInlineFullSize(device, _c.getPreferredSize());
36         if (component.isFocusOwner())
37             Utils.optAttribute(device, "focus", component.getName());
38
39         Utils.optAttribute(device, "target", component.getTarget());
40         Utils.optAttribute(device, "name", component.getName());
41         Utils.optAttribute(device, "tabindex", component.getFocusTraversalIndex());
42         Utils.writeEvents(device, component);
43         device.print(">");
44         Utils.renderContainer(device, component);
45         device.print("</a>");
46     }
47 }
48
Popular Tags