Package org.eclipse.wst.sse.ui.internal.reconcile.validator

Examples of org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy


    fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
  }

  protected void beginProcessing() {
    super.beginProcessing();
    ValidatorStrategy validatorStrategy = getValidatorStrategy();
    if (validatorStrategy != null) {
      validatorStrategy.beginProcessing();
    }
    if ((getTextViewer() instanceof ISourceViewer)) {
      for (int i = 0; i < fReconcileListeners.length; i++) {
        fReconcileListeners[i].aboutToBeReconciled();
      }
View Full Code Here


    }
  }

  protected void endProcessing() {
    super.endProcessing();
    ValidatorStrategy validatorStrategy = getValidatorStrategy();
    if (validatorStrategy != null) {
      validatorStrategy.endProcessing();
    }
    /* single spell-check for everything to ensure that SpellingProblem offsets are correct */
    IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
    IDocument document = getDocument();
    if (spellingStrategy != null && document != null) {
View Full Code Here

  /**
   * @return Returns the ValidatorStrategy.
   */
  protected ValidatorStrategy getValidatorStrategy() {
    ValidatorStrategy validatorStrategy = null;
    if (fValidatorStrategy == null && fValidationEnabled) {
      if (getTextViewer() instanceof ISourceViewer) {
        ISourceViewer viewer = (ISourceViewer) getTextViewer();
        String contentTypeId = null;

        IDocument doc = viewer.getDocument();
        contentTypeId = getContentType(doc);

        if (contentTypeId != null) {
          validatorStrategy = new ValidatorStrategy(viewer, contentTypeId);
          ValidatorBuilder vBuilder = new ValidatorBuilder();
          ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_UI_ID);
          List enabledValidators = new ArrayList(1);
          /* if any "must" handle this content type, just add them */
          boolean foundSpecificContentTypeValidators = false;
          for (int i = 0; i < vmds.length; i++) {
            if (vmds[i].mustHandleContentType(contentTypeId)) {
              if (DEBUG_VALIDATORS)
                Logger.log(Logger.INFO, contentTypeId + " using specific validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
              foundSpecificContentTypeValidators = true;
              enabledValidators.add(vmds[i]);
            }
          }
          if (!foundSpecificContentTypeValidators) {
            for (int i = 0; i < vmds.length; i++) {
              if (vmds[i].canHandleContentType(contentTypeId)) {
                if (DEBUG_VALIDATORS)
                  Logger.log(Logger.INFO, contentTypeId + " using inherited(?) validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
                enabledValidators.add(vmds[i]);
              }
            }
          }
          for (int i = 0; i < enabledValidators.size(); i++) {
            validatorStrategy.addValidatorMetaData((ValidatorMetaData) enabledValidators.get(i));
          }
        }
      }
      fValidatorStrategy = validatorStrategy;
    } else if(fValidatorStrategy != null && fValidationEnabled) {
View Full Code Here

       * https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053
       *
       * Process the strategies for the last known-good partitions.
       */
      for (int i = 0; i < fLastPartitions.length; i++) {
        ValidatorStrategy validatorStrategy = getValidatorStrategy();
        if (validatorStrategy != null) {
          validatorStrategy.reconcile(fLastPartitions[i], createDirtyRegion(fLastPartitions[i], DirtyRegion.REMOVE));
        }
      }
      IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
      if (spellingStrategy != null) {
        spellingStrategy.reconcile(new Region(0, document.getLength()));
View Full Code Here

    fReconcileListeners = (ISourceReconcilingListener[]) listeners.toArray(new ISourceReconcilingListener[listeners.size()]);
  }

  protected void beginProcessing() {
    super.beginProcessing();
    ValidatorStrategy validatorStrategy = getValidatorStrategy();
    if (validatorStrategy != null) {
      validatorStrategy.beginProcessing();
    }
    if ((getTextViewer() instanceof ISourceViewer)) {
      for (int i = 0; i < fReconcileListeners.length; i++) {
        fReconcileListeners[i].aboutToBeReconciled();
      }
View Full Code Here

    }
  }

  protected void endProcessing() {
    super.endProcessing();
    ValidatorStrategy validatorStrategy = getValidatorStrategy();
    if (validatorStrategy != null) {
      validatorStrategy.endProcessing();
    }
    /* single spell-check for everything to ensure that SpellingProblem offsets are correct */
    IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
    IDocument document = getDocument();
    if (spellingStrategy != null && document != null) {
View Full Code Here

  /**
   * @return Returns the ValidatorStrategy.
   */
  protected ValidatorStrategy getValidatorStrategy() {
    ValidatorStrategy validatorStrategy = null;
    if (fValidatorStrategy == null && fValidationEnabled) {
      if (getTextViewer() instanceof ISourceViewer) {
        ISourceViewer viewer = (ISourceViewer) getTextViewer();
        String contentTypeId = null;

        IDocument doc = viewer.getDocument();
        contentTypeId = getContentType(doc);

        if (contentTypeId != null) {
          validatorStrategy = new ValidatorStrategy(viewer, contentTypeId);
          ValidatorBuilder vBuilder = new ValidatorBuilder();
          ValidatorMetaData[] vmds = vBuilder.getValidatorMetaData(SSE_UI_ID);
          List enabledValidators = new ArrayList(1);
          /* if any "must" handle this content type, just add them */
          boolean foundSpecificContentTypeValidators = false;
          for (int i = 0; i < vmds.length; i++) {
            if (vmds[i].mustHandleContentType(contentTypeId)) {
              if (DEBUG_VALIDATORS)
                Logger.log(Logger.INFO, contentTypeId + " using specific validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
              foundSpecificContentTypeValidators = true;
              enabledValidators.add(vmds[i]);
            }
          }
          if (!foundSpecificContentTypeValidators) {
            for (int i = 0; i < vmds.length; i++) {
              if (vmds[i].canHandleContentType(contentTypeId)) {
                if (DEBUG_VALIDATORS)
                  Logger.log(Logger.INFO, contentTypeId + " using inherited(?) validator " + vmds[i].getValidatorId()); //$NON-NLS-1$
                enabledValidators.add(vmds[i]);
              }
            }
          }
          for (int i = 0; i < enabledValidators.size(); i++) {
            validatorStrategy.addValidatorMetaData((ValidatorMetaData) enabledValidators.get(i));
          }
        }
      }
      fValidatorStrategy = validatorStrategy;
    } else if(fValidatorStrategy != null && fValidationEnabled) {
View Full Code Here

       * https://bugs.eclipse.org/bugs/show_bug.cgi?id=199053
       *
       * Process the strategies for the last known-good partitions.
       */
      for (int i = 0; i < fLastPartitions.length; i++) {
        ValidatorStrategy validatorStrategy = getValidatorStrategy();
        if (validatorStrategy != null) {
          validatorStrategy.reconcile(fLastPartitions[i], createDirtyRegion(fLastPartitions[i], DirtyRegion.REMOVE));
        }
      }
      IReconcilingStrategy spellingStrategy = getSpellcheckStrategy();
      if (spellingStrategy != null) {
        spellingStrategy.reconcile(new Region(0, document.getLength()));
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.reconcile.validator.ValidatorStrategy

Copyright © 2018 www.massapicom. 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.