Examples of IStructuredFormatProcessor


Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

      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);
        }
      }
      monitor.worked(95);
      monitor.done();
    } catch (MalformedInputExceptionWithDetail e) {
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

    if (resource.isAccessible()) {
      try {
        if (resource instanceof IFile) {
          IFile file = (IFile) resource;

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

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

      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);
        }
      }
      monitor.done();
    } catch (MalformedInputExceptionWithDetail e) {
      String message = NLS.bind(SSEUIMessages.FormatActionDelegate_5, new String[]{file.getFullPath().toString()});
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

    if (resource.isAccessible()) {
      try {
        if (resource instanceof IFile) {
          IFile file = (IFile) resource;

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

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

  public IStructuredFormatProcessor getFormatProcessor(String contentTypeId) {
    if (contentTypeId == null)
      return null;

    IStructuredFormatProcessor formatProcessor = null;
    if (map.containsKey(contentTypeId)) {
      formatProcessor = (IStructuredFormatProcessor) map.get(contentTypeId);
    } else {
      IContentTypeManager manager = Platform.getContentTypeManager();
      IContentType queryContentType = manager.getContentType(contentTypeId);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

      String processorClassName = element.getAttribute("class"); //$NON-NLS-1$
      String pluginID = element.getDeclaringExtension().getNamespace();
      Bundle bundle = Platform.getBundle(pluginID);

      try {
        IStructuredFormatProcessor processor = (IStructuredFormatProcessor)bundle.loadClass(processorClassName).newInstance();
        map.put(contentTypeId, processor);

        return true;
      } catch (InstantiationException e) {
        e.printStackTrace();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

        viewer.getDocument().addPosition(start);
        viewer.getDocument().addPosition(end);

        // get new element node
        IDOMNode newElementNode = (IDOMNode) ContentAssistUtils.getNodeAt(viewer, startTagOffset);
        IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
        formatProcessor.formatNode(newElementNode);

        // rename new element
        apply(viewer, trigger, stateMask, start, end, ELEMENT_NAME.length());
      } finally {
        viewer.getDocument().removePosition(start);
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

    try {
      // tell the model that we are about to make a big model change
      fModel.aboutToChangeModel();

      // format selected node
      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
      formatProcessor.formatNode(newElement);
    }
    finally {
      // tell the model that we are done with the big model change
      fModel.changedModel();
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

    try {
      // tell the model that we are about to make a big model change
      model.aboutToChangeModel();

      // format selected node
      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
      formatProcessor.formatNode(newElement);
    }
    finally {
      // tell the model that we are done with the big model change
      model.changedModel();
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.format.IStructuredFormatProcessor

      // Add the new element node
      legacyXmlElement.getParentNode().insertBefore(namespaceJndiElement, legacyXmlElement);

      // Format the new element node
      IStructuredFormatProcessor formatProcessor = new FormatProcessorXML();
      CleanupProcessorXML cleanupProcessor = new CleanupProcessorXML();
      cleanupProcessor.getCleanupPreferences().setCompressEmptyElementTags(true);

      formatProcessor.formatNode(namespaceJndiElement);
      cleanupProcessor.cleanupNode(namespaceJndiElement);

      legacyXmlElement.getParentNode().removeChild(legacyXmlElement);
    }
    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.