Examples of PearException


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

Examples of org.apache.uima.pear.PearException

      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

Examples of org.apache.uima.pear.PearException

   * @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

Examples of org.apache.uima.pear.PearException

    // 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

Examples of org.apache.uima.pear.PearException

      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

Examples of org.apache.uima.pear.PearException

        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

Examples of org.apache.uima.pear.PearException

        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

Examples of org.apache.uima.pear.PearException

      } 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

Examples of org.apache.uima.pear.PearException

    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

Examples of org.apache.uima.pear.PearException

        }
      } 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
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.