Examples of IContentType


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

   * @return {@link List} of {@link CompletionProposalContentTypeContext}s associated with the given
   * content type ID
   */
  private List getContexts(String contentTypeID) {
    List contexts = new ArrayList();
    IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
   
    while(contentType != null) {
      Object context = this.fActivationContexts.get(contentType.getId());
      if(context != null) {
        contexts.add(context);
      }
     
      contentType = contentType.getBaseType();
    }
   
    return contexts;
  }
View Full Code Here

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

    if (doc == null)
      return null;

    String contentTypeId = null;

    IContentType ct = null;
    try {
      IContentDescription desc = Platform.getContentTypeManager().getDescriptionFor(new StringReader(doc.get()), null, IContentDescription.ALL);
      if (desc != null) {
        ct = desc.getContentType();
        if (ct != null)
          contentTypeId = ct.getId();
      }
    }
    catch (IOException e) {
      // just bail
    }
View Full Code Here

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

     
      ITextViewer viewer = getTextViewer();
      if(viewer instanceof ProjectionViewer) {
        ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
       
        IContentType type = Platform.getContentTypeManager().getContentType(contentTypeId);
        while(fFoldingStrategy == null && type != null) {
          fFoldingStrategy =(AbstractStructuredFoldingStrategy) builder.getConfiguration(
              AbstractStructuredFoldingStrategy.ID, type.getId());
       
          type = type.getBaseType();
        }
       
        if(fFoldingStrategy != null) {
          fFoldingStrategy.setViewer((ProjectionViewer)viewer);
          fFoldingStrategy.setDocument(getDocument());
View Full Code Here

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

    return results.iterator();
  }

  public List getAdapterFactoriesAsList(IContentType contentType) {
    IContentType type = contentType;
    List results = new ArrayList();
    while (type != null && !type.getId().equals(IContentTypeManager.CT_TEXT)) {
      results.addAll(getAdapterFactoriesAsList(type.getId()));
      type = type.getBaseType();
    }
    return results;
  }
View Full Code Here

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

    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.IContentType

  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;
      }
    }
    return (String[]) parentTypes.toArray(new String[parentTypes.size()]);
  }
View Full Code Here

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

    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;
            }
        }
        return (String[])parentTypes.toArray(new String[parentTypes.size()]);
    }
View Full Code Here

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

    }
    return (String[]) allIds.toArray(new String[0]);
  }

  IContentType detectContentType(IPath location) {
    IContentType type = null;

    IResource resource = FileBuffers.getWorkspaceFileAtLocation(location);
    if (resource != null) {
      if (resource.getType() == IResource.FILE && resource.isAccessible()) {
        IContentDescription d = null;
View Full Code Here

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

      if(JSPSearchSupport.getInstance().isCanceled())
        return false;
     
      if (proxy.getType() == IResource.FILE) {

        IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
        // https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=3553
        // check this before description
        // check name before actually getting the file (less work)
        if(contentTypeJSP.isAssociatedWith(proxy.getName())) {
         
          IFile file = (IFile)proxy.requestResource();
          IContentDescription contentDescription = file.getContentDescription();
          String ctId = null;
          if (contentDescription != null) {
View Full Code Here

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

     * 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 =
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.