01: /* *************************************************************************
02:
03: Millstone(TM)
04: Open Sourced User Interface Library for
05: Internet Development with Java
06:
07: Millstone is a registered trademark of IT Mill Ltd
08: Copyright (C) 2000-2005 IT Mill Ltd
09:
10: *************************************************************************
11:
12: This library is free software; you can redistribute it and/or
13: modify it under the terms of the GNU Lesser General Public
14: license version 2.1 as published by the Free Software Foundation.
15:
16: This library is distributed in the hope that it will be useful,
17: but WITHOUT ANY WARRANTY; without even the implied warranty of
18: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19: Lesser General Public License for more details.
20:
21: You should have received a copy of the GNU Lesser General Public
22: License along with this library; if not, write to the Free Software
23: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24:
25: *************************************************************************
26:
27: For more information, contact:
28:
29: IT Mill Ltd phone: +358 2 4802 7180
30: Ruukinkatu 2-4 fax: +358 2 4802 7181
31: 20540, Turku email: info@itmill.com
32: Finland company www: www.itmill.com
33:
34: Primary source for MillStone information and releases: www.millstone.org
35:
36: ********************************************************************** */
37:
38: package org.millstone.examples.features;
39:
40: import org.millstone.base.terminal.ExternalResource;
41: import org.millstone.base.ui.*;
42:
43: public class FeatureLink extends Feature {
44:
45: public FeatureLink() {
46: super ();
47: }
48:
49: protected Component getDemoComponent() {
50:
51: OrderedLayout l = new OrderedLayout();
52:
53: // Example panel
54: Panel show = new Panel("Link component");
55: Link lnk = new Link("Link caption", new ExternalResource(
56: "http://www.itmill.com"));
57: show.addComponent(lnk);
58: l.addComponent(show);
59:
60: // Properties
61: PropertyPanel p = new PropertyPanel(lnk);
62: Form ap = p.createBeanPropertySet(new String[] { "targetName",
63: "targetWidth", "targetHeight", "targetBorder" });
64: ap.replaceWithSelect("targetBorder", new Object[] {
65: new Integer(Link.TARGET_BORDER_DEFAULT),
66: new Integer(Link.TARGET_BORDER_MINIMAL),
67: new Integer(Link.TARGET_BORDER_NONE) }, new Object[] {
68: "Default", "Minimal", "None" });
69: p.addProperties("Link Properties", ap);
70: l.addComponent(p);
71:
72: return l;
73: }
74:
75: protected String getExampleSrc() {
76: return "Link lnk = new Link(\"Link caption\",new ExternalResource(\"http://www.itmill.com\"));\n";
77: }
78:
79: protected String getDescriptionXHTML() {
80: return "The link feature allows for making refences to both internal and external resources. "
81: + "The link can open the new resource in a new window, allowing for control of the newly "
82: + "opened windows attributes, such as size and border. "
83: + "<br /><br />"
84: + " For example you can create an application pop-up or create link to external resources.";
85:
86: }
87:
88: protected String getImage() {
89: return "link.jpg";
90: }
91:
92: protected String getTitle() {
93: return "Link";
94: }
95: }
|