Examples of IContentType


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

    try {
      monitor.beginTask("", 100);
      IContentDescription contentDescription = file.getContentDescription();
      monitor.worked(5);
      if (contentDescription != null) {
        IContentType contentType = contentDescription.getContentType();
        IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
        if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
          String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString().substring(1)});          monitor.subTask(message);
          formatProcessor.setProgressMonitor(monitor);
          formatProcessor.formatFile(file);
        }
View Full Code Here

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

          IFile file = (IFile) resource;

          IStructuredFormatProcessor formatProcessor = null;
          IContentDescription contentDescription = file.getContentDescription();
          if (contentDescription != null) {
            IContentType contentType = contentDescription.getContentType();
            formatProcessor = getFormatProcessor(contentType.getId());
          }
          if (formatProcessor != null)
            result = true;
        }
        else if (resource instanceof IContainer) {
View Full Code Here

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

    // determine the current partition
    if (document != null) {
      String contentTypeID = getContentType(document);
      String partitionType = getPartitionType(document, offset);

      IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeID);

      while (openOn == null && contentType != null) {
        // Query OpenOnBuilder and get the list of OpenOns for the
        // current partition
        OpenOnDefinition[] defs = OpenOnBuilder.getInstance().getOpenOnDefinitions(contentType.getId(), partitionType);
        contentType = contentType.getBaseType();

        // If more than 1 openon is returned, need to further check
        // which OpenOn is the appropriate one to return
        // for now just returning the first one
        if (defs != null && defs.length > 0) {
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(in, IContentDescription.ALL);
    }
    catch (IOException e) {
      Logger.logException(e);
    }
    finally {
View Full Code Here

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

    try {
      monitor.beginTask("", 100);
      IContentDescription contentDescription = file.getContentDescription();
      monitor.worked(5);
      if (contentDescription != null) {
        IContentType contentType = contentDescription.getContentType();
        IStructuredFormatProcessor formatProcessor = getFormatProcessor(contentType.getId());
        if (formatProcessor != null && (monitor == null || !monitor.isCanceled())) {
          String message = NLS.bind(SSEUIMessages.FormatActionDelegate_3, new String[]{file.getFullPath().toString().substring(1)});          monitor.subTask(message);
          formatProcessor.setProgressMonitor(new SubProgressMonitor(monitor, 95));
          formatProcessor.formatFile(file);
        }
View Full Code Here

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

          IFile file = (IFile) resource;

          IStructuredFormatProcessor formatProcessor = null;
          IContentDescription contentDescription = file.getContentDescription();
          if (contentDescription != null) {
            IContentType contentType = contentDescription.getContentType();
            formatProcessor = getFormatProcessor(contentType.getId());
          }
          if (formatProcessor != null)
            result = true;
        }
        else if (resource instanceof IContainer) {
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

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