Examples of IContentType


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

   
    if (resource instanceof IFile) {
      IContentDescription contentDescription = ((IFile) resource).getContentDescription();
     
      if (contentDescription != null) {
        IContentType contentType = contentDescription.getContentType();
       
        isAnalysisEngineDescriptorFile =
                contentType != null && ANALYSIS_ENGINE_DESCRIPTOR_ID.equals(contentType.getId());

      }
    }
   
    return isAnalysisEngineDescriptorFile;
View Full Code Here

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

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

    }
    registerTagsFromTagRegistry()
  }

  private boolean isJSP(final TagRegistryIdentifier tagRegistryId) {
    final IContentType ct = tagRegistryId.getContentType();
    if (JSPUtil.isJSPContentType(ct.getId()))
      return true;
    return false;
  }
View Full Code Here

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

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

        file.createNewFile();
      }
     
      //fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=202613 kindly contributed by Eiji Morito.
      IContentTypeManager contentTypeManager = Platform.getContentTypeManager();
      IContentType contentType = contentTypeManager.getContentType("org.eclipse.wst.html.core.htmlsource"); //$NON-NLS-1$
      IContentDescription contentDescription = contentType.getDescriptionFor(new StringReader(result.toString()), null);
      String charset = contentDescription.getCharset();
     
      if (charset == null || !Charset.isSupported(charset)) {
        charset = ResourcesPlugin.getEncoding();
        if (charset == null)
View Full Code Here

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

      // currently "hard-coded" to be jsp & jspf
      fContentTypes = new IContentType[]{Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP), Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPFRAGMENT)};
      if (fAdditionalContentTypesIDs != null) {
        List allTypes = new ArrayList(Arrays.asList(fContentTypes));
        for (int i = 0; i < fAdditionalContentTypesIDs.length; i++) {
          IContentType type = Platform.getContentTypeManager().getContentType(fAdditionalContentTypesIDs[i]);
          if (type != null) {
            allTypes.add(type);
          }
        }
        fContentTypes = (IContentType[]) allTypes.toArray(new IContentType[allTypes.size()]);
View Full Code Here

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

  private void installCharacterPairing() {
    IStructuredModel model = getInternalModel();
    if (model != null) {
      IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, "characterPairing"); //$NON-NLS-1$
      IContentTypeManager mgr = Platform.getContentTypeManager();
      IContentType type = mgr.getContentType(model.getContentTypeIdentifier());
      if (type != null) {
        for (int i = 0; i < elements.length; i++) {
          // Create the inserter
          IConfigurationElement element = elements[i];
          try {
            IConfigurationElement[] contentTypes = element.getChildren("contentTypeIdentifier");
            for (int j = 0; j < contentTypes.length; j++) {
              String id = contentTypes[j].getAttribute("id");
              if (id != null) {
                IContentType targetType = mgr.getContentType(id);
                int priority = calculatePriority(type, targetType, 0);
                if (priority >= 0) {
                  final CharacterPairing pairing = new CharacterPairing();
                  pairing.priority = priority;
                  String[] partitions = StringUtils.unpack(contentTypes[j].getAttribute("partitions"));
View Full Code Here

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

      List<String> validKnownExtensions = new ArrayList<String>();
      for (String contentTypeId: new String[]{
          "org.eclipse.jst.jsp.core.jspsource", //$NON-NLS-1$
          "org.eclipse.jst.jsp.core.jspfragmentsource", //$NON-NLS-1$
          "jsf.facelet"}) { //$NON-NLS-1$
          IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
          if (contentType != null) {
            String[] contentTypeExts = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
            if (contentTypeExts != null) {
              validKnownExtensions.addAll(Arrays.asList(contentTypeExts));
            }
          }
      }
View Full Code Here

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

        for (IConfigurationElement contentTypeElement : contentTypes)
        {
            final String contentTypeId = contentTypeElement
                    .getAttribute("contentTypeId"); //$NON-NLS-1$

            final IContentType contentType = typeManager
                    .getContentType(contentTypeId);
            _contentTypes.add(contentType);
        }
    }
View Full Code Here

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

      return null;

    IContentDescription desc = null;
    try {

      IContentType contentTypeJSP = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSP);
      desc = contentTypeJSP.getDescriptionFor(reader, IContentDescription.ALL);
    }
    catch (IOException e) {
      Logger.logException(e);
    }
    finally {
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.