Source Code Cross Referenced for AddressListDialog.java in  » Mail-Clients » columba-1.4 » org » columba » mail » gui » message » viewer » 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 » Mail Clients » columba 1.4 » org.columba.mail.gui.message.viewer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.columba.mail.gui.message.viewer;
002:
003:        import java.awt.BorderLayout;
004:        import java.awt.Dimension;
005:        import java.awt.Frame;
006:        import java.awt.HeadlessException;
007:        import java.awt.event.ActionEvent;
008:        import java.awt.event.ActionListener;
009:        import java.awt.event.KeyEvent;
010:
011:        import javax.swing.BorderFactory;
012:        import javax.swing.DefaultListSelectionModel;
013:        import javax.swing.JButton;
014:        import javax.swing.JComponent;
015:        import javax.swing.JDialog;
016:        import javax.swing.JLabel;
017:        import javax.swing.JPanel;
018:        import javax.swing.JScrollPane;
019:        import javax.swing.KeyStroke;
020:        import javax.swing.SwingConstants;
021:        import javax.swing.event.ListSelectionEvent;
022:        import javax.swing.event.ListSelectionListener;
023:
024:        import org.columba.core.gui.base.SingleSideEtchedBorder;
025:        import org.columba.core.gui.util.DialogHeaderPanel;
026:        import org.frapuccino.checkablelist.CheckableItemImpl;
027:        import org.frapuccino.checkablelist.CheckableItemListTableModel;
028:        import org.frapuccino.checkablelist.CheckableList;
029:
030:        import com.jgoodies.forms.builder.ButtonBarBuilder;
031:        import com.jgoodies.forms.builder.ButtonStackBuilder;
032:        import com.jgoodies.forms.layout.CellConstraints;
033:        import com.jgoodies.forms.layout.FormLayout;
034:
035:        public class AddressListDialog extends JDialog implements 
036:                ActionListener, ListSelectionListener {
037:
038:            private JButton addContactButton;
039:
040:            private JButton composeButton;
041:
042:            private JButton replyButton;
043:
044:            private JButton forwardButton;
045:
046:            private JButton closeButton;
047:
048:            private JButton helpButton;
049:
050:            private CheckableList list;
051:
052:            private int index;
053:
054:            private CheckableItemImpl selection;
055:
056:            public AddressListDialog(Frame owner) throws HeadlessException {
057:                super (owner, true);
058:
059:                setTitle("Address Manager");
060:
061:                initComponents();
062:
063:                layoutComponents();
064:
065:                getRootPane().registerKeyboardAction(this , "CLOSE",
066:                        KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
067:                        JComponent.WHEN_IN_FOCUSED_WINDOW);
068:                pack();
069:                setLocationRelativeTo(null);
070:                setVisible(true);
071:            }
072:
073:            private void layoutComponents() {
074:                setLayout(new BorderLayout());
075:
076:                add(new DialogHeaderPanel("Manage Address List",
077:                        "Select email addresses for mass actions"),
078:                        BorderLayout.NORTH);
079:
080:                getContentPane().add(createPanel(), BorderLayout.CENTER);
081:
082:                add(createBottomPanel(), BorderLayout.SOUTH);
083:
084:            }
085:
086:            private JPanel createEastPanel() {
087:                JPanel eastPanel = new JPanel();
088:                ButtonStackBuilder builder = new ButtonStackBuilder(eastPanel);
089:                builder.addGridded(addContactButton);
090:                builder.addUnrelatedGap();
091:                builder.addGridded(composeButton);
092:                builder.addRelatedGap();
093:                builder.addGridded(replyButton);
094:                builder.addRelatedGap();
095:                builder.addGridded(forwardButton);
096:                return eastPanel;
097:            }
098:
099:            private JPanel createPanel() {
100:                JPanel jpanel1 = new JPanel();
101:                FormLayout formlayout1 = new FormLayout(
102:                        "FILL:DEFAULT:GROW(1.0),3DLU,FILL:DEFAULT:NONE",
103:                        "CENTER:DEFAULT:NONE,1DLU,FILL:DEFAULT:GROW(1.0),3DLU,CENTER:DEFAULT:NONE");
104:                CellConstraints cc = new CellConstraints();
105:                jpanel1.setBorder(BorderFactory.createEmptyBorder(12, 12, 12,
106:                        12));
107:                jpanel1.setLayout(formlayout1);
108:
109:                JLabel jlabel1 = new JLabel();
110:                jlabel1.setText("Email Address:");
111:                jpanel1.add(jlabel1, cc.xy(1, 1));
112:
113:                JScrollPane scrollPane = new JScrollPane(list);
114:                scrollPane.setPreferredSize(new Dimension(250, 200));
115:                jpanel1.add(scrollPane, cc.xy(1, 3));
116:
117:                jpanel1.add(createEastPanel(), new CellConstraints(3, 3, 1, 1,
118:                        CellConstraints.DEFAULT, CellConstraints.TOP));
119:
120:                return jpanel1;
121:            }
122:
123:            private JPanel createBottomPanel() {
124:                JPanel bottomPanel = new JPanel(new BorderLayout());
125:                bottomPanel.setBorder(new SingleSideEtchedBorder(
126:                        SwingConstants.TOP));
127:
128:                JPanel buttonPanel = new JPanel();
129:                buttonPanel.setBorder(BorderFactory.createEmptyBorder(12, 12,
130:                        12, 12));
131:
132:                ButtonBarBuilder builder2 = new ButtonBarBuilder(buttonPanel);
133:                // builder.setDefaultButtonBarGapBorder();
134:                builder2.addGlue();
135:                builder2.addGriddedButtons(new JButton[] { closeButton,
136:                        helpButton });
137:
138:                bottomPanel.add(buttonPanel, BorderLayout.EAST);
139:
140:                return bottomPanel;
141:            }
142:
143:            private void initComponents() {
144:
145:                list = new CheckableList();
146:                list.getSelectionModel().addListSelectionListener(this );
147:
148:                addContactButton = new JButton("Add Contacts");
149:
150:                composeButton = new JButton("Compose");
151:
152:                replyButton = new JButton("Reply");
153:
154:                forwardButton = new JButton("Forward");
155:
156:                // TODO i18n "Close" button
157:                closeButton = new JButton("Close");
158:                closeButton.setDefaultCapable(true);
159:                closeButton.setMnemonic('C');
160:                closeButton.addActionListener(new ActionListener() {
161:                    public void actionPerformed(ActionEvent event) {
162:                        setVisible(false);
163:                    }
164:                });
165:
166:                // TODO i18n "Help" button
167:                helpButton = new JButton("Help");
168:                helpButton.setMnemonic('h');
169:            }
170:
171:            public void valueChanged(ListSelectionEvent e) {
172:                if (e.getValueIsAdjusting()) {
173:                    return;
174:                }
175:
176:                DefaultListSelectionModel theList = (DefaultListSelectionModel) e
177:                        .getSource();
178:                if (!theList.isSelectionEmpty()) {
179:                    index = theList.getAnchorSelectionIndex();
180:
181:                    selection = (CheckableItemImpl) ((CheckableItemListTableModel) list
182:                            .getModel()).getElement(index);
183:
184:                }
185:            }
186:
187:            public void actionPerformed(ActionEvent e) {
188:                String action = e.getActionCommand();
189:
190:                if (action.equals("OK")) {
191:                } else if (action.equals("CANCEL")) {
192:                    setVisible(false);
193:                }
194:            }
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.