Package org.apache.uima.taeconfigurator

Examples of org.apache.uima.taeconfigurator.InternalErrorCDE


    try {
      try {
        contextFile = fileNeedingContext.getPersistentProperty(new QualifiedName(
                AbstractSection.PLUGIN_ID, AbstractSection.IMPORTABLE_PART_CONTEXT));
      } catch (CoreException e) {
        throw new InternalErrorCDE("unexpected exception", e);
      }
      ContextForPartDialog dialog = new ContextForPartDialog(PlatformUI.getWorkbench().getDisplay()
              .getShells()[0], // ok in Eclipse 3.0
              getFile().getProject().getParent(), thing, getFile().getLocation(), this, contextFile);
      dialog.setTitle("File specifying context for editing importable part");
      if (dialog.open() == Window.CANCEL)
        throw new MultilevelCancel();

      contextFile = dialog.contextPath;

      if (null == contextFile) {
        Utility
                .popMessage(
                        "Context Info",
                        "A context is required to edit this part.  However no context was supplied.  Editing will be cancelled",
                        Utility.INFORMATION);
        throw new MultilevelCancel();
      } else {
        try {
          input = new XMLInputSource(contextFile);
        } catch (IOException e) {
          showContextLoadFailureMessage(e, contextFile);
          throw new MultilevelCancel();
        }
        if (null != input)
          try {
            parseSource(input, contextFile);
          } catch (PartInitException e) {
            showContextLoadFailureMessage(e, contextFile);
            throw new MultilevelCancel();
          }
      }
    } finally {
      openingContext = false;
    }
    if (null == aeDescription) {
      aeDescription = UIMAFramework.getResourceSpecifierFactory().createAnalysisEngineDescription();
    } else {
      try {
        file.setPersistentProperty(new QualifiedName(AbstractSection.PLUGIN_ID,
                AbstractSection.IMPORTABLE_PART_CONTEXT), contextFile);
      } catch (CoreException e) {
        Utility.popMessage("Unexpected Exception", "While loading Context"
                + getMessagesToRootCause(e), Utility.ERROR);
        throw new InternalErrorCDE("Unexpected Exception:" + getMessagesToRootCause(e), e);
      }
    }
  }
View Full Code Here


      public void run() {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          page.openEditor(new FileEditorInput(ffile), "taeconfigurator.editors.MultiPageEditor"); //$NON-NLS-1$
        } catch (PartInitException e) {
          throw new InternalErrorCDE("unexpected exception");
        }
      }
    });
  }
View Full Code Here

      public void run() {
        IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        try {
          page.openEditor(new FileEditorInput(ffile), "org.eclipse.ui.DefaultTextEditor"); //$NON-NLS-1$
        } catch (PartInitException e) {
          throw new InternalErrorCDE("unexpected exception");
        }
      }
    });
  }
View Full Code Here

        return jp.findType(typename);
      } catch (JavaModelException e) {
        Utility.popMessage("Unexpected Exception", MessageFormat.format(
                "Unexpected exception while getting type information for type ''{0}''. {1}",
                new Object[] { typename, getMessagesToRootCause(e) }), Utility.ERROR);
        throw new InternalErrorCDE("unexpected exception", e);
      }
    return null;
  }
View Full Code Here

          return SearchEngine.createHierarchyScope(getCollectionReaderIType());
        case DESCRIPTOR_FLOWCONTROLLER:
          return SearchEngine.createHierarchyScope(getFlowControllerIType());
      }
    } catch (JavaModelException e) {
      throw new InternalErrorCDE("unexpected exception", e);
    }
    return null;
  }
View Full Code Here

  private CandidateAndSource [] computeByNameCandidates() {
    String cp;
    try {
      cp = editor.getFilteredProjectClassPath(false);
    } catch (CoreException e) {
      throw new InternalErrorCDE("unhandled CoreException while getting classpaths to populate by-location list", e);
    }
    String [] cps = cp.split(PATH_SEPARATOR);
    List<CandidateAndSource> candidates = new ArrayList<CandidateAndSource>(100);
   
    for (String jarOrDir : cps) {
View Full Code Here

      try {
        jarIn = new JarInputStream(new BufferedInputStream(new FileInputStream(jarPath)));
      } catch (FileNotFoundException e) {
        return;
      } catch (IOException e) {
        throw new InternalErrorCDE(
            "unhandled IOException while reading Jar in classpath to populate by-location list", e);
      }
      ZipEntry entry;
      try {
        while (null != (entry = jarIn.getNextEntry())) {
          String name = entry.getName();
          if (name.startsWith("META-INF")) {
            continue;
          }
          if (name.endsWith(".xml")) {
            css.add(new CandidateAndSource(name, source));
          }
        }
      } catch (IOException e) {
        throw new InternalErrorCDE(
            "unhandled IOException while getting next Jar Entry to populate by-location list", e);
      }
      sawJar.put(jarPath, fileLastModified);
      cachedCs.put(jarPath, css);
    }
View Full Code Here

      case FEAT: {
        removeFeature(c, removeItem);
        break;
      }
      default:
        throw new InternalErrorCDE("invalid state");
    }

    table.setSelection(previousSelection);
    finishAction();
  }
View Full Code Here

    // If get here, case = Type declared as Output(input) or not at all while all Features
    // declared as Input (output)
    // Need to add the Type and set the all annotator features value
    if (isAllFeatures)
      throw new InternalErrorCDE("invalid state");
    return items;
  }
View Full Code Here

      return LANG_ITEM;
    if (SOFAS_TITLE.equals(itemID))
      return SOFA;
    if (SOFA_TITLE.equals(itemID))
      return SOFA_ITEM;
    throw new InternalErrorCDE("invalid state");
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.taeconfigurator.InternalErrorCDE

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.