站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

Class2LayerFolder (MIME Lookup API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.mimelookup/1 1.6

org.netbeans.spi.editor.mimelookup
Interface Class2LayerFolder<T>


public interface Class2LayerFolder<T>

Provides further clasification of objects registered for a mime type. This interface is a hook into the implementation of the default MimeDataProvider that can be used to further specify where to look for instances of a certain class and how to create them.

The implementations of this interface should be registered among the services in the default lookup, for details look at META-INF/services registration.

The default MimeDataProvider allowes to register instances in a hierarchy of folders on the system filesystem (modules XML layers). The hierarchy starts with the Editors/ folder and then contains subfolders for each mime type that has some registered objects. So, for example there might be settings registered for the mime type identified by the following mime path 'text/x-jsp/text/x-java' and they would be located in the folder 'Editors/text/x-jsp/text/x-java' on the system filesystem. For more details on the implementation of the default MimeDataProvider please see the SPI package description.

The implementations of this interface are used for determining the structure under the folder belonging to a given mime type. This interface allows to tell the default MimeDataProvider that instances of a certain class are registered in a specific subfolder rather then under the folder belonging to the mime type. When looking up instances of such a class the default MimeDataProvider will not look in the mime type's folder, but in its subfolder, which name it will obtain by calling the implementation of this interface.

Therefore, for example instances of the FolderManager class can be registered in the 'Editors/text/x-java/foldManager' folder and they will be properly retrieved when calling MimeLookup.getLookup(MimePath.get("text/x-java")).lookup(FolderManager.class);.


Method Summary
 Class<T> getClazz()
          Gets the class of the instances that are registered under the special subfolder.
 InstanceProvider<T> getInstanceProvider()
          Gets the InstanceProvider that should be used for creating the registered instances.
 String getLayerFolderName()
          Gets the name of the subfolder where the instances are registered.
 

Method Detail

getClazz

Class<T> getClazz()
Gets the class of the instances that are registered under the special subfolder.

Returns:
The class which this object provides an additional information for.

getLayerFolderName

String getLayerFolderName()
Gets the name of the subfolder where the instances are registered. The subfolder should be located be located under the folder belonging to the appropriate mime type, i.e. Editors/text/x-java/<desired-layer-subfolder-name>.

Returns:
The mime type subfolder name.

getInstanceProvider

InstanceProvider<T> getInstanceProvider()
Gets the InstanceProvider that should be used for creating the registered instances. This method can return null if there is no speacial InstanceProvider needed and the instances can be created in the standard way.

Returns:
The InstanceProvider capable of createing instances of the getClazz() class. Can return null.

org.netbeans.modules.editor.mimelookup/1 1.6

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.