Package org.tuba.plugins

Examples of org.tuba.plugins.ITutorialDocument


      IOException {
    Tuple<ITutorialDocument, IEditorConnector> tuple = getTutorialDocument();
    if (tuple == null)
      return;

    ITutorialDocument document = tuple.getLeft();
    IEditorConnector editorConnector = tuple.getRight();
    tuple = null;

    boolean doIntegration = false;
    for (ArtefactLocation location : artefactLocations) {
      String providerID = location.getProviderID();
      String artefactID = location.getArtefactID();
      if (providerID == null || artefactID == null)
        continue;
      XMLProvider provider = new XMLProvider(providerID,
          artefactID);
      XMLReference reference = new XMLReference(provider);
      IntegrationDialog dialog = new IntegrationDialog(PlatformUI
          .getWorkbench().getActiveWorkbenchWindow().getShell(),
          document);
      if (dialog.open() != Dialog.OK)
        continue;

      for (MetaArtefactOperation operation : dialog.getOperations()) {
        XMLArtefactOperation o = new XMLArtefactOperation(operation
            .getId());
        o.setConfiguration(operation.getConfiguration());
        reference.getOperations().add(o);
      }

      MetaIntegrator integrator = dialog.getIntegrator();
      if (integrator != null) {
        XMLIntegrator i = new XMLIntegrator(integrator.getId());
        i.setConfiguration(integrator.getConfiguration());
        reference.setIntegrator(i);
      }

      XMLArtefact artefactTag = ReferenceManager.getInstance()
          .generateArtefact(document, reference);

      if (editorConnector.insertTag(document, artefactTag.toString()))
        doIntegration = true;
    }

    if (doIntegration) {
      IntegrationJob job = new IntegrationJob(document);
      job.setUser(true);
      job.schedule();
      try {
        job.join();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      if (job.getResult().isOK())
        document.setModified(true);
    }
  }
View Full Code Here


    IEditorConnector editorConnector = EditorConnectorManager.getInstance()
        .getEditorConnector(editorPart);
    if (editorConnector == null)
      return null;

    ITutorialDocument document = editorConnector.getDocument(editorPart);
    if (document == null)
      return null;

    return new Tuple<ITutorialDocument, IEditorConnector>(document,
        editorConnector);
View Full Code Here

    IEditorConnector editorConnector = EditorConnectorManager.getInstance()
        .getEditorConnector(editor);
    if (editorConnector == null)
      return;

    ITutorialDocument tutorialDocument = editorConnector
        .getDocument(editor);
    DocumentManager.getInstance().removeDocument(tutorialDocument);
  }
View Full Code Here

    IEditorConnector editorConnector = EditorConnectorManager.getInstance()
        .getEditorConnector(editor);
    if (editorConnector == null)
      return;

    ITutorialDocument tutorialDocument = editorConnector
        .getDocument(editor);
    editorConnector.replaceSaveRoutine(editor, tutorialDocument);

    DocumentManager.getInstance().addDocument(tutorialDocument,
        editorConnector);
View Full Code Here

    for (IResource resource : resources) {
      IFile file = resource.getProject().getFile(
          resource.getProjectRelativePath());

      ITutorialDocument document = DocumentManager.getInstance()
          .getTutorialDocument(file);

      if (document != null) {
        IEditorConnector editorConnector = DocumentManager
            .getInstance().getDocumentInfo(document)
View Full Code Here

    IEditorConnector editorConnector = EditorConnectorManager.getInstance()
        .getEditorConnectorForExtension(file.getFileExtension());
    if (editorConnector == null)
      return null;

    ITutorialDocument document = editorConnector.loadDocument(file);

    if (document == null)
      return null;

    return new Tuple<ITutorialDocument, IEditorConnector>(document,
View Full Code Here

TOP

Related Classes of org.tuba.plugins.ITutorialDocument

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.