Java Doc for MimeLookup.java in  » IDE-Netbeans » editor » org » netbeans » api » editor » mimelookup » 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 Netbeans » editor » org.netbeans.api.editor.mimelookup 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.netbeans.api.editor.mimelookup.MimeLookup

MimeLookup
final public class MimeLookup extends Lookup (Code)
Mime Lookup provides lookup mechanism for mime type specific objects. It can be used for example for retrieving mime type specific editor settings, actions, etc.

The static method MimeLookup.getLookup(MimePath) getLookup(MimePath mimePath) can be used to obtain a mime type specific lookup implementation. This lookup can then be searched for objects bound to the specific mime type using the standard Lookup methods.

Please look at the description of the MimePath class to learn more about embedded mime types and how they are represented by the mime path. By using the MimePath the MimeLookup class allows to have different Lookups for a mime type embedded in different other mime types. So, for example there can be different editor settings for the 'text/x-java' mime type and for the 'text/x-java' mime type embedded in the 'text/x-jsp' mime type.

The Lookup instance returned from the getLookup method can be used in the same way as any other Lookup. It is possible to look up class instances, listen on changes in the lookup restults, etc. The following code snippet shows a typical usage of this class for getting instances of the YourSetting class from the 'text/x-java' mime type specific Lookup.

 Lookup lookup = MimeLookup.getLookup(MimePath.get("text/x-java"));
 Lookup.Result result = lookup.lookup(new Lookup.Template(YourSetting.class));
 Collection instances = result.allInstances();
 

Lifecycle: The lifecycle of Lookup instances created by calling the getLookup or getMimeLookup methods is tied to the lifecycle of the MimePath instances they were created for and vice versa. Therefore it is enough to keep reference to either the MimePath or the Lookup created for that mime path or even to the Lookup.Result in order to preserve the other instances in the memory. Clients are strongly encouraged to keep refernce to the Lookups they obtain from this class throughout the whole lifecycle of their component, especially when they need to use that Lookup several times.
author:
   Miloslav Metelka, Martin Roskanin, Vita Stejskal
See Also:   MimePath





Method Summary
public  MimeLookupchildLookup(String mimeType)
     Gets mime-type specific child (embeded) lookup.
public static  LookupgetLookup(MimePath mimePath)
     Gets a Lookup implementation that exposes objects specific for the given MimePath.
Parameters:
  mimePath - The mime path to get the Lookup for.
public static  LookupgetLookup(String mimePath)
     Gets a Lookup implementation that exposes objects specific for the given MimePath for the given mime-type or mime-path given as string.
The method first translates the string mime-path into MimePath by using MimePath.parse(String) and then calls MimeLookup.getLookup(MimePath) .
Parameters:
  mimePath - non-null string which is either a mime-type e.g.
public static  MimeLookupgetMimeLookup(String mimeType)
     Gets mime-type specific lookup.
Parameters:
  mimeType - non-null mime-type string representation, e.g.
public  Tlookup(Class<T> clazz)
     Looks up an object in this mime path lookup.
Parameters:
  clazz - The class of the object to search for.
public  Result<T>lookup(Template<T> template)
     Looks up objects in this mime path lookup.
Parameters:
  template - The template describing the objects to look for.



Method Detail
childLookup
public MimeLookup childLookup(String mimeType)(Code)
Gets mime-type specific child (embeded) lookup. Child mime-type content can be embeded into parent mime-type content in various embeded languages. In this case mime-type lookup child is specified as subelement of parent lookup i.e.: MimeLookup("text/x-jsp") can have a child MimeLookup("text/x-java") in a case of a jsp scriplet.
Parameters:
  mimeType - non-null mime-type string representation non-null mime-type specific child (embeded) lookupMimeLookup.getLookup(MimePath)



getLookup
public static Lookup getLookup(MimePath mimePath)(Code)
Gets a Lookup implementation that exposes objects specific for the given MimePath.
Parameters:
  mimePath - The mime path to get the Lookup for. The Lookup containing instances for the MimePathpassed in as a parameter.



getLookup
public static Lookup getLookup(String mimePath)(Code)
Gets a Lookup implementation that exposes objects specific for the given MimePath for the given mime-type or mime-path given as string.
The method first translates the string mime-path into MimePath by using MimePath.parse(String) and then calls MimeLookup.getLookup(MimePath) .
Parameters:
  mimePath - non-null string which is either a mime-type e.g. "text/plain"or mime-path (multiple mime-types separated by slash) e.g."text/x-jsp/text/x-java". The Lookup containing instances for the given mime-path.
See Also:   MimeLookup.getLookup(MimePath)



getMimeLookup
public static MimeLookup getMimeLookup(String mimeType)(Code)
Gets mime-type specific lookup.
Parameters:
  mimeType - non-null mime-type string representation, e.g. "text/x-java" non-null mime-type specific lookupMimeLookup.getLookup(MimePath) getLookup(MimePath.get(mimeType))



lookup
public T lookup(Class<T> clazz)(Code)
Looks up an object in this mime path lookup.
Parameters:
  clazz - The class of the object to search for. An object implementing the given class or null if no suchimplementation is found.MimeLookup.getLookup(MimePath)



lookup
public Result<T> lookup(Template<T> template)(Code)
Looks up objects in this mime path lookup.
Parameters:
  template - The template describing the objects to look for. The search result.MimeLookup.getLookup(MimePath)



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