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


org.eclipse.ui.contexts.IContextService

All known Subclasses:   org.eclipse.ui.internal.contexts.SlaveContextService,  org.eclipse.ui.internal.contexts.ContextService,
IContextService
public interface IContextService extends IServiceWithSources(Code)

Provides services related to contexts in the Eclipse workbench. This provides access to contexts.

This interface should not be implemented or extended by clients.


since:
   3.1


Field Summary
final public static  StringCONTEXT_ID_DIALOG
     The identifier for the context that is active when a shell registered as a dialog.
final public static  StringCONTEXT_ID_DIALOG_AND_WINDOW
     The identifier for the context that is active when a shell is registered as either a window or a dialog.
final public static  StringCONTEXT_ID_WINDOW
     The identifier for the context that is active when a shell is registered as a window.
final public static  intTYPE_DIALOG
     The type used for registration indicating that the shell should be treated as a dialog.
final public static  intTYPE_NONE
     The type used for registration indicating that the shell should not receive any key bindings be default.
final public static  intTYPE_WINDOW
     The type used for registration indicating that the shell should be treated as a window.


Method Summary
public  IContextActivationactivateContext(String contextId)
    

Activates the given context within the context of this service.

public  IContextActivationactivateContext(String contextId, Expression expression)
    

Activates the given context within the context of this service.

public  IContextActivationactivateContext(String contextId, Expression expression, boolean global)
    

Activates the given context within the context of this service.

public  IContextActivationactivateContext(String contextId, Expression expression, int sourcePriorities)
    

Activates the given context within the context of this service.

public  voidaddContextManagerListener(IContextManagerListener listener)
     Adds a listener to this context service.
public  voiddeactivateContext(IContextActivation activation)
     Deactivates the given context within the context of this service.
public  voiddeactivateContexts(Collection activations)
     Deactivates the given contexts within the context of this service.
public  CollectiongetActiveContextIds()
     Returns the set of active context identifiers. The set of active context identifiers; this value may benull if no active contexts have been set yet.
public  ContextgetContext(String contextId)
     Retrieves the context with the given identifier.
public  CollectiongetDefinedContextIds()
     Returns the collection of the identifiers for all of the defined contexts in the workbench.
public  Context[]getDefinedContexts()
     Returns the collection of all of the defined contexts in the workbench.
public  intgetShellType(Shell shell)
     Returns the shell type for the given shell.
Parameters:
  shell - The shell for which the type should be determined.
public  voidreadRegistry()
    

Reads the context information from the registry and the preferences.

public  booleanregisterShell(Shell shell, int type)
    

Registers a shell to automatically promote or demote some basic types of contexts.

public  voidremoveContextManagerListener(IContextManagerListener listener)
     Removes a listener from this context service.
public  booleanunregisterShell(Shell shell)
    

Unregisters a shell that was previously registered.


Field Detail
CONTEXT_ID_DIALOG
final public static String CONTEXT_ID_DIALOG(Code)
The identifier for the context that is active when a shell registered as a dialog.



CONTEXT_ID_DIALOG_AND_WINDOW
final public static String CONTEXT_ID_DIALOG_AND_WINDOW(Code)
The identifier for the context that is active when a shell is registered as either a window or a dialog.



CONTEXT_ID_WINDOW
final public static String CONTEXT_ID_WINDOW(Code)
The identifier for the context that is active when a shell is registered as a window.



TYPE_DIALOG
final public static int TYPE_DIALOG(Code)
The type used for registration indicating that the shell should be treated as a dialog. When the given shell is active, the "In Dialogs" context should also be active.



TYPE_NONE
final public static int TYPE_NONE(Code)
The type used for registration indicating that the shell should not receive any key bindings be default. When the given shell is active, we should not provide any EnabledSubmission instances for the "In Dialogs" or "In Windows" contexts.



TYPE_WINDOW
final public static int TYPE_WINDOW(Code)
The type used for registration indicating that the shell should be treated as a window. When the given shell is active, the "In Windows" context should also be active.





Method Detail
activateContext
public IContextActivation activateContext(String contextId)(Code)

Activates the given context within the context of this service. If this service was retrieved from the workbench, then this context will be active globally. If the service was retrieved from a nested component, then the context will only be active within that component.

Also, it is guaranteed that the contexts submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite would deactivate all of its contexts when the site is destroyed.


Parameters:
  contextId - The identifier for the context which should be activated; mustnot be null. A token which can be used to later cancel the activation. Onlysomeone with access to this token can cancel the activation. Theactivation will automatically be cancelled if the context fromwhich this service was retrieved is destroyed.



activateContext
public IContextActivation activateContext(String contextId, Expression expression)(Code)

Activates the given context within the context of this service. The context becomes active when expression evaluates to true. This is the same as calling IContextService.activateContext(String,Expression,boolean) with global==false.

Also, it is guaranteed that the context submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite would deactivate all of its handlers when the site is destroyed.


Parameters:
  contextId - The identifier for the context which should be activated; mustnot be null.
Parameters:
  expression - This expression must evaluate to true beforethis context will really become active. The expression may benull if the context should always be active. A token which can be used to later cancel the activation. Onlysomeone with access to this token can cancel the activation. Theactivation will automatically be cancelled if the context fromwhich this service was retrieved is destroyed.
See Also:   org.eclipse.ui.ISources
since:
   3.2



activateContext
public IContextActivation activateContext(String contextId, Expression expression, boolean global)(Code)

Activates the given context within the context of this service. The context becomes active when expression evaluates to true. If global==false then this service must also be the active service to activate the context.

Also, it is guaranteed that the context submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite would deactivate all of its handlers when the site is destroyed.


Parameters:
  contextId - The identifier for the context which should be activated; mustnot be null.
Parameters:
  expression - This expression must evaluate to true beforethis context will really become active. The expression may benull if the context should always be active.
Parameters:
  global - Indicates that the handler should be activated irrespectivelyof whether the corresponding workbench component (e.g.,window, part, etc.) is active. A token which can be used to later cancel the activation. Onlysomeone with access to this token can cancel the activation. Theactivation will automatically be cancelled if the context fromwhich this service was retrieved is destroyed.
See Also:   org.eclipse.ui.ISources
since:
   3.2



activateContext
public IContextActivation activateContext(String contextId, Expression expression, int sourcePriorities)(Code)

Activates the given context within the context of this service. The context becomes active when expression evaluates to true.

Also, it is guaranteed that the context submitted through a particular service will be cleaned up when that services is destroyed. So, for example, a service retrieved from a IWorkbenchPartSite would deactivate all of its handlers when the site is destroyed.


Parameters:
  contextId - The identifier for the context which should be activated; mustnot be null.
Parameters:
  expression - This expression must evaluate to true beforethis context will really become active. The expression may benull if the context should always be active.
Parameters:
  sourcePriorities - The source priorities for the expression. A token which can be used to later cancel the activation. Onlysomeone with access to this token can cancel the activation. Theactivation will automatically be cancelled if the context fromwhich this service was retrieved is destroyed.
See Also:   org.eclipse.ui.ISourcesIContextService.activateContext(StringExpression)



addContextManagerListener
public void addContextManagerListener(IContextManagerListener listener)(Code)
Adds a listener to this context service. The listener will be notified when the set of defined contexts changes. This can be used to track the global appearance and disappearance of contexts.
Parameters:
  listener - The listener to attach; must not be null.
since:
   3.2



deactivateContext
public void deactivateContext(IContextActivation activation)(Code)
Deactivates the given context within the context of this service. If the handler was context with a different service, then it must be deactivated from that service instead. It is only possible to retract a context activation with this method. That is, you must have the same IContextActivation used to activate the context.
Parameters:
  activation - The token that was returned from a call toactivateContext; must not be null.



deactivateContexts
public void deactivateContexts(Collection activations)(Code)
Deactivates the given contexts within the context of this service. If the contexts were activated with a different service, then they must be deactivated from that service instead. It is only possible to retract context activations with this method. That is, you must have the same IContextActivation instances used to activate the contexts.
Parameters:
  activations - The tokens that were returned from a call toactivateContext. This collection must onlycontain instances of IContextActivation. Thecollection must not be null.



getActiveContextIds
public Collection getActiveContextIds()(Code)
Returns the set of active context identifiers. The set of active context identifiers; this value may benull if no active contexts have been set yet. Ifthe set is not null, then it contains onlyinstances of String.
since:
   3.2



getContext
public Context getContext(String contextId)(Code)
Retrieves the context with the given identifier. If no such context exists, then an undefined context with the given id is created.
Parameters:
  contextId - The identifier to find; must not be null. A context with the given identifier, either defined or undefined.



getDefinedContextIds
public Collection getDefinedContextIds()(Code)
Returns the collection of the identifiers for all of the defined contexts in the workbench. The collection of context identifiers (String)that are defined; never null, but may be empty.



getDefinedContexts
public Context[] getDefinedContexts()(Code)
Returns the collection of all of the defined contexts in the workbench. The collection of contexts (Context) that aredefined; never null, but may be empty.
since:
   3.2



getShellType
public int getShellType(Shell shell)(Code)
Returns the shell type for the given shell.
Parameters:
  shell - The shell for which the type should be determined. If thisvalue is null, thenIContextService.TYPE_NONE is returned. IContextService.TYPE_WINDOW,IContextService.TYPE_DIALOG, orIContextService.TYPE_NONE.



readRegistry
public void readRegistry()(Code)

Reads the context information from the registry and the preferences. This will overwrite any of the existing information in the context service. This method is intended to be called during start-up. When this method completes, this context service will reflect the current state of the registry and preference store.




registerShell
public boolean registerShell(Shell shell, int type)(Code)

Registers a shell to automatically promote or demote some basic types of contexts. The "In Dialogs" and "In Windows" contexts are provided by the system. This a convenience method to ensure that these contexts are promoted when the given is shell is active.

If a shell is registered as a window, then the "In Windows" context is enabled when that shell is active. If a shell is registered as a dialog -- or is not registered, but has a parent shell -- then the "In Dialogs" context is enabled when that shell is active. If the shell is registered as none -- or is not registered, but has no parent shell -- then the neither of the contexts will be enabled (by us -- someone else can always enabled them).

If the provided shell has already been registered, then this method will change the registration.


Parameters:
  shell - The shell to register for key bindings; must not benull.
Parameters:
  type - The type of shell being registered. This value must be one ofthe constants given in this interface. true if the shell had already been registered(i.e., the registration has changed); falseotherwise.



removeContextManagerListener
public void removeContextManagerListener(IContextManagerListener listener)(Code)
Removes a listener from this context service.
Parameters:
  listener - The listener to be removed; must not be null.
since:
   3.2



unregisterShell
public boolean unregisterShell(Shell shell)(Code)

Unregisters a shell that was previously registered. After this method completes, the shell will be treated as if it had never been registered at all. If you have registered a shell, you should ensure that this method is called when the shell is disposed. Otherwise, a potential memory leak will exist.

If the shell was never registered, or if the shell is null, then this method returns false and does nothing.
Parameters:
  shell - The shell to be unregistered; does nothing if this value isnull. true if the shell had been registered;false otherwise.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.