Source Code Cross Referenced for PasteScriptPanel.java in  » Database-Client » PKLite-SQL-Client » com » pk » script » ui » 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 » Database Client » PKLite SQL Client » com.pk.script.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Oct 3, 2004
003:         *
004:         * @author ctaylor
005:         * 
006:         */
007:        package com.pk.script.ui;
008:
009:        import java.awt.Color;
010:        import java.awt.Component;
011:
012:        import java.awt.GridBagConstraints;
013:        import java.awt.GridBagLayout;
014:        import java.awt.Insets;
015:        import java.awt.event.ActionListener;
016:
017:        import javax.swing.BorderFactory;
018:        import javax.swing.BoxLayout;
019:        import javax.swing.ButtonGroup;
020:        import javax.swing.JButton;
021:        import javax.swing.JPanel;
022:        import javax.swing.JRadioButton;
023:        import javax.swing.JScrollPane;
024:        import javax.swing.JTextArea;
025:        import javax.swing.JTextField;
026:
027:        import com.pk.script.Script;
028:
029:        /**
030:         * @author ctaylor
031:         *
032:         */
033:        public class PasteScriptPanel extends JPanel {
034:            /**
035:             * 
036:             */
037:            private static final long serialVersionUID = -3708779830891735747L;
038:            private JTextArea scriptTextArea;
039:            private JButton okButton;
040:            private JButton cancelButton;
041:            private JTextField delimiterTextField;
042:            private JRadioButton insertEndRadioButton;
043:            private JRadioButton insertBeginningRadioButton;
044:            private JRadioButton insertAtCurserRadioButton;
045:            private JRadioButton replaceCurrentScriptRadioButton;
046:            private ActionListener actionListener;
047:
048:            public PasteScriptPanel(ActionListener argActionListener) {
049:                actionListener = argActionListener;
050:                JPanel radioButtonPanel = new JPanel();
051:                insertEndRadioButton = new JRadioButton("Insert at End");
052:                insertEndRadioButton.setSelected(true);
053:                radioButtonPanel.add(insertEndRadioButton);
054:                insertBeginningRadioButton = new JRadioButton(
055:                        "Insert at Beginning");
056:                radioButtonPanel.add(insertBeginningRadioButton);
057:                insertAtCurserRadioButton = new JRadioButton("Insert at Curser");
058:                radioButtonPanel.add(insertAtCurserRadioButton);
059:                replaceCurrentScriptRadioButton = new JRadioButton(
060:                        "Replace Current Script");
061:                radioButtonPanel.add(replaceCurrentScriptRadioButton);
062:                radioButtonPanel.setBorder(BorderFactory
063:                        .createLineBorder(Color.BLACK));
064:                ButtonGroup radioGroup = new ButtonGroup();
065:                radioGroup.add(insertEndRadioButton);
066:                radioGroup.add(insertBeginningRadioButton);
067:                radioGroup.add(insertAtCurserRadioButton);
068:                radioGroup.add(replaceCurrentScriptRadioButton);
069:
070:                this .add(radioButtonPanel);
071:
072:                scriptTextArea = new JTextArea(20, 40);
073:                JScrollPane sqlScrollPane = new JScrollPane(scriptTextArea);
074:
075:                okButton = new JButton("Ok");
076:                okButton.addActionListener(actionListener);
077:
078:                okButton.setAlignmentX(Component.CENTER_ALIGNMENT);
079:
080:                cancelButton = new JButton("Cancel");
081:                cancelButton.addActionListener(actionListener);
082:                cancelButton.setAlignmentX(Component.CENTER_ALIGNMENT);
083:
084:                JPanel buttonPanel = new JPanel();
085:                buttonPanel.setLayout(new BoxLayout(buttonPanel,
086:                        BoxLayout.Y_AXIS));
087:                okButton.setSize(cancelButton.getSize());
088:                buttonPanel.add(okButton);
089:                buttonPanel.add(cancelButton);
090:
091:                JPanel centerPanel = new JPanel();
092:                centerPanel.setLayout(new GridBagLayout());
093:                GridBagConstraints gbc = new GridBagConstraints();
094:                gbc.anchor = GridBagConstraints.NORTH;
095:                gbc.insets = new Insets(6, 15, 6, 15);
096:                gbc.gridx = 0;
097:                gbc.gridy = 0;
098:                centerPanel.add(sqlScrollPane, gbc);
099:                gbc.gridx = 1;
100:                centerPanel.add(buttonPanel, gbc);
101:                this .add(centerPanel);
102:            }
103:
104:            /**
105:             * @return Returns the cancelButton.
106:             */
107:            public JButton getCancelButton() {
108:                return cancelButton;
109:            }
110:
111:            /**
112:             * @return Returns the delimiterTextField.
113:             */
114:            public JTextField getDelimiterTextField() {
115:                return delimiterTextField;
116:            }
117:
118:            /**
119:             * @return Returns the insertAtCurserRadioButton.
120:             */
121:            public JRadioButton getInsertAtCurserRadioButton() {
122:                return insertAtCurserRadioButton;
123:            }
124:
125:            /**
126:             * @return Returns the insertBeginningRadioButton.
127:             */
128:            public JRadioButton getInsertBeginningRadioButton() {
129:                return insertBeginningRadioButton;
130:            }
131:
132:            /**
133:             * @return Returns the insertEndRadioButton.
134:             */
135:            public JRadioButton getInsertEndRadioButton() {
136:                return insertEndRadioButton;
137:            }
138:
139:            /**
140:             * @return Returns the okButton.
141:             */
142:            public JButton getOkButton() {
143:                return okButton;
144:            }
145:
146:            /**
147:             * @return Returns the replaceCurrentScriptRadioButton.
148:             */
149:            public JRadioButton getReplaceCurrentScriptRadioButton() {
150:                return replaceCurrentScriptRadioButton;
151:            }
152:
153:            /**
154:             * @return Returns the scriptTextArea.
155:             */
156:            public JTextArea getScriptTextArea() {
157:                return scriptTextArea;
158:            }
159:
160:            /**
161:             * @return
162:             */
163:            public int getInsertMode() {
164:                if (insertEndRadioButton.isSelected()) {
165:                    return Script.NEW_COMMAND_INSERT_END_MODE;
166:                } else if (insertBeginningRadioButton.isSelected()) {
167:                    return Script.NEW_COMMAND_INSERT_BEGINNING_MODE;
168:                } else if (insertAtCurserRadioButton.isSelected()) {
169:                    return Script.NEW_COMMAND_INSERT_AT_CURSER_MODE;
170:                } else {
171:                    return Script.NEW_COMMAND_REPLACE_CURRENT_SCRIPT_MODE;
172:                }
173:            }
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.