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


001:        /*******************************************************************************
002:         * Copyright (c) 2005, 2006 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.internal.contexts;
011:
012:        import org.eclipse.core.expressions.Expression;
013:        import org.eclipse.core.expressions.IEvaluationContext;
014:        import org.eclipse.ui.ISources;
015:        import org.eclipse.ui.contexts.IContextActivation;
016:        import org.eclipse.ui.contexts.IContextService;
017:        import org.eclipse.ui.internal.services.EvaluationResultCache;
018:
019:        /**
020:         * <p>
021:         * A token representing the activation of a context. This token can later be
022:         * used to cancel that activation. Without this token, then the context will
023:         * only become inactive if the component in which the context was activated is
024:         * destroyed.
025:         * </p>
026:         * <p>
027:         * This caches the context id, so that they can later be identified.
028:         * </p>
029:         * <p>
030:         * Note: this class has a natural ordering that is inconsistent with equals.
031:         * </p>
032:         * 
033:         * @since 3.1
034:         */
035:        final class ContextActivation extends EvaluationResultCache implements 
036:                IContextActivation {
037:
038:            /**
039:             * The identifier for the context which should be active. This value is
040:             * never <code>null</code>.
041:             */
042:            private final String contextId;
043:
044:            /**
045:             * The context service from which this context activation was requested.
046:             * This value is never <code>null</code>.
047:             */
048:            private final IContextService contextService;
049:
050:            /**
051:             * Constructs a new instance of <code>ContextActivation</code>.
052:             * 
053:             * @param contextId
054:             *            The identifier for the context which should be activated. This
055:             *            value must not be <code>null</code>.
056:             * @param expression
057:             *            The expression that must evaluate to <code>true</code>
058:             *            before this handler is active. This value may be
059:             *            <code>null</code> if it is always active.
060:             * @param contextService
061:             *            The context service from which the handler activation was
062:             *            requested; must not be <code>null</code>.
063:             * @see ISources
064:             */
065:            public ContextActivation(final String contextId,
066:                    final Expression expression,
067:                    final IContextService contextService) {
068:                super (expression);
069:
070:                if (contextId == null) {
071:                    throw new NullPointerException(
072:                            "The context identifier for a context activation cannot be null"); //$NON-NLS-1$
073:                }
074:
075:                if (contextService == null) {
076:                    throw new NullPointerException(
077:                            "The context service for an activation cannot be null"); //$NON-NLS-1$
078:                }
079:
080:                this .contextId = contextId;
081:                this .contextService = contextService;
082:            }
083:
084:            public final void clearActive() {
085:                clearResult();
086:            }
087:
088:            public final String getContextId() {
089:                return contextId;
090:            }
091:
092:            public final IContextService getContextService() {
093:                return contextService;
094:            }
095:
096:            public final boolean isActive(final IEvaluationContext context) {
097:                return evaluate(context);
098:            }
099:
100:            public final String toString() {
101:                final StringBuffer buffer = new StringBuffer();
102:
103:                buffer.append("ContextActivation(contextId="); //$NON-NLS-1$
104:                buffer.append(contextId);
105:                buffer.append(",sourcePriority="); //$NON-NLS-1$
106:                buffer.append(getSourcePriority());
107:                buffer.append(')');
108:
109:                return buffer.toString();
110:            }
111:
112:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.