Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.editors.text.templates
Class ContributionContextTypeRegistry


java.lang.Object
  extended by 

org.eclipse.jface.text.templates.ContextTypeRegistry
      extended by 
org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry

public class ContributionContextTypeRegistry
extends ContextTypeRegistry

A registry for context types. Editor implementors will usually instantiate a registry and configure the context types available in their editor. ContextTypes can be added either directly using ContextTypeRegistry.addContextType(TemplateContextType) or by instantiating and adding a contributed context type using addContextType(String).

Since:
3.0

Constructor Summary
ContributionContextTypeRegistry ()
          Creates a new context type registry.
ContributionContextTypeRegistry ( String registryId)
          Creates a new context type registry and registers all context types contributed for the given registry ID.
 
Method Summary
 void addContextType ( String id)
          Tries to create a context type given an id.
static  TemplateContextType createContextType ( String id)
          Tries to create a context type given an id.
 
Methods inherited from class org.eclipse.jface.text.templates. ContextTypeRegistry
addContextType, contextTypes, getContextType
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContributionContextTypeRegistry

public ContributionContextTypeRegistry(
String registryId)
Creates a new context type registry and registers all context types contributed for the given registry ID.

Parameters:
registryId - the registry ID
Since:
3.5

ContributionContextTypeRegistry

public ContributionContextTypeRegistry()
Creates a new context type registry.

Clients need to enable the desired context types by calling addContextType(String).

Method Detail

addContextType

public void addContextType(
String id)
Tries to create a context type given an id. If there is already a context type registered under the given id, nothing happens. Otherwise, contributions to the org.eclipse.ui.editors.templates extension point are searched for the given identifier and the specified context type instantiated if it is found.

Parameters:
id - the id for the context type as specified in XML

createContextType

public static 
TemplateContextType createContextType(
String id)
Tries to create a context type given an id. Contributions to the org.eclipse.ui.editors.templates extension point are searched for the given identifier and the specified context type instantiated if it is found. Any contributed TemplateVariableResolvers are also instantiated and added to the context type.

Parameters:
id - the id for the context type as specified in XML
Returns:
the instantiated and configured context type, or null if it is not found or cannot be instantiated

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire