Source Code Cross Referenced for AttachmentGridNonSelectableDialog.java in  » Project-Management » airTODO » org » airtodo » gui » dialog_table » 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 » Project Management » airTODO » org.airtodo.gui.dialog_table 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.airtodo.gui.dialog_table;
002:
003:        import static org.air.framework.gui.box.Gap.large;
004:
005:        import java.awt.Dialog;
006:        import java.awt.Window;
007:        import java.awt.event.ActionEvent;
008:        import java.sql.SQLException;
009:        import java.util.Map;
010:        import java.util.Set;
011:        import java.util.Vector;
012:
013:        import javax.swing.Action;
014:        import javax.swing.JMenuItem;
015:        import javax.swing.JSeparator;
016:        import javax.swing.event.ListSelectionEvent;
017:        import javax.swing.event.ListSelectionListener;
018:
019:        import org.air.framework.core.Utils;
020:        import org.air.framework.db.DbUtilsCommon;
021:        import org.air.framework.gui.actions.basic.BasicAbstractAction;
022:        import org.air.framework.gui.actions.other.ActionLaunch;
023:        import org.air.framework.gui.dialogs.grid.AbstractGridDialog;
024:        import org.air.framework.gui.dialogs.grid.IAddDeleteGridDialog;
025:        import org.air.framework.gui.dialogs.grid.IOpenGridDialog;
026:        import org.air.framework.gui.dialogs.input.AbstractDeleteDialog;
027:        import org.air.framework.gui.widgets.Button;
028:        import org.air.framework.i18n.NlsRecords;
029:        import org.air.framework.records.Attachments;
030:        import org.airtodo.LinkUtils;
031:        import org.airtodo.db.DbUtils;
032:        import org.airtodo.db.types.AttachmentType;
033:        import org.airtodo.gui.dialog_delete.AttachmentDeleteDialog;
034:        import org.airtodo.gui.dialog_open.AttachmentOpenDialog;
035:        import org.airtodo.headers.Attachment;
036:
037:        public class AttachmentGridNonSelectableDialog extends
038:                AbstractGridDialog implements  IAddDeleteGridDialog,
039:                IOpenGridDialog {
040:            private long masterId;
041:
042:            //
043:            //	C O N S T R U C T O R
044:            //
045:            public AttachmentGridNonSelectableDialog() {
046:                super ();
047:            }
048:
049:            //
050:            //	C O N S T R U C T O R
051:            //
052:            public AttachmentGridNonSelectableDialog(Dialog owner, String title) {
053:                super (owner, new Attachment());
054:                setTitle(title
055:                        + " - "
056:                        + NlsRecords
057:                                .getTextPluralImenitelniy(Attachments.class));
058:                getButtonPanelTop().add(large(), 5);
059:                getButtonPanelTop().add(new Button(getActionLaunch()), 6);
060:                getPopupMenu().add(new JMenuItem(getActionLaunch()), 4);
061:                getPopupMenu().add(new JSeparator(), 5);
062:                attachKeyboardActions(getActionLaunch());
063:                getTable().getSelectionModel().addListSelectionListener(
064:                        new ListSelectionListener() {
065:                            public void valueChanged(ListSelectionEvent e) {
066:                                getActionLaunch().setEnabled(
067:                                        getTable().getSelectedRowCount() != 0);
068:                            }
069:                        });
070:            }
071:
072:            //
073:            //	C O N S T R U C T O R
074:            //
075:            public AttachmentGridNonSelectableDialog(Dialog owner, Long id) {
076:                super (owner, new Attachment(), id);
077:            }
078:
079:            private BasicAbstractAction actionLaunch;
080:
081:            private Action getActionLaunch() {
082:                if (actionLaunch == null)
083:                    actionLaunch = new ActionLaunch() {
084:                        public void actionPerformed(ActionEvent e) {
085:                            final AbstractGridDialog owner = AttachmentGridNonSelectableDialog.this ;
086:                            Set set = owner.getTable().getSelectedRecords();
087:                            for (Object object : set) {
088:                                Map map = (Map) object;
089:                                String text = (String) map.get(Utils
090:                                        .getColumnIdentifier(Attachments.NAME));
091:                                AttachmentType type = (AttachmentType) map
092:                                        .get(Utils
093:                                                .getColumnIdentifier(Attachments.TYPE));
094:                                LinkUtils.launch(owner, type, text);
095:                            }
096:                        }
097:                    };
098:                return actionLaunch;
099:            }
100:
101:            @Override
102:            public Vector<Map> getDataVector() throws SQLException {
103:                return DbUtils.selectAttachmentsByMasterId(masterId);
104:            }
105:
106:            public AbstractDeleteDialog getDeleteDialog(AbstractGridDialog owner) {
107:                return new AttachmentDeleteDialog(owner);
108:            }
109:
110:            public Window getOpenDialog(
111:                    AbstractGridDialog abstractAddDeleteOpenDialog) {
112:                return new AttachmentOpenDialog(abstractAddDeleteOpenDialog);
113:            }
114:
115:            @Override
116:            public String getDialogTitle() {
117:                return NlsRecords.getTextPluralImenitelniy(Attachments.class);
118:            }
119:
120:            public int insert(Map map) throws SQLException {
121:                map.put(Utils.getColumnIdentifier(Attachments.MASTER_ID),
122:                        masterId);
123:                return DbUtilsCommon.insert(map, Attachments.class);
124:            }
125:
126:            public void setMasterId(long masterId) {
127:                this.masterId = masterId;
128:            }
129:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.