Source Code Cross Referenced for FileOverwriteDialog.java in  » Portal » Open-Portal » com » sun » portal » ffj » util » 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 » Portal » Open Portal » com.sun.portal.ffj.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
004:         */
005:
006:        package com.sun.portal.ffj.util;
007:
008:        import org.openide.util.NbBundle;
009:
010:        public class FileOverwriteDialog extends javax.swing.JDialog {
011:
012:            public static final int OVERWRITE = 1;
013:            public static final int SKIP = 2;
014:            public static final int OVERWRITE_ALL = 3;
015:            public static final int SKIP_ALL = 4;
016:
017:            /** Creates new form FileOverwriteDialog */
018:            public FileOverwriteDialog(java.awt.Frame parent, boolean modal,
019:                    String dir, String file, int defchoice) {
020:                super (parent, modal);
021:                initComponents();
022:                m_OWChoice = defchoice;
023:
024:                setTitle(NbBundle.getMessage(FileOverwriteDialog.class,
025:                        "FOWDialog.title"));
026:                m_PopText.setText(NbBundle.getMessage(
027:                        FileOverwriteDialog.class, "FOWDialog.pop", dir));
028:                m_FileText.setText(NbBundle.getMessage(
029:                        FileOverwriteDialog.class, "FOWDialog.file", file));
030:
031:                getAccessibleContext().setAccessibleDescription(
032:                        m_FileText.getText());
033:                m_OverwriteButton.getAccessibleContext()
034:                        .setAccessibleDescription(
035:                                NbBundle.getMessage(FileOverwriteDialog.class,
036:                                        "ACSD_CTL_FOWDialog.Overwrite")); // NOI18N
037:                m_OWAllButton.getAccessibleContext().setAccessibleDescription(
038:                        NbBundle.getMessage(FileOverwriteDialog.class,
039:                                "ACSD_CTL_FOWDialog.OverwriteAll")); // NOI18N
040:                m_SkipButton.getAccessibleContext().setAccessibleDescription(
041:                        NbBundle.getMessage(FileOverwriteDialog.class,
042:                                "ACSD_CTL_FOWDialog.Skip")); // NOI18N
043:                m_SkipAllButton.getAccessibleContext()
044:                        .setAccessibleDescription(
045:                                NbBundle.getMessage(FileOverwriteDialog.class,
046:                                        "ACSD_CTL_FOWDialog.SkipAll")); // NOI18N
047:
048:                pack();
049:                java.awt.Dimension screenSize = java.awt.Toolkit
050:                        .getDefaultToolkit().getScreenSize();
051:                java.awt.Dimension dialogSize = getSize();
052:                setLocation((screenSize.width - dialogSize.width) / 2,
053:                        (screenSize.height - dialogSize.height) / 2);
054:            }
055:
056:            public int getOverwriteChoice() {
057:                return m_OWChoice;
058:            }
059:
060:            public void show() {
061:                if (m_OWChoice == OVERWRITE) {
062:                    m_OverwriteButton.requestFocus();
063:                } else {
064:                    m_SkipButton.requestFocus();
065:                }
066:                super .show();
067:            }
068:
069:            /** This method is called from within the constructor to
070:             * initialize the form.
071:             * WARNING: Do NOT modify this code. The content of this method is
072:             * always regenerated by the Form Editor.
073:             */
074:            private void initComponents() {//GEN-BEGIN:initComponents
075:                m_BottomPane = new javax.swing.JPanel();
076:                m_ButtonPane = new javax.swing.JPanel();
077:                m_OverwriteButton = new javax.swing.JButton();
078:                m_SkipButton = new javax.swing.JButton();
079:                m_OWAllButton = new javax.swing.JButton();
080:                m_SkipAllButton = new javax.swing.JButton();
081:                m_ContentPane = new javax.swing.JPanel();
082:                m_PopText = new javax.swing.JLabel();
083:                m_FileText = new javax.swing.JLabel();
084:
085:                setTitle("File Exists");
086:                setResizable(false);
087:                addWindowListener(new java.awt.event.WindowAdapter() {
088:                    public void windowClosing(java.awt.event.WindowEvent evt) {
089:                        closeDialog(evt);
090:                    }
091:                });
092:
093:                m_BottomPane.setLayout(new java.awt.FlowLayout(
094:                        java.awt.FlowLayout.LEFT, 10, 5));
095:
096:                m_ButtonPane.setLayout(new java.awt.GridLayout(0, 2, 10, 10));
097:
098:                m_OverwriteButton.setText("Overwrite");
099:                m_OverwriteButton
100:                        .addActionListener(new java.awt.event.ActionListener() {
101:                            public void actionPerformed(
102:                                    java.awt.event.ActionEvent evt) {
103:                                m_OverwriteButtonActionPerformed(evt);
104:                            }
105:                        });
106:
107:                m_ButtonPane.add(m_OverwriteButton);
108:
109:                m_SkipButton.setText("Skip");
110:                m_SkipButton
111:                        .addActionListener(new java.awt.event.ActionListener() {
112:                            public void actionPerformed(
113:                                    java.awt.event.ActionEvent evt) {
114:                                m_SkipButtonActionPerformed(evt);
115:                            }
116:                        });
117:
118:                m_ButtonPane.add(m_SkipButton);
119:
120:                m_OWAllButton.setText("Overwrite All");
121:                m_OWAllButton
122:                        .addActionListener(new java.awt.event.ActionListener() {
123:                            public void actionPerformed(
124:                                    java.awt.event.ActionEvent evt) {
125:                                m_OWAllButtonActionPerformed(evt);
126:                            }
127:                        });
128:
129:                m_ButtonPane.add(m_OWAllButton);
130:
131:                m_SkipAllButton.setText("Skip All");
132:                m_SkipAllButton
133:                        .addActionListener(new java.awt.event.ActionListener() {
134:                            public void actionPerformed(
135:                                    java.awt.event.ActionEvent evt) {
136:                                m_SkipAllButtonActionPerformed(evt);
137:                            }
138:                        });
139:
140:                m_ButtonPane.add(m_SkipAllButton);
141:
142:                m_BottomPane.add(m_ButtonPane);
143:
144:                getContentPane().add(m_BottomPane, java.awt.BorderLayout.SOUTH);
145:
146:                m_ContentPane.setLayout(new java.awt.GridLayout(0, 1, 0, 10));
147:
148:                m_ContentPane.setBorder(new javax.swing.border.EmptyBorder(
149:                        new java.awt.Insets(10, 10, 10, 5)));
150:                m_PopText.setText("Populating directory");
151:                m_ContentPane.add(m_PopText);
152:
153:                m_FileText.setText("File already exists");
154:                m_ContentPane.add(m_FileText);
155:
156:                getContentPane().add(m_ContentPane,
157:                        java.awt.BorderLayout.CENTER);
158:
159:            }//GEN-END:initComponents
160:
161:            private void m_SkipAllButtonActionPerformed(
162:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_SkipAllButtonActionPerformed
163:                m_OWChoice = SKIP_ALL;
164:                closeDialog(null);
165:            }//GEN-LAST:event_m_SkipAllButtonActionPerformed
166:
167:            private void m_OWAllButtonActionPerformed(
168:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_OWAllButtonActionPerformed
169:                m_OWChoice = OVERWRITE_ALL;
170:                closeDialog(null);
171:            }//GEN-LAST:event_m_OWAllButtonActionPerformed
172:
173:            private void m_OverwriteButtonActionPerformed(
174:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_OverwriteButtonActionPerformed
175:                m_OWChoice = OVERWRITE;
176:                closeDialog(null);
177:            }//GEN-LAST:event_m_OverwriteButtonActionPerformed
178:
179:            private void m_SkipButtonActionPerformed(
180:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_m_SkipButtonActionPerformed
181:                m_OWChoice = SKIP;
182:                closeDialog(null);
183:            }//GEN-LAST:event_m_SkipButtonActionPerformed
184:
185:            /** Closes the dialog */
186:            private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
187:                setVisible(false);
188:                dispose();
189:            }//GEN-LAST:event_closeDialog
190:
191:            // Variables declaration - do not modify//GEN-BEGIN:variables
192:            private javax.swing.JLabel m_FileText;
193:            private javax.swing.JLabel m_PopText;
194:            private javax.swing.JPanel m_ButtonPane;
195:            private javax.swing.JButton m_OverwriteButton;
196:            private javax.swing.JPanel m_BottomPane;
197:            private javax.swing.JButton m_OWAllButton;
198:            private javax.swing.JPanel m_ContentPane;
199:            private javax.swing.JButton m_SkipButton;
200:            private javax.swing.JButton m_SkipAllButton;
201:            // End of variables declaration//GEN-END:variables
202:
203:            private int m_OWChoice;
204:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.