Source Code Cross Referenced for ConnectionAction.java in  » Net » SkunkDAV » org » skunk » dav » client » gui » action » 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 » Net » SkunkDAV » org.skunk.dav.client.gui.action 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Copyright (c) 2000, Jacob Smullyan.
003:         *
004:         *  This is part of SkunkDAV, a WebDAV client.  See http://skunkdav.sourceforge.net/ 
005:         *  for the latest version.
006:         * 
007:         *  SkunkDAV is free software; you can redistribute it and/or
008:         *  modify it under the terms of the GNU General Public License as published
009:         *  by the Free Software Foundation; either version 2, or (at your option)
010:         *  any later version.
011:         * 
012:         *  SkunkDAV  is distributed in the hope that it will be useful,
013:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *  General Public License for more details.
016:         * 
017:         *  You should have received a copy of the GNU General Public License
018:         *  along with SkunkDAV; see the file COPYING.  If not, write to the Free
019:         *  Software Foundation, 59 Temple Place - Suite 330, Boston, MA
020:         *  02111-1307, USA.
021:         */
022:
023:        package org.skunk.dav.client.gui.action;
024:
025:        import java.awt.Component;
026:        import java.awt.event.ActionEvent;
027:        import java.util.Vector;
028:        import javax.swing.AbstractAction;
029:        import org.skunk.dav.client.gui.ConnectionDialog;
030:        import org.skunk.dav.client.gui.Explorer;
031:        import org.skunk.dav.client.gui.ExplorerMenuBar;
032:        import org.skunk.dav.client.gui.ResourceManager;
033:        import org.skunk.dav.client.gui.ServerData;
034:        import org.skunk.dav.client.gui.StateMonitor;
035:        import org.skunk.dav.client.gui.StateProperties;
036:
037:        public class ConnectionAction extends AbstractAction {
038:            public static final String CONNECTION_MESSAGE = ResourceManager
039:                    .getMessage(ResourceManager.CONNECTION_PROMPT, 50);
040:            public static final String CONNECTION_TITLE = ResourceManager
041:                    .getMessage(ResourceManager.CONNECT_KEY);
042:            public static final String NEW_CONNECTION_OPTION = ResourceManager
043:                    .getMessage(ResourceManager.ADD_NEW_CONNECTION_LABEL);
044:            public static final String REMOVE_CONNECTION_OPTION = ResourceManager
045:                    .getMessage(ResourceManager.REMOVE_CONNECTION_LABEL);
046:            public static final String CHOOSE_COMMAND = "choose";
047:            public static final String CONNECT_COMMAND = "connect";
048:            private Explorer ex = null;
049:            private ServerData sd = null;
050:
051:            public ConnectionAction() {
052:                super ();
053:            }
054:
055:            public ConnectionAction(Explorer ex) {
056:                super ();
057:                this .ex = ex;
058:            }
059:
060:            public ConnectionAction(Explorer ex, ServerData sd) {
061:                super ();
062:                this .ex = ex;
063:                this .sd = sd;
064:            }
065:
066:            protected static Object[] getServerArray() {
067:                Vector v = (Vector) ServerData.getServers().clone();
068:                v.addElement(NEW_CONNECTION_OPTION);
069:                v.addElement(REMOVE_CONNECTION_OPTION);
070:                return v.toArray();
071:            }
072:
073:            public void actionPerformed(ActionEvent ae) {
074:                String actionCommand = (ae == null) ? CONNECT_COMMAND : ae
075:                        .getActionCommand();
076:
077:                if (CHOOSE_COMMAND.equals(actionCommand)) {
078:                    Explorer localExplorer = (ex == null) ? Explorer
079:                            .guessActiveExplorer() : ex;
080:                    ConnectionDialog conDialog = new ConnectionDialog(
081:                            localExplorer);
082:                    if (conDialog.show()) {
083:                        ServerData localServerData = conDialog.getServerData();
084:                        if (localServerData != null)
085:                            localExplorer.addConnectionNode(localServerData,
086:                                    new ConnectionRunner(localExplorer));
087:                    }
088:                } else if (CONNECT_COMMAND.equals(actionCommand)) {
089:                    if (ex != null && sd != null) {
090:                        ex.addConnectionNode(sd, new ConnectionRunner(ex));
091:                    }
092:                }
093:            }
094:
095:            private static class ConnectionRunner implements  Runnable {
096:                private Explorer ex;
097:
098:                ConnectionRunner(Explorer ex) {
099:                    this .ex = ex;
100:                }
101:
102:                public void run() {
103:                    StateMonitor.setProperty(StateProperties.CONNECTED,
104:                            new Boolean(true), this .ex);
105:                }
106:            }
107:        }
108:
109:        /* $Log: ConnectionAction.java,v $
110:         /* Revision 1.13  2001/06/05 01:09:53  smulloni
111:         /* fixed bug wtih failed connection attempts, which used to set the
112:         /* connection flag as if the connection had succeeded.
113:         /*
114:         /* Revision 1.12  2001/05/30 03:49:35  smulloni
115:         /* Some bug fixes and improvements to authentication handling.  Users are now
116:         /* prompted for a password the first time they connect to a given server
117:         /* in a session; if the password is rejected, they are asked again.
118:         /* Users also now have the option of whether a given password will be remembered
119:         /* or not.
120:         /*
121:         /* Revision 1.11  2001/01/05 08:01:12  smulloni
122:         /* changes to the connection gui for the Explorer; added depth configurability to
123:         /* propfind in the jpython test script; added an experimental "allprop" system
124:         /* property which affects the propfind query type
125:         /*
126:         /* Revision 1.10  2000/12/19 22:36:05  smulloni
127:         /* adjustments to preamble.
128:         /*
129:         /* Revision 1.9  2000/12/04 23:51:16  smulloni
130:         /* added ImageViewer; fixed word in SimpleTextEditor
131:         /*
132:         /* Revision 1.8  2000/12/03 23:53:26  smulloni
133:         /* added license and copyright preamble to java files.
134:         /*
135:         /* Revision 1.7  2000/11/18 04:36:05  smullyan
136:         /* work on StateMonitor and related functionality.
137:         /*
138:         /* Revision 1.6  2000/11/10 22:40:09  smullyan
139:         /* added icon to table for resource type; fixes to copy and move; disabling of
140:         /* menu items that are inappropriate.
141:         /*
142:         /* Revision 1.5  2000/11/09 23:35:01  smullyan
143:         /* log added to every Java file, with the help of python.  Lock stealing
144:         /* implemented, and treatment of locks made more robust.
145:         /* */
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.