Пример #1
1
 /**
  * Show a message in a warning dialog window.
  *
  * @param errorTitle title for warning dialog.
  * @param errorMSG warning message.
  */
 public static void reportWarning(String errorTitle, String errorMSG) {
   ErrorDialog.showMessageDialog(
       PatchEdit.getInstance() /*[email protected]*/,
       errorMSG,
       errorTitle,
       JOptionPane.WARNING_MESSAGE);
   if ((debugLevel & DEBUG_MSG) != 0) System.out.println("WRN> '" + errorMSG + "' reported.");
   if ((debugLevel & DUMP_STACK) != 0) Thread.dumpStack();
 }
Пример #2
0
  public static void main(String[] args) throws IOException {
    if (args.length != 1) {
      System.err.printf("Usage: DesignerApplication propertyFile\n");
      System.exit(-1);
    }

    Properties properties = parseProperties(args[0]);
    String repositoryFile = properties.getProperty("octopus.repository.file");
    if (repositoryFile == null || repositoryFile.length() == 0) {
      System.err.printf(
          "The property file %s is missing the octopus.repository.file property", args[0]);
      System.exit(-1);
    }

    OctopusRepository repository = new OctopusDb4oRepository(repositoryFile);
    LookAndFeelFactory.installDefaultLookAndFeelAndExtension();
    final DesignerFrame designerFrame = new DesignerFrame(repository);
    try {
      designerFrame.loadInitialDataFromRepository();

      SwingUtilities.invokeLater(
          new Runnable() {
            @Override
            public void run() {
              designerFrame.setVisible(true);
            }
          });
    } catch (RepositoryException e) {
      ErrorDialog.showErrorDialog(null, e, "Problem loading initial data from repository");
    }
  }
Пример #3
0
 /**
  * Show a message in a warning dialog window with an <code>Exception</code> information.
  *
  * @param errorTitle title for warning dialog.
  * @param errorMSG warning message.
  * @param e an <code>Exception</code> value
  */
 public static void reportWarning(String errorTitle, String errorMSG, Exception e) {
   ErrorDialog.showMessageDialog(
       PatchEdit.getInstance() /*[email protected]*/,
       errorMSG,
       errorTitle,
       JOptionPane.WARNING_MESSAGE);
   if ((debugLevel & DEBUG_MSG) != 0) {
     System.out.println("WRN> '" + errorMSG + "' reported.");
     System.out.println("WRN> [Exception] " + e.getMessage());
   }
   if ((debugLevel & DUMP_STACK) != 0) e.printStackTrace(System.out);
 }
Пример #4
0
 public static void displayErrorDialog(List<Object> errors, @CheckForNull Window frame) {
   ErrorDialog errorDialog = new ErrorDialog(frame);
   errorDialog.setErrors(errors);
   errorDialog.setVisible(true);
 }