Examples of ValidationHandler


Examples of org.eclipse.help.internal.dynamic.ValidationHandler

    if (processor == null) {
      processor = new DocumentProcessor();
    }
    final Set linkedContributionIds = new HashSet();
    ProcessorHandler[] linkFinder = new ProcessorHandler[] {
      new ValidationHandler(getRequiredAttributes()),
      new ProcessorHandler() {
        public short handle(UAElement element, String id) {
          if (element instanceof Link) {
            Link link = (Link)element;
            String toc = link.getToc();
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.ValidationHandler

        UAElement root = reader.read(in);
        if ("contexts".equals(root.getElementName())) { //$NON-NLS-1$
          // process dynamic content
          if (processor == null) {
            processor = new DocumentProcessor(new ProcessorHandler[] {
              new ValidationHandler(getRequiredAttributes()),
              new NormalizeHandler(),
              new IncludeHandler(reader, locale),
              new ExtensionHandler(reader, locale)
            });
          }
View Full Code Here

Examples of org.eclipse.help.internal.dynamic.ValidationHandler

    if (url != null) {
      InputStream in = url.openStream();
      UAElement extension = (UAElement)reader.read(in);
      if (processor == null) {
        processor = new DocumentProcessor(new ProcessorHandler[] {
          new ValidationHandler(getRequiredAttributes(), getDeprecatedElements())
        });
      }
      processor.process(extension, '/' + bundle.getSymbolicName() + '/' + path);
      IUAElement[] children = extension.getChildren();
      ContentExtension[] result = new ContentExtension[children.length];
View Full Code Here

Examples of org.fusesource.ide.commons.camel.tools.ValidationHandler

      // load the model
      if (editor.getModel() == null) {
        try {
          editor.setModel(CamelContextIOUtils.loadModelFromFile(camelContextFile));
          editor.setCamelContextFile(camelContextFile);
          ValidationHandler status = CamelContextIOUtils.validateModel(editor.getModel());
          if (status.hasErrors()) {
            Activator.getLogger().error("Unable to validate the model. Invalid input!");
            return false;
          }
        } catch (PartInitException pe) {
          Activator.getLogger().error("Unable to load the model. Invalid input!", pe);
          return false;
        }
      }
      return true;
    } else {
      IRemoteCamelEditorInput remoteEditorInput = editor.asRemoteCamelEditorInput(input);
      if (remoteEditorInput != null) {
        camelContextFile = null;
        container = null;

        // load the model
        if (editor.getModel() == null) {
          try {
            String text = remoteEditorInput.getXml();
            try {
              editor.setModel(CamelContextIOUtils.loadModelFromText(text));
              ValidationHandler status = CamelContextIOUtils.validateModel(editor.getModel());
              if (status.hasErrors()) {
                Activator.getLogger().error("Unable to validate the model. Invalid input!");
                return false;
              }
            } catch (PartInitException pe) {
              Activator.getLogger().error("Unable to load the model. Invalid input!", pe);
View Full Code Here

Examples of org.fusesource.ide.commons.camel.tools.ValidationHandler

    if (file.getName().contentEquals("switchyard.xml")) {
      MessageDialog.openWarning(getSite().getShell(), EditorMessages.switchyardFoundTitle,
          EditorMessages.switchyardFoundText);
      switchToSourceEditor();
    }
    ValidationHandler status = this.getModel().validate();
    if (status.hasErrors()) {
      switchToSourceEditor();
    }
  }
View Full Code Here

Examples of org.fusesource.ide.commons.camel.tools.ValidationHandler

          String text = document.get();
          loadEditorText(text);
        }

      } else {
        ValidationHandler status = this.getModel().validate();
        if (status.hasErrors()) {
          String error = status.userMessage();
          showXmlValidationError(error);
        }
      }
    }
  }
View Full Code Here

Examples of org.fusesource.ide.commons.camel.tools.ValidationHandler

  public ValidationHandler validate() throws Exception {
    if (model != null) {
      return model.validate();
    } else {
      // typically when we've not been able to parse the XML yet...
      return new ValidationHandler();
    }
  }
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.