Source Code Cross Referenced for View.java in  » IDE-Netbeans » spi » org » netbeans » modules » debugger » ui » views » 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 » spi » org.netbeans.modules.debugger.ui.views 
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:
042:        package org.netbeans.modules.debugger.ui.views;
043:
044:        import java.awt.BorderLayout;
045:        import java.io.Externalizable;
046:        import java.io.IOException;
047:        import java.io.ObjectInput;
048:        import java.io.ObjectOutput;
049:        import javax.swing.JComponent;
050:        import org.netbeans.spi.viewmodel.Models;
051:
052:        import org.netbeans.modules.debugger.ui.Utils;
053:
054:        import org.openide.util.NbBundle;
055:        import org.openide.util.Utilities;
056:        import org.openide.windows.TopComponent;
057:
058:        // <RAVE>
059:        // Implement HelpCtx.Provider interface to provide help ids for help system
060:        // public class CallStackView extends TopComponent {
061:        // ====
062:        public class View extends TopComponent implements 
063:                org.openide.util.HelpCtx.Provider {
064:            // </RAVE>
065:
066:            public static final String BREAKPOINTS_VIEW_NAME = "BreakpointsView";
067:            public static final String CALLSTACK_VIEW_NAME = "CallStackView";
068:            public static final String LOCALS_VIEW_NAME = "LocalsView";
069:            public static final String SESSIONS_VIEW_NAME = "SessionsView";
070:            public static final String THREADS_VIEW_NAME = "ThreadsView";
071:            public static final String WATCHES_VIEW_NAME = "WatchesView";
072:
073:            private transient JComponent tree;
074:            private transient ViewModelListener viewModelListener;
075:            private String name; // Store just the name persistently, we'll create the component from that
076:            private transient String helpID;
077:            private transient String propertiesHelpID;
078:            private transient String displayNameResource;
079:            private transient String toolTipResource;
080:
081:            private View(String icon, String name, String helpID,
082:                    String propertiesHelpID, String displayNameResource,
083:                    String toolTipResource) {
084:                setIcon(Utilities.loadImage(icon));
085:                this .name = name;
086:                this .helpID = helpID;
087:                this .propertiesHelpID = propertiesHelpID;
088:                this .displayNameResource = displayNameResource;
089:                this .toolTipResource = toolTipResource;
090:            }
091:
092:            protected String preferredID() {
093:                return this .getClass().getPackage().getName() + "." + name;
094:            }
095:
096:            protected void componentShowing() {
097:                super .componentShowing();
098:                if (viewModelListener != null) {
099:                    viewModelListener.setUp();
100:                    return;
101:                }
102:                if (tree == null) {
103:                    setLayout(new BorderLayout());
104:                    tree = Models.createView(Models.EMPTY_MODEL);
105:                    tree.setName(NbBundle.getMessage(View.class,
106:                            toolTipResource));
107:                    add(tree, "Center"); //NOI18N
108:                }
109:                // <RAVE> CR 6207738 - fix debugger help IDs
110:                // Use the modified constructor that stores the propertiesHelpID
111:                // for nodes in this view
112:                // viewModelListener = new ViewModelListener (
113:                //     "ThreadsView",
114:                //     tree
115:                // );
116:                // ====
117:                viewModelListener = new ViewModelListener(name, tree,
118:                        propertiesHelpID);
119:                // </RAVE>
120:            }
121:
122:            protected void componentHidden() {
123:                super .componentHidden();
124:                if (viewModelListener != null) {
125:                    viewModelListener.destroy();
126:                }
127:            }
128:
129:            // <RAVE>
130:            // Implement getHelpCtx() with the correct help ID
131:            public org.openide.util.HelpCtx getHelpCtx() {
132:                return new org.openide.util.HelpCtx(helpID);
133:            }
134:
135:            // </RAVE>
136:
137:            public int getPersistenceType() {
138:                return PERSISTENCE_ALWAYS;
139:            }
140:
141:            public boolean requestFocusInWindow() {
142:                super .requestFocusInWindow();
143:                if (tree == null)
144:                    return false;
145:                return tree.requestFocusInWindow();
146:            }
147:
148:            public void requestActive() {
149:                super .requestActive();
150:                if (tree != null) {
151:                    tree.requestFocusInWindow();
152:                }
153:            }
154:
155:            public String getName() {
156:                return NbBundle.getMessage(View.class, displayNameResource);
157:            }
158:
159:            public String getToolTipText() {
160:                return NbBundle.getMessage(View.class, toolTipResource);// NOI18N
161:            }
162:
163:            public Object writeReplace() {
164:                return new ResolvableHelper(name);
165:            }
166:
167:            /**
168:             * The serializing class.
169:             */
170:            private static final class ResolvableHelper implements 
171:                    Externalizable {
172:
173:                private String name;
174:
175:                private static final long serialVersionUID = 1L;
176:
177:                public ResolvableHelper(String name) {
178:                    this .name = name;
179:                }
180:
181:                public ResolvableHelper() {
182:                    // Just for the purpose of deserialization
183:                }
184:
185:                public void writeExternal(ObjectOutput out) throws IOException {
186:                    out.writeObject(name);
187:                }
188:
189:                public void readExternal(ObjectInput in) throws IOException,
190:                        ClassNotFoundException {
191:                    name = (String) in.readObject();
192:                }
193:
194:                public Object readResolve() {
195:                    return View.getView(name);
196:                }
197:            }
198:
199:            /** Creates the view. Call from the module layer only!
200:             * @deprecated Do not call.
201:             */
202:            public static synchronized TopComponent getBreakpointsView() {
203:                return new View(
204:                        "org/netbeans/modules/debugger/resources/breakpointsView/Breakpoint.gif",
205:                        BREAKPOINTS_VIEW_NAME,
206:                        "NetbeansDebuggerBreakpointNode", null,
207:                        "CTL_Breakpoints_view", "CTL_Breakpoints_view_tooltip");
208:            }
209:
210:            /** Creates the view. Call from the module layer only!
211:             * @deprecated Do not call.
212:             */
213:            public static synchronized TopComponent getCallStackView() {
214:                return new View(
215:                        "org/netbeans/modules/debugger/resources/allInOneView/CallStack.gif",
216:                        CALLSTACK_VIEW_NAME, "NetbeansDebuggerCallStackNode",
217:                        null, "CTL_Call_stack_view",
218:                        "CTL_Call_stack_view_tooltip");
219:            }
220:
221:            /** Creates the view. Call from the module layer only!
222:             * @deprecated Do not call.
223:             */
224:            public static synchronized TopComponent getLocalsView() {
225:                return new View(
226:                        "org/netbeans/modules/debugger/resources/localsView/local_variable_16.png",
227:                        LOCALS_VIEW_NAME, "NetbeansDebuggerVariableNode", null,
228:                        "CTL_Variables_view", "CTL_Locals_view_tooltip");
229:            }
230:
231:            /** Creates the view. Call from the module layer only!
232:             * @deprecated Do not call.
233:             */
234:            public static synchronized TopComponent getSessionsView() {
235:                return new View(
236:                        "org/netbeans/modules/debugger/resources/sessionsView/session_16.png",
237:                        SESSIONS_VIEW_NAME, "NetbeansDebuggerSessionNode",
238:                        "NetbeansDebuggerSessionsPropertiesSheet",
239:                        "CTL_Sessions_view", "CTL_Sessions_view_tooltip");
240:            }
241:
242:            /** Creates the view. Call from the module layer only!
243:             * @deprecated Do not call.
244:             */
245:            public static synchronized TopComponent getThreadsView() {
246:                return new View(
247:                        "org/netbeans/modules/debugger/resources/threadsView/RunningThread.gif",
248:                        THREADS_VIEW_NAME, "NetbeansDebuggerThreadNode",
249:                        "NetbeansDebuggerThreadsPropertiesSheet",
250:                        "CTL_Threads_view", "CTL_Threads_view_tooltip");
251:            }
252:
253:            /** Creates the view. Call from the module layer only!
254:             * @deprecated Do not call.
255:             */
256:            public static synchronized TopComponent getWatchesView() {
257:                return new View(
258:                        "org/netbeans/modules/debugger/resources/watchesView/watch_16.png",
259:                        WATCHES_VIEW_NAME, "NetbeansDebuggerWatchNode", null,
260:                        "CTL_Watches_view", "CTL_Watches_view_tooltip");
261:            }
262:
263:            private static TopComponent getView(String viewName) {
264:                if (viewName.equals(BREAKPOINTS_VIEW_NAME)) {
265:                    return getBreakpointsView();
266:                }
267:                if (viewName.equals(CALLSTACK_VIEW_NAME)) {
268:                    return getCallStackView();
269:                }
270:                if (viewName.equals(LOCALS_VIEW_NAME)) {
271:                    return getLocalsView();
272:                }
273:                if (viewName.equals(SESSIONS_VIEW_NAME)) {
274:                    return getSessionsView();
275:                }
276:                if (viewName.equals(THREADS_VIEW_NAME)) {
277:                    return getThreadsView();
278:                }
279:                if (viewName.equals(WATCHES_VIEW_NAME)) {
280:                    return getWatchesView();
281:                }
282:                throw new IllegalArgumentException(viewName);
283:            }
284:
285:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.