Source Code Cross Referenced for ResourcesHelper.java in  » Web-Server » Jigsaw » org » w3c » jigadm » editors » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Server » Jigsaw » org.w3c.jigadm.editors 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // ResourcesHelper.java
002:        // $Id: ResourcesHelper.java,v 1.12 2000/08/16 21:37:27 ylafon Exp $
003:        // (c) COPYRIGHT MIT and INRIA, 1997.
004:        // Please first read the full copyright statement in file COPYRIGHT.html
005:
006:        package org.w3c.jigadm.editors;
007:
008:        import java.awt.BorderLayout;
009:        import java.awt.Button;
010:        import java.awt.Component;
011:        import java.awt.Container;
012:        import java.awt.GridBagConstraints;
013:        import java.awt.GridBagLayout;
014:        import java.awt.GridLayout;
015:        import java.awt.Label;
016:        import java.awt.Panel;
017:        import java.awt.ScrollPane;
018:        import java.awt.TextComponent;
019:        import java.awt.TextField;
020:
021:        import java.awt.event.ActionEvent;
022:        import java.awt.event.ActionListener;
023:
024:        import java.util.Hashtable;
025:        import java.util.Properties;
026:        import java.util.StringTokenizer;
027:
028:        import org.w3c.jigsaw.admin.RemoteAccessException;
029:        import org.w3c.jigsaw.admin.RemoteResource;
030:
031:        import org.w3c.jigadm.PropertyManager;
032:        import org.w3c.jigadm.RemoteResourceWrapper;
033:
034:        import org.w3c.tools.resources.Attribute;
035:
036:        import org.w3c.tools.widgets.FakeComboBox;
037:
038:        public class ResourcesHelper extends ResourceHelper {
039:
040:            class AddResourceListener implements  ActionListener {
041:
042:                public void actionPerformed(ActionEvent ae) {
043:                    addResource();
044:                }
045:            }
046:
047:            RemoteResourceWrapper rrw = null;
048:            RemoteResource rr = null;
049:            RemoteResource[] child = null;
050:            private boolean initialized = false;
051:            Properties prop;
052:            FakeComboBox combo;
053:            TextField tf;
054:            Panel widget;
055:            Panel addPanel = null;
056:
057:            protected void addResource() {
058:                if (tf.getText().length() > 0) {
059:                    RemoteResource nrr;
060:                    String selected = combo.getText();
061:                    if (selected != null)
062:                        if (selected.length() > 0) {
063:                            try {
064:                                nrr = rrw.getResource().registerResource(
065:                                        tf.getText(), selected);
066:                            } catch (RemoteAccessException ex) {
067:                                // Add a fancy error
068:                                return;
069:                            }
070:                            RemoteResourceWrapper nrrw;
071:                            nrrw = new RemoteResourceWrapper(rrw, nrr, rrw
072:                                    .getBrowser());
073:                            rrw.getBrowser()
074:                                    .insertNode(rrw, nrrw, tf.getText());
075:                        }
076:                }
077:            }
078:
079:            protected RemoteResourceWrapper getWrapper() {
080:                return rrw;
081:            }
082:
083:            public Component getComponent() {
084:                return widget;
085:            }
086:
087:            /**
088:             * commit changes (if any)
089:             * @exception RemoteAccessException if a remote access error occurs.
090:             */
091:            public void commitChanges() throws RemoteAccessException {
092:                if (!initialized)
093:                    return;
094:                return;
095:            }
096:
097:            public boolean hasChanged() {
098:                return false;
099:            }
100:
101:            public void resetChanges() {
102:            }
103:
104:            public void clearChanged() {
105:            }
106:
107:            public final String getTitle() {
108:                return "Resources";
109:            }
110:
111:            public ResourcesHelper() {
112:                widget = new Panel();
113:            }
114:
115:            protected void initAddPanel(Properties config) {
116:                if (addPanel == null) {
117:                    Panel tfp;
118:                    addPanel = new Panel(new BorderLayout());
119:
120:                    String af = (String) config
121:                            .get("org.w3c.jigadm.editors.resource.resources");
122:                    if (af == null)
123:                        return;
124:                    StringTokenizer st = new StringTokenizer(af, "|");
125:                    ScrollPane fsp = new ScrollPane();
126:                    GridBagLayout fgbl = new GridBagLayout();
127:                    GridBagConstraints fgbc = new GridBagConstraints();
128:                    Panel fspp = new Panel(fgbl);
129:                    fsp.add(fspp);
130:                    PropertyManager pm = PropertyManager.getPropertyManager();
131:                    String downPath = pm.getIconLocation("down");
132:                    String leftPath = pm.getIconLocation("left");
133:                    combo = new FakeComboBox(35, 7, true, downPath, leftPath);
134:                    while (st.hasMoreTokens())
135:                        combo.add(st.nextToken().trim());
136:                    fspp.add(combo);
137:                    addPanel.add("Center", fsp);
138:                    Button newb = new Button("Add Resource");
139:                    newb.addActionListener(new AddResourceListener());
140:                    addPanel.add("South", newb);
141:                    tfp = new Panel(new GridLayout(1, 2));
142:                    tf = new TextField();
143:                    tfp.add(new Label("identifier"));
144:                    tfp.add(tf);
145:                    addPanel.add("North", tfp);
146:                }
147:                widget.add("Center", addPanel);
148:
149:            }
150:
151:            /**
152:             * initialize this helper
153:             * @param rrw The RemoteResourceWrapper
154:             * @param pr The properties
155:             * @exception RemoteAccessException if a remote access error occurs.
156:             */
157:            public void initialize(RemoteResourceWrapper rrw, Properties pr)
158:                    throws RemoteAccessException {
159:                if (!initialized)
160:                    initialized = true;
161:                else
162:                    return;
163:
164:                this .rrw = rrw;
165:                rr = rrw.getResource();
166:                widget.setLayout(new BorderLayout());
167:                initAddPanel(pr);
168:            }
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.