Package org.apache.uima.pear

Examples of org.apache.uima.pear.PearException


      setWindowTitle("PEAR Generation Wizard");
      setDefaultPageImageDescriptor(PearPlugin.getImageDescriptor("generatePearWiz.gif"));
      setNeedsProgressMonitor(true);
      currentContainer = container;
    } catch (Throwable e) {
      PearException subEx = new PearException(
              "Operation failed because the wizard could not be initialized.\nPlease report this error.",
              e);
      subEx.openErrorDialog(getShell());
      this.dispose();
    }
    try {
      AbstractUIPlugin plugin = PearPlugin.getDefault();
      IDialogSettings workbenchSettings = plugin.getDialogSettings();
      IDialogSettings section = workbenchSettings.getSection("PearFileExportWizard");//$NON-NLS-1$
      if (section == null)
        section = workbenchSettings.addNewSection("PearFileExportWizard");//$NON-NLS-1$
      setDialogSettings(section);
    } catch (Throwable e) {
      e.printStackTrace();
    }
    try {
      insd = PearInstallationDescriptor.getInstallationDescriptor(currentContainer);
    } catch (Throwable e) {
      e.printStackTrace();
      insd = new InstallationDescriptor();
    }
    try {
      ProjectCustomizer.customizeProject(currentContainer, insd);
    } catch (Throwable e) {
      PearException subEx = new PearException(
              "Operation failed because the wizard could not customize your project as a UIMA project.",
              e);
      subEx.openErrorDialog(getShell());
      this.dispose();
    }
  }
View Full Code Here


      pearExportPage = new PearFileResourceExportPage(new StructuredSelection(currentContainer
              .members()), currentContainer);
      addPage(pearExportPage);

    } catch (Throwable e) {
      PearException subEx = new PearException(
              "Operation failed because the wizard's pages could not be initialized properly.", e);
      subEx.openErrorDialog(getShell());
      this.dispose();
    }
  }
View Full Code Here

   * @return
   * @throws PearException
   */
  protected boolean ensureTargetFileIsValid(File targetFile) throws PearException {
    if (targetFile.exists() && targetFile.isDirectory()) {
      throw new PearException("The target pear File must not be a directory", new PearException(
              "The target pear File must not be a directory"));
    }
    if (targetFile.exists()) {
      if (!targetFile.canWrite()) {
        throw new PearException("The pear File exists, but is not writable", new PearException(
                "The pear File exists, but is not writable"));
      }
    }
    return true;
  }
View Full Code Here

    // initialize Page with insd content;
    try {
      initializePage();
      validateCompInfo();
    } catch (Throwable e) {
      PearException subEx = new PearException(
              "The operation failed because the wizard's pages could not be initialized properly.",
              e);
      subEx.openErrorDialog(getShell());
      this.dispose();
    }
  }
View Full Code Here

      setErrorMessage(fileValidationMsg);

      dialogChanged();
      setControl(container);
    } catch (Throwable e) {
      PearException subEx = new PearException(
              "The operation failed because the wizard's pages could not be initialized properly.",
              e);
      subEx.openErrorDialog(getShell());
      this.dispose();
    }
  }
View Full Code Here

        project.setDescription(description, null);
        project.close(null);
        project.open(null);
      }
    } catch (Throwable e) {
      PearException subEx = new PearException("The UIMA Nature could not be added properly.", e);
      throw subEx;
    }
  }
View Full Code Here

        ProjectCustomizer.createFolder(container, "doc");
        ProjectCustomizer.createFolder(container, "conf");
        ProjectCustomizer.createFolder(container, "resources");
      }
    } catch (Throwable e) {
      PearException subEx = new PearException(
              "The PEAR folder structure could not be created properly.", e);
      throw subEx;
    }
  }
View Full Code Here

      } else {
        // return what already exisited
        return folder;
      }
    } catch (Throwable e) {
      PearException subEx = new PearException("folderName could not be created properly.", e);
      throw subEx;
    }
  }
View Full Code Here

    InputStream is = null;
    try {
      is = new ByteArrayInputStream(s.getBytes("UTF-8"));
      return createFile(project, fileName, is, overrideContentIfExist);
    } catch (Throwable e) {
      PearException subEx = new PearException(fileName + " could not be created/saved properly.", e);
      throw subEx;
    }
  }
View Full Code Here

        }
      } else
        // return null as there is no container to place a file in
        return null;
    } catch (Throwable e) {
      PearException subEx = new PearException(fileName + " could not be created/saved properly.", e);
      throw subEx;
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.pear.PearException

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.