Examples of IContentType


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

      /*
       * Check for tag/tagx files, otherwise add the JSP translation
       * factory for better compatibility with other possible subtypes
       * of JSP.
       */
      IContentType thisContentType = Platform.getContentTypeManager().getContentType(sm.getContentTypeIdentifier());
      IContentType tagContentType = Platform.getContentTypeManager().getContentType(ContentTypeIdForJSP.ContentTypeID_JSPTAG);
      if (thisContentType.isKindOf(tagContentType)) {
        INodeAdapterFactory factory = new TagTranslationAdapterFactory();
        sm.getFactoryRegistry().addFactory(factory);
      }
      else {
View Full Code Here

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

      if (types == null && exts == null) {
        add = true;
      }

      if (!add && types != null && types.length() > 0) {
        IContentType testType = Platform.getContentTypeManager().getContentType(key);
        StringTokenizer tokenizer = new StringTokenizer(types, ","); //$NON-NLS-1$
        while (tokenizer.hasMoreTokens()) {
          String type = tokenizer.nextToken();
          IContentType contentType = Platform.getContentTypeManager().getContentType(type);
          if (contentType != null && testType != null && testType.isKindOf(contentType)) {
            add = true;
            break;
          }
        }
View Full Code Here

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

  public IBreakpointProvider[] getBreakpointProviders(IEditorPart editorpart, String contentTypeID, String ext) {
    initCache();

    // Get breakpoint providers for this content type handler
    IBreakpointProvider[] providers1 = new IBreakpointProvider[0];
    IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
    List holdProviders = new ArrayList(2);
    while (contentType != null) {
      IBreakpointProvider[] providers = (IBreakpointProvider[]) map.get(contentType.getId());
      if (providers == null) {
        providers = createBreakpointProviders(ATT_CONTENT_TYPES, contentType.getId());
        if (providers != null) {
          map.put(contentType.getId(), providers);
        }
      }
      // providers were retrieved from cache or newly created
      if(providers != null) {
        holdProviders.addAll(Arrays.asList(providers));
      }
      contentType = contentType.getBaseType();
    }
    providers1 = (IBreakpointProvider[]) holdProviders.toArray(new IBreakpointProvider[holdProviders.size()]);

    // Get breakpoint providers for this extension
    IBreakpointProvider[] providers2 = new IBreakpointProvider[0];
View Full Code Here

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

        editorClass = editorClass.getSuperclass();
      }
    }

    if (fContentType != null) {
      IContentType contentType = Platform.getContentTypeManager().getContentType(fContentType);
      while (contentType != null && !contentType.getId().equals(IContentTypeManager.CT_TEXT)) {
        if (!points.contains(contentType.getId()))
          points.add(contentType.getId());
        contentType = contentType.getBaseType();
      }
    }

    if (fRootClass != null && !points.contains(fRootClass.getName()))
      points.add(fRootClass.getName());
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

   
    ISemanticHighlighting highlighting = null;
    String styleKey = null;
    IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(SSEUIPlugin.ID, SEMANTIC_HIGHLIGHTING_EXTENSION_POINT);
   
    IContentType contentType = Platform.getContentTypeManager().getContentType(fContentTypeId);
   
    for (int i = 0; i < elements.length; i++) {
      String[] targets = StringUtils.unpack(elements[i].getAttribute(TARGET_ATTR));
      for (int j = 0; j < targets.length; j++) {
        IContentType targetContentType = Platform.getContentTypeManager().getContentType(targets[j]);
        /* Apply semantic highlighting to kinds of targetContentType */
        if (contentType.isKindOf(targetContentType)) {
          try {
            highlighting = (ISemanticHighlighting) elements[i].createExecutableExtension(CLASS_ATTR);
            styleKey = elements[i].getAttribute(STYLE_KEY_ATTR);
View Full Code Here

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

    String contentType = null;

    IDocumentProvider provider = fTextEditor.getDocumentProvider();
    if (provider instanceof IDocumentProviderExtension4) {
      try {
        IContentType type = ((IDocumentProviderExtension4) provider).getContentType(fTextEditor.getEditorInput());
        if (type != null)
          contentType = type.getId();
      }
      catch (CoreException e) {
        /*
         * A failure accessing the underlying store really isn't
         * interesting, although it can be a problem for
View Full Code Here

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

   *
   * @return
   */
  private List getValidExtensions() {
    if (fValidExtensions == null) {
      IContentType type = getContentType();
      fValidExtensions = new ArrayList(Arrays.asList(type.getFileSpecs(IContentType.FILE_EXTENSION_SPEC)));
    }
    return fValidExtensions;
  }
View Full Code Here

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

   * @return true if extension is valid for this content type
   */
  private boolean extensionValidForContentType(String fileName) {
    boolean valid = false;

    IContentType type = getContentType();
    // there is currently an extension
    if (fileName.lastIndexOf('.') != -1) {
      // check what content types are associated with current extension
      IContentType[] types = Platform.getContentTypeManager().findContentTypesFor(fileName);
      int i = 0;
View Full Code Here

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

   */
  private CommentingStrategy getCommentingStrategy(String contentTypeID, ITypedRegion[] regions, Map registry) {
    ensureExtensionPointRead();
   
    CommentingStrategy match = null;
    IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);
   
    /* get all the commenting strategies for the given content type id,
     * including those registered for parent content types
     */
    List possibleCommentingStrategies = new ArrayList();
    while(contentType != null) {
      List contentTypeCommentingStrategies = (List)registry.get(contentType.getId());
      if(contentTypeCommentingStrategies != null && contentTypeCommentingStrategies.size() > 0) {
        possibleCommentingStrategies.addAll(contentTypeCommentingStrategies);
      }
      contentType = contentType.getBaseType();
    }
   
    /* find the commenting strategy applicable for the given regions,
     * because strategies were added starting from the most specific
     * content type first, the most specific strategy will always be chosen
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.