Examples of IContentTypeManager


Examples of org.eclipse.core.runtime.content.IContentTypeManager

    IStructuredFormatProcessor formatProcessor = null;
    if (map.containsKey(contentTypeId)) {
      formatProcessor = (IStructuredFormatProcessor) map.get(contentTypeId);
    } else {
      IContentTypeManager manager = Platform.getContentTypeManager();
      IContentType queryContentType = manager.getContentType(contentTypeId);
      boolean found = false;
      for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
        String elementContentTypeId = (String) iter.next();
        IContentType elementContentType = manager.getContentType(elementContentTypeId);
        if (queryContentType.isKindOf(elementContentType)) {
          formatProcessor = (IStructuredFormatProcessor) map.get(elementContentTypeId);
          map.put(contentTypeId, formatProcessor);
          found = true;
          break;
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

   */
  private String[] calculateParentContentTypeIds(String contentTypeId) {

    Set parentTypes = new HashSet();

    IContentTypeManager ctManager = Platform.getContentTypeManager();
    IContentType ct = ctManager.getContentType(contentTypeId);
    String id = contentTypeId;

    while (ct != null && id != null) {

      parentTypes.add(id);
      ct = ctManager.getContentType(id);
      if (ct != null) {
        IContentType baseType = ct.getBaseType();
        id = (baseType != null) ? baseType.getId() : null;
      }
    }
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

     */
    private String[] calculateParentContentTypeIds(String contentTypeId) {

        Set parentTypes = new HashSet();
       
        IContentTypeManager ctManager = Platform.getContentTypeManager();   
        IContentType ct = ctManager.getContentType(contentTypeId);
        String id = contentTypeId;

        while(ct != null && id != null) {
           
            parentTypes.add(id);
            ct = ctManager.getContentType(id);
            if(ct != null) {
                IContentType baseType = ct.getBaseType();
                id = (baseType != null) ? baseType.getId() : null;
            }
        }
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

     * @return a tag registry for the file (based on class path and
     * content type) or null if none.
     */
    protected final ITagRegistry findTagRegistry(final IFile file)
    {
        final IContentTypeManager typeManager = Platform.getContentTypeManager();
        final IContentType contentType =
            typeManager.findContentTypeFor(file.getName());
        ITagRegistry tagRegistry = null;
        if (contentType != null)
        {
            final TagRegistryIdentifier id =
                new TagRegistryIdentifier(file.getProject(), contentType);
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

  /**
   * @param model
   * @return true if model is a JSP contenttype
   */
  public static boolean isJSPModel(IDOMModel model) {   
    final IContentTypeManager typeManager = Platform.getContentTypeManager();
    final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(model.getStructuredDocument(), 0);
    final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(context);
    final IFile file = (IFile)resolver.getResource();
        final IContentType contentType =
            typeManager.findContentTypeFor(file.getName());
       
    return contentType.isKindOf(JSP_CONTENTTYPE);
  }
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

  private static TagRegistryIdentifier getTagRegistryIdentifier(
      final IPaletteContext paletteContext) {

    final IFile file = paletteContext.getFile();
    if (file != null) {
          final IContentTypeManager typeManager = Platform.getContentTypeManager();
          final IContentType contentType =
              typeManager.findContentTypeFor(file.getName());
         
          if (contentType != null)
          {
              return new TagRegistryIdentifier(file.getProject(), contentType);
          }
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

   */
  private String[] calculateParentContentTypeIds(String contentTypeId) {

    Set parentTypes = new HashSet();

    IContentTypeManager ctManager = Platform.getContentTypeManager();
    IContentType ct = ctManager.getContentType(contentTypeId);
    String id = contentTypeId;

    while (ct != null && id != null) {

      parentTypes.add(id);
      ct = ctManager.getContentType(id);
      if (ct != null) {
        IContentType baseType = ct.getBaseType();
        id = (baseType != null) ? baseType.getId() : null;
      }
    }
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

 
  public SyntaxColoringPage(){
    super();
    store = EditorPlugin.getDefault().getPreferenceStore();
   
    IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
    IContentType type = contentTypeManager.getContentType("at.ssw.cocoE.editor.CocoEContentType");
   
    contentTypes = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
   
    editorMap = loadPreferenceValues();
   
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

   
    Composite upperPart = new Composite(content, SWT.NONE);
    upperPart.setLayout(new GridLayout(1, false));
   
   
    IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
    IContentType type = contentTypeManager.getContentType("at.ssw.cocoE.editor.CocoEContentType");
   
    String[] contentTypes = type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
   
    editorChooser = new Combo(upperPart, SWT.NONE);
   
View Full Code Here

Examples of org.eclipse.core.runtime.content.IContentTypeManager

   
   

   
   
    IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
    IContentType type = contentTypeManager.getContentType("at.ssw.cocoE.editor.CocoEContentType");
   
   
   
    boolean isNew = true;
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.