Source Code Cross Referenced for CoreBridgeImpl.java in  » IDE-Netbeans » library » org » netbeans » core » 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 » IDE Netbeans » library » org.netbeans.core 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package org.netbeans.core;
042:
043:        import java.beans.PropertyEditorManager;
044:        import java.io.File;
045:        import java.io.InputStream;
046:        import java.io.OutputStream;
047:        import java.io.PrintWriter;
048:        import org.netbeans.core.startup.Main;
049:        import org.netbeans.core.startup.ManifestSection;
050:        import org.netbeans.core.startup.StartLog;
051:        import org.openide.filesystems.FileObject;
052:        import org.openide.filesystems.Repository;
053:        import org.openide.loaders.DataFolder;
054:        import org.openide.util.Exceptions;
055:        import org.openide.util.Lookup;
056:
057:        /** Implements necessary callbacks from module system.
058:         *
059:         * @author Jaroslav Tulach
060:         */
061:        public final class CoreBridgeImpl extends
062:                org.netbeans.core.startup.CoreBridge implements  Runnable {
063:            /** counts the number of CLI invocations */
064:            private int numberOfCLIInvocations;
065:
066:            protected void attachToCategory(Object category) {
067:                ModuleActions.attachTo(category);
068:            }
069:
070:            protected void loadDefaultSection(
071:                    org.netbeans.core.startup.ManifestSection s,
072:                    org.openide.util.lookup.InstanceContent.Convertor<ManifestSection, Object> convertor,
073:                    boolean load) {
074:                if (load) {
075:                    if (convertor != null) {
076:                        NbTopManager.get().register(s, convertor);
077:                    } else {
078:                        NbTopManager.get().register(s);
079:                    }
080:                } else {
081:                    if (convertor != null) {
082:                        NbTopManager.get().unregister(s, convertor);
083:                    } else {
084:                        NbTopManager.get().unregister(s);
085:                    }
086:                }
087:            }
088:
089:            protected void loadActionSection(ManifestSection.ActionSection s,
090:                    boolean load) throws Exception {
091:                if (load) {
092:                    ModuleActions.add(s);
093:                } else {
094:                    ModuleActions.remove(s);
095:                }
096:            }
097:
098:            protected void loadLoaderSection(ManifestSection.LoaderSection s,
099:                    boolean load) throws Exception {
100:                if (load) {
101:                    LoaderPoolNode.add(s);
102:                } else {
103:                    LoaderPoolNode.remove((org.openide.loaders.DataLoader) s
104:                            .getInstance());
105:                }
106:            }
107:
108:            protected void loaderPoolTransaction(boolean begin) {
109:                if (begin) {
110:                    LoaderPoolNode.beginUpdates();
111:                } else {
112:                    LoaderPoolNode.endUpdates();
113:                }
114:            }
115:
116:            public void setStatusText(String status) {
117:                org.openide.awt.StatusDisplayer.getDefault().setStatusText(
118:                        status);
119:            }
120:
121:            public void initializePlaf(Class uiClass, int uiFontSize,
122:                    java.net.URL themeURL) {
123:                org.netbeans.swing.plaf.Startup.run(uiClass, uiFontSize,
124:                        themeURL);
125:            }
126:
127:            public org.openide.util.Lookup lookupCacheLoad() {
128:                FileObject services = Repository.getDefault()
129:                        .getDefaultFileSystem().findResource("Services"); // NOI18N
130:                if (services != null) {
131:                    StartLog.logProgress("Got Services folder"); // NOI18N
132:                    DataFolder servicesF;
133:                    try {
134:                        servicesF = DataFolder.findFolder(services);
135:                    } catch (RuntimeException e) {
136:                        Exceptions.printStackTrace(e);
137:                        return Lookup.EMPTY;
138:                    }
139:                    org.openide.loaders.FolderLookup f = new org.openide.loaders.FolderLookup(
140:                            servicesF, "SL["); // NOI18N
141:                    StartLog.logProgress("created FolderLookup"); // NOI18N
142:                    return f.getLookup();
143:                } else {
144:                    return Lookup.EMPTY;
145:                }
146:            }
147:
148:            public void cliUsage(PrintWriter printWriter) {
149:                // nothing for now
150:            }
151:
152:            public int cli(String[] string, InputStream inputStream,
153:                    OutputStream outputStream, OutputStream errorStream,
154:                    File file) {
155:                /*
156:                try {
157:                    org.netbeans.api.sendopts.CommandLine.getDefault().parse(
158:                        string, inputStream, outputStream, file
159:                    );
160:                    for (int i = 0; i < string.length; i++) {
161:                        string[i] = null;
162:                    }
163:                } catch (CommandException ex) {
164:                    ex.printStackTrace();
165:                    return ex.getExitCode();
166:                }
167:                 */
168:
169:                if (numberOfCLIInvocations++ == 0)
170:                    return 0;
171:
172:                /*
173:                for (int i = 0; i < args.length; i++) {
174:                    if ("--nofront".equals (args[i])) {
175:                        return 0;
176:                    }
177:                }
178:                 */
179:                javax.swing.SwingUtilities.invokeLater(this );
180:
181:                return 0;
182:            }
183:
184:            public void run() {
185:                java.awt.Frame f = org.openide.windows.WindowManager
186:                        .getDefault().getMainWindow();
187:
188:                // makes sure the frame is visible
189:                f.setVisible(true);
190:                // uniconifies the frame if it is inconified
191:                if ((f.getExtendedState() & java.awt.Frame.ICONIFIED) != 0) {
192:                    f.setExtendedState(~java.awt.Frame.ICONIFIED
193:                            & f.getExtendedState());
194:                }
195:                // moves it to front and requests focus
196:                f.toFront();
197:
198:            }
199:
200:            public void registerPropertyEditors() {
201:                doRegisterPropertyEditors();
202:            }
203:
204:            /**Flag to avoid multiple adds of the same path to the
205:             * of PropertyEditorManager if multiple tests call 
206:             * registerPropertyEditors() */
207:            private static boolean editorsRegistered = false;
208:
209:            /** Register NB specific property editors.
210:             *  Allows property editor unit tests to work correctly without 
211:             *  initializing full NetBeans environment.
212:             *  @since 1.98 */
213:            private static final void doRegisterPropertyEditors() {
214:                //issue 31879
215:                if (editorsRegistered)
216:                    return;
217:                String[] syspesp = PropertyEditorManager.getEditorSearchPath();
218:                String[] nbpesp = new String[] {
219:                        "org.netbeans.beaninfo.editors", // NOI18N
220:                        "org.openide.explorer.propertysheet.editors", // NOI18N
221:                };
222:                String[] allpesp = new String[syspesp.length + nbpesp.length];
223:                System.arraycopy(nbpesp, 0, allpesp, 0, nbpesp.length);
224:                System.arraycopy(syspesp, 0, allpesp, nbpesp.length,
225:                        syspesp.length);
226:                PropertyEditorManager.setEditorSearchPath(allpesp);
227:                PropertyEditorManager.registerEditor(java.lang.Character.TYPE,
228:                        org.netbeans.beaninfo.editors.CharEditor.class);
229:                PropertyEditorManager.registerEditor(String[].class,
230:                        org.netbeans.beaninfo.editors.StringArrayEditor.class);
231:                // bugfix #28676, register editor for a property which type is array of data objects
232:                PropertyEditorManager
233:                        .registerEditor(
234:                                org.openide.loaders.DataObject[].class,
235:                                org.netbeans.beaninfo.editors.DataObjectArrayEditor.class);
236:                // use replacement hintable/internationalizable primitive editors - issues 20376, 5278
237:                PropertyEditorManager.registerEditor(Integer.TYPE,
238:                        org.netbeans.beaninfo.editors.IntEditor.class);
239:                PropertyEditorManager.registerEditor(Boolean.TYPE,
240:                        org.netbeans.beaninfo.editors.BoolEditor.class);
241:                editorsRegistered = true;
242:            }
243:
244:            protected void loadSettings() {
245:            }
246:
247:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.