Source Code Cross Referenced for AbstractStatusHandler.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » statushandlers » 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 Eclipse » ui workbench » org.eclipse.ui.statushandlers 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2006, 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.ui.statushandlers;
011:
012:        import java.util.Map;
013:
014:        import org.eclipse.ui.application.WorkbenchAdvisor;
015:
016:        /**
017:         * <p>
018:         * Status handlers are part of the status handling facility. The facility is
019:         * responsible for handling errors and other important issues in Eclipse based
020:         * applications. The handlers are responsible for presenting this errors by
021:         * logging or showing error dialogs.
022:         * </p>
023:         * 
024:         * <p>
025:         * All status handlers extends
026:         * <code>org.eclipse.ui.statushandlers.AbstractStatusHandler</code>. Each
027:         * handler implements <code>handle(StatusAdapter status, int style)</code>.
028:         * This method handles statuses due to handling style. The style indicates how
029:         * status handler should handle a status.
030:         * </p>
031:         * 
032:         * <p>
033:         * For acceptable styles check {@link StatusManager}.
034:         * </p>
035:         * 
036:         * <p>
037:         * Handlers shoudn't be used directly but through the {@link StatusManager}. It
038:         * chooses which handler should be used for handling. There are two ways for
039:         * adding handlers to the handling flow. First using extension point
040:         * <code>org.eclipse.ui.statusHandlers</code>, second by the workbench
041:         * advisor and its method {@link WorkbenchAdvisor#getWorkbenchErrorHandler()}.
042:         * If a handler is associated with a product, it is used instead of this defined
043:         * in advisor.
044:         * </p>
045:         * 
046:         * <p>
047:         * A status handler has the id and a set of parameters. The handler can use them
048:         * during handling. If the handler is added as an extension, both are set during
049:         * initialization of the handler using elements and attributes of
050:         * <code>statusHandler</code> element.
051:         * </p>
052:         * 
053:         * @since 3.3
054:         */
055:        public abstract class AbstractStatusHandler {
056:
057:            private Map params;
058:
059:            private String id;
060:
061:            /**
062:             * Handles {@link StatusAdapter} objects based on the set style. 
063:             * 
064:             * @param statusAdapter
065:             *            the status adapter. May not be <code>null</code>.
066:             * @param style
067:             *            style constant. Acceptable values are defined in
068:             *            {@link StatusManager} and can be combined with logical OR.
069:             * 
070:             * @see StatusManager#BLOCK
071:             * @see StatusManager#NONE
072:             * @see StatusManager#SHOW
073:             * @see StatusManager#LOG
074:             */
075:            public abstract void handle(StatusAdapter statusAdapter, int style);
076:
077:            /**
078:             * Returns all parameters of the handler.
079:             * 
080:             * @return the parameters
081:             */
082:            public Map getParams() {
083:                return params;
084:            }
085:
086:            /**
087:             * Returns the value of the handler's parameter identified by the given key,
088:             * or <code>null</code> if this handler has no such parameter.
089:             * 
090:             * @param key
091:             *            the name of the property
092:             * @return the value of the parameter, or <code>null</code> if this
093:             *         handler has no such parameter
094:             */
095:            public Object getParam(Object key) {
096:                if (params != null) {
097:                    return params.get(key);
098:                }
099:
100:                return null;
101:            }
102:
103:            /**
104:             * Sets the parameters for the handler. If the handler is added via the
105:             * <code> org.eclipse.ui.statushandlers extension</code>, the parameters are set 
106:             * during initialization of the handler using <code>parameter</code> 
107:             * elements from <code>statusHandler</code>
108:             * element.
109:             * 
110:             * @param params
111:             *            the parameters to set
112:             */
113:            public void setParams(Map params) {
114:                this .params = params;
115:            }
116:
117:            /**
118:             * Returns the id of the handler.
119:             * 
120:             * @return the id
121:             */
122:            public String getId() {
123:                return id;
124:            }
125:
126:            /**
127:             * Sets the id for the handler. If the handler is added as an extension, the
128:             * id is set during initialization of the handler using <code>id</code>
129:             * attribute of <code>statusHandler</code> element.
130:             * 
131:             * @param id
132:             *            the id to set
133:             */
134:            public void setId(String id) {
135:                this.id = id;
136:            }
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.