Source Code Cross Referenced for OkCancelButtonPanel.java in  » GIS » openjump » de » fho » jump » pirol » ui » panels » 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 » GIS » openjump » de.fho.jump.pirol.ui.panels 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 11.04.2005 for PIROL
003:         * 
004:         * SVN header information:
005:         * $Author: javamap $
006:         * $Rev: 856 $
007:         * $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
008:         * $Id: OkCancelButtonPanel.java 856 2007-06-19 04:15:27Z javamap $
009:         */
010:        package de.fho.jump.pirol.ui.panels;
011:
012:        import java.awt.Dimension;
013:        import java.awt.event.ActionListener;
014:
015:        import javax.swing.Box;
016:        import javax.swing.BoxLayout;
017:        import javax.swing.JButton;
018:        import javax.swing.JPanel;
019:
020:        import com.vividsolutions.jump.I18N;
021:
022:        //import de.fho.jump.pirol.utilities.i18n.PirolPlugInMessages;
023:
024:        /**
025:         * This class is a JPanel with a "Cancel" and a "OK" button.
026:         * @author Carsten Schulze
027:         * @author FH Osnabrück - University of Applied Sciences Osnabrück,
028:         * Project: PIROL (2005),
029:         * Subproject: Daten- und Wissensmanagement
030:         */
031:        public class OkCancelButtonPanel extends JPanel {
032:
033:            private static final long serialVersionUID = -4703181650847522122L;
034:
035:            /**The constant ActionCommand String for the ok-button*/
036:            public static final String OK_BUTTON_ACTION_COMMAND = new String(
037:                    "OK_BUTTON_ACTION_COMMAND");
038:            /**The constant ActionCommand String for the cancel-button*/
039:            public static final String CANCEL_BUTTON_ACTION_COMMAND = new String(
040:                    "CANCEL_BUTTON_ACTION_COMMAND");
041:            private JButton cancelButton;
042:            private JButton okButton;
043:
044:            /**
045:             * This is the default constructor
046:             */
047:            public OkCancelButtonPanel() {
048:                super ();
049:                initialize();
050:            }
051:
052:            /**
053:             * Adds the given ActionListener to both buttons.
054:             * @param listener the listener
055:             */
056:            public void addActionListener(ActionListener listener) {
057:                getOkButton().addActionListener(listener);
058:                getCancelButton().addActionListener(listener);
059:            }
060:
061:            /**
062:             * This method initializes cancelButton	
063:             * 	
064:             * @return javax.swing.JButton	
065:             */
066:            public JButton getCancelButton() {
067:                if (cancelButton == null) {
068:                    cancelButton = new JButton();
069:                    cancelButton.setText(I18N.get("ui.OKCancelPanel.cancel"));
070:                    cancelButton.setActionCommand(CANCEL_BUTTON_ACTION_COMMAND);
071:                    cancelButton.setFocusPainted(false);
072:                }
073:                return cancelButton;
074:            }
075:
076:            /**
077:             * This method initializes okButton	
078:             * 	
079:             * @return javax.swing.JButton	
080:             */
081:            public JButton getOkButton() {
082:                if (okButton == null) {
083:                    okButton = new JButton();
084:                    okButton.setText(I18N.get("ui.OKCancelPanel.ok"));
085:                    okButton.setActionCommand(OK_BUTTON_ACTION_COMMAND);
086:                    okButton.setFocusPainted(false);
087:                }
088:                return okButton;
089:            }
090:
091:            /**
092:             * Enables/Disables the ok button. May be useful, if the user had to put in values
093:             * that may not be correct. You can disable the ok button in this case.
094:             * @param enable enables the ok button if true, else disables it
095:             */
096:            public void setOkButtonEnabled(boolean enable) {
097:                this .getOkButton().setEnabled(enable);
098:            }
099:
100:            /**
101:             * This method initializes this
102:             */
103:            private void initialize() {
104:                this .setSize(300, 40);
105:                this .setLayout(new BoxLayout(this , BoxLayout.LINE_AXIS));
106:                this .add(Box.createHorizontalGlue(), null);
107:                this .add(getCancelButton(), null);
108:                this .add(Box.createRigidArea(new Dimension(10, 0)));
109:                this .add(getOkButton(), null);
110:
111:                this .requestFocus();
112:            }
113:
114:            public void requestFocus() {
115:                okButton.setFocusable(true);
116:                okButton.requestFocus();
117:            }
118:
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.