Source Code Cross Referenced for ModuleFrame.java in  » Content-Management-System » contelligent » de » finix » contelligent » client » modules » 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 » Content Management System » contelligent » de.finix.contelligent.client.modules 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001-2006 C:1 Financial Services GmbH
003:         *
004:         * This software is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License Version 2.1, as published by the Free Software Foundation.
007:         *
008:         * This software is distributed in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
011:         * Lesser General Public License for more details.
012:         *
013:         * You should have received a copy of the GNU Lesser General Public
014:         * License along with this library; if not, write to the Free Software
015:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
016:         */
017:
018:        package de.finix.contelligent.client.modules;
019:
020:        import java.awt.BorderLayout;
021:        import java.awt.event.ActionEvent;
022:        import java.awt.event.WindowAdapter;
023:        import java.awt.event.WindowEvent;
024:        import java.util.Iterator;
025:
026:        import javax.swing.Action;
027:        import javax.swing.JFrame;
028:        import javax.swing.JMenuBar;
029:        import javax.swing.JTabbedPane;
030:        import javax.swing.JToolBar;
031:
032:        import de.finix.contelligent.client.gui.ContelligentAction;
033:        import de.finix.contelligent.client.i18n.Resources;
034:        import de.finix.contelligent.client.modules.event.ModuleAdapter;
035:        import de.finix.contelligent.client.modules.event.ModuleEvent;
036:        import de.finix.contelligent.client.modules.event.ModuleListener;
037:        import de.finix.contelligent.client.util.ActionBundle;
038:        import de.finix.contelligent.client.util.MenuAndToolbarComposer;
039:        import de.finix.contelligent.client.util.MnemonicAbstractAction;
040:        import de.finix.contelligent.client.util.OptionalPopupMenu;
041:
042:        public class ModuleFrame extends JFrame {
043:
044:            private Module module;
045:
046:            private MenuAndToolbarComposer menuAndToolbarComposer;
047:
048:            public ModuleFrame(String title, Module module, boolean tabbed)
049:                    throws ModuleInitException {
050:                super (title);
051:
052:                this .module = module;
053:
054:                JToolBar toolBar = new JToolBar();
055:                toolBar.setOpaque(false);
056:                JMenuBar menuBar = new JMenuBar();
057:                menuBar.setOpaque(false);
058:                if (!module.isLightweightFrame()) {
059:                    setJMenuBar(menuBar);
060:                    getContentPane().add(toolBar, BorderLayout.NORTH);
061:                }
062:
063:                if (tabbed) {
064:                    JTabbedPane tabbedPane = new JTabbedPane();
065:                    tabbedPane.addTab(Resources.getLocalString("view"),
066:                            Resources.genericModule,
067:                            (java.awt.Component) module);
068:                    getContentPane().add(tabbedPane, BorderLayout.CENTER);
069:                } else {
070:                    getContentPane().add((java.awt.Component) module,
071:                            BorderLayout.CENTER);
072:                }
073:
074:                OptionalPopupMenu popupMenu = new OptionalPopupMenu();
075:                popupMenu.addActionGroupName(ContelligentAction.VIEW_ACTION);
076:                popupMenu.addActionBundleName(ActionBundle.TRANSACTION_ACTIONS);
077:
078:                menuAndToolbarComposer = new MenuAndToolbarComposer(menuBar,
079:                        toolBar, popupMenu);
080:                menuAndToolbarComposer.addOptionalPopupMenu(popupMenu);
081:                menuAndToolbarComposer.addTemporaryActionBundle(
082:                        ActionBundle.WINDOW_ACTIONS,
083:                        new Action[] { new CloseWindowAction() });
084:
085:                module.setMenuAndToolbarComposer(menuAndToolbarComposer);
086:                module.init();
087:
088:                menuAndToolbarComposer.addTemporaryActionBundle(
089:                        ActionBundle.MODULE_ACTIONS, module.getActions());
090:
091:                // fire module activated event
092:                for (Iterator i = module.getModuleListeners().iterator(); i
093:                        .hasNext();) {
094:                    ((ModuleListener) i.next())
095:                            .moduleActivated(new ModuleEvent(module));
096:                }
097:
098:                module.addModuleListener(new ModuleAdapter() {
099:                    public void moduleDestroyed(ModuleEvent event) {
100:                        // remove all action bundles from toolbar etc...
101:                        dispose();
102:                    }
103:                });
104:
105:                /* Add the window listener */
106:                addWindowListener(new WindowAdapter() {
107:                    public void windowClosing(WindowEvent evt) {
108:                        close();
109:                    }
110:                });
111:            }
112:
113:            public MenuAndToolbarComposer getMenuAndToolbarComposer() {
114:                return menuAndToolbarComposer;
115:            }
116:
117:            public class CloseWindowAction extends MnemonicAbstractAction
118:                    implements  ContelligentAction {
119:                public CloseWindowAction() {
120:                    super ("close_window_action", Resources.closeWindowIcon);
121:                    putValue(TYPE, PUSH_ACTION);
122:                    putValue(ACTION_TYPE, FILE_ACTION);
123:                    putValue(ACTION_GROUP, FILE_EXIT_GROUP);
124:                    putValue(ACTION_POS, FILE_EXIT_EXIT);
125:                    putValue(MENU_TARGET, MENU);
126:                    putValue(BUTTON_TARGET, NO_BUTTON);
127:                }
128:
129:                public void actionPerformed(ActionEvent e) {
130:                    close();
131:                }
132:            }
133:
134:            protected void close() {
135:                // fire module destroyed event
136:                for (Iterator i = module.getModuleListeners().iterator(); i
137:                        .hasNext();) {
138:                    ((ModuleListener) i.next())
139:                            .moduleDestroyed(new ModuleEvent(module));
140:                }
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.