Source Code Cross Referenced for SVNSettingsDialog.java in  » IDE » tIDE » tide » exttools » SVN » 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 » IDE » tIDE » tide.exttools.SVN 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package tide.exttools.SVN;
002:
003:        import java.awt.Insets;
004:        import java.awt.FlowLayout;
005:        import tide.project.*;
006:        import tide.editor.*;
007:        import javax.swing.*;
008:        import java.awt.BorderLayout;
009:        import java.awt.event.*;
010:        import javax.swing.border.*;
011:        import java.util.*;
012:        import java.io.*;
013:        import snow.utils.*;
014:        import snow.utils.storage.*;
015:        import snow.utils.gui.*;
016:
017:        /** todo: manage an exclusive access (lock)
018:         */
019:        public final class SVNSettingsDialog extends JDialog {
020:            private final FileField svnRootPath = new FileField("", false,
021:                    "Give the subversion root path",
022:                    JFileChooser.DIRECTORIES_ONLY);
023:            private final JTextField repositoryPath = new JTextField("", 40);
024:            private final JTextField username = new JTextField("", 10);
025:            private final JPasswordField password = new JPasswordField("", 10);
026:
027:            public static String defaultSVNLocation = "c:/program files/Subversion";
028:            public static String homepage = "http://subversion.tigris.org/";
029:
030:            public boolean dialogWasAccepted = false;
031:
032:            public SVNSettingsDialog(final JFrame parent,
033:                    final ProjectSettings settings) {
034:                super (parent, "Subversion (SVN) settings", true);
035:
036:                JComponent tae = GUIUtils
037:                        .createReadOnlyDescriptionArea("Subversion (SVN) is an external tool for doing version control ("
038:                                + homepage
039:                                + ")."
040:                                + "\r\nIt manages/shares/stores source files, with versions, to work with other persons over the net"
041:                                + "\non the same project at the same time."
042:                                + "\n\nREMARK: tIDE SVN support is currently minimal. Only english SVN is supported."
043:                                + "\n   If necessary, rename the folder share/locale in share/locale__."
044:                                + "\nREMARK: You must have checked out the working directory and it must point on the project sources home."
045:                                + "\n\nUSAGE: check in/out files from the sources tree popup menu. Hold CTRL for quick access.");
046:                add(tae, BorderLayout.NORTH);
047:
048:                JPanel inputPanel = new JPanel();
049:                add(inputPanel, BorderLayout.CENTER);
050:                GridLayout3 gl3 = new GridLayout3(2, inputPanel);
051:
052:                gl3.addSeparator();
053:                gl3.add("SVN location");
054:                gl3.add(svnRootPath);
055:                svnRootPath.setPath(settings.getProperty("Subversion_path",
056:                        defaultSVNLocation));
057:                svnRootPath.offerRememberedGlobalCompletion(
058:                        MainEditorFrame.instance.globalProperties, "knownSVNs");
059:                svnRootPath.setComponentWidth(300);
060:                svnRootPath.setAutoColorized();
061:
062:                gl3.add("Repository URL");
063:                JPanel rp = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
064:                gl3.add(rp);
065:                rp.add(repositoryPath);
066:                repositoryPath.setText(settings.getProperty(
067:                        "Subversion_repositoryPath", ""));
068:                // Todo: test button.
069:                JButton test = new JButton("test");
070:                test.setFocusPainted(false);
071:                test.setMargin(new Insets(0, 2, 0, 2));
072:                rp.add(test);
073:                test.addActionListener(new ActionListener() {
074:                    public void actionPerformed(ActionEvent ae) {
075:                        try {
076:                            test();
077:                        } catch (Exception e) {
078:                            JOptionPane.showMessageDialog(null, "Test failed: "
079:                                    + e.getMessage(), "SVN test failed",
080:                                    JOptionPane.ERROR_MESSAGE);
081:                        }
082:
083:                    }
084:                });
085:
086:                gl3.add("Username");
087:                gl3.add(username);
088:                username.setText(settings
089:                        .getProperty("Subversion_username", ""));
090:
091:                gl3.add("password");
092:                gl3.add(password);
093:                password.setText(settings
094:                        .getProperty("Subversion_password", ""));
095:
096:                CloseControlPanel ccp = new CloseControlPanel(this , true, true,
097:                        "Ok");
098:                add(ccp, BorderLayout.SOUTH);
099:
100:                pack();
101:                this .setLocationRelativeTo(parent);
102:                this .setVisible(true); // MODAL => waits
103:
104:                if (ccp.getWasCancelled())
105:                    return;
106:
107:                dialogWasAccepted = true;
108:
109:                // save settings
110:                settings.setProperty("Subversion_path", svnRootPath
111:                        .getTextField().getText());
112:                settings.setProperty("Subversion_repositoryPath",
113:                        repositoryPath.getText());
114:                settings.setProperty("Subversion_username", username.getText());
115:                settings.setProperty("Subversion_password", new String(password
116:                        .getPassword()));
117:
118:                svnRootPath.rememberPathForGlobalCompletion(
119:                        MainEditorFrame.instance.globalProperties, "knownSVNs");
120:
121:            }
122:
123:            // Todo: test password...
124:            void test() throws Exception {
125:                List<String> args = new ArrayList<String>();
126:                args.add(""
127:                        + svnRootPath.getPath()
128:                        + (SysUtils.is_Windows_OS() ? "/bin/svn.exe"
129:                                : "/bin/svn"));
130:                args.add("info"); // list ?
131:                args.add(this .repositoryPath.getText());
132:                //args.add("--verbose");  // show a lot of infos
133:
134:                //ProcessBuilder pb = new ProcessBuilder(args);
135:                //Process proc = pb.start();
136:                String rep = ProcessUtils
137:                        .readWholeProcessStack(args, 15 * 1000);
138:
139:                JDialog optionsDialog = new JDialog(this , "SVN test", false);
140:                JTextPane tp = new JTextPane();
141:                tp.setFont(MainEditorFrame.fixedWidthFontForProcesses);
142:                tp.setText(rep.trim());
143:                optionsDialog.add(new JScrollPane(tp), BorderLayout.CENTER);
144:                CloseControlPanel ccp = new CloseControlPanel(optionsDialog,
145:                        false, true, "Close");
146:                //ccp.getOkButton().setIcon(Icons.OkIcon.shared10);
147:                optionsDialog.add(ccp, BorderLayout.SOUTH);
148:                tp.setEditable(false);
149:                tp.setCaretPosition(0);
150:                optionsDialog.setSize(800, 600);
151:                optionsDialog.setLocationRelativeTo(this );
152:                optionsDialog.setVisible(true);
153:            }
154:
155:            /*test  public static void main(String[] aa)
156:             {
157:             JFrame f = new JFrame("Test");
158:             f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
159:             ProjectSettings props = new ProjectSettings();
160:             new SVNSettingsDialog(f, props);
161:             System.exit(0);
162:             }*/
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.