Package org.cishell.service.guibuilder

Examples of org.cishell.service.guibuilder.GUIBuilderService


      return null;
    } catch (AlgorithmCreationFailedException e) {
      String format = "An error occurred when creating algorithm \"%s\".  (Reason: %s)";
      String errorMessage = String.format(format, name, e.getMessage());
      GUIBuilderService builder = (GUIBuilderService) Activator
          .getCiShellContext().getService(
              GUIBuilderService.class.getName());
      builder.showError("Error!", errorMessage, e);
      log(LogService.LOG_ERROR, errorMessage, e);
      return null;
    } catch (RuntimeException e) {
      GUIBuilderService builder = (GUIBuilderService) Activator
          .getCiShellContext().getService(
              GUIBuilderService.class.getName());
      String errorMessage = String
          .format("An unxpected error occurred while executing the algorithm \"%s\".",
              e.getMessage());
      builder.showError("Error!", errorMessage, e);
      return null;
    }
  }
View Full Code Here


  }
   
    public void postWindowOpen() {
        Display display = getWindowConfigurer().getWindow().getShell().getDisplay();
       
        GUIBuilderService builder = new SWTGuiBuilderService(display);
        Activator.getDefault().registerBuilder(builder);
    }
View Full Code Here

                Object value = parameters.get(key);
               
                log.log(LogService.LOG_INFO, key + " -> " + value + " (" + value.getClass().getName() + ")");
            }
           
            GUIBuilderService guiBuilder = (GUIBuilderService)
                context.getService(GUIBuilderService.class.getName());
           
            boolean confirm = guiBuilder.showConfirm("showConfirm()", "showConfirm Test", "showConfirm Details");
            log.log(LogService.LOG_INFO, "Confirmed? " + confirm);
            guiBuilder.showError("showError()", "showError Test", "showError Details");
           
            try {
                Integer.parseInt("Not an integer...");
            } catch (NumberFormatException e) {
                guiBuilder.showError("showError()", "showError w/ Throwable Test", e);
            }
           
            guiBuilder.showInformation("showInformation()", "showInformation Test", "showInformation Details");
            confirm = guiBuilder.showQuestion("showQuestion()", "showQuestion Test", "showQuestion Details");
            log.log(LogService.LOG_INFO, "Yes? " + (confirm ? "Yes" : "No"));
            guiBuilder.showWarning("showWarning()", "showWarning Test", "showWarning Details");
        }
       
        return null;
    }
View Full Code Here

      outData = removeNullData(outData);
      addDataToDataManager(outData);

      return outData;
    } catch (Exception e) {
      GUIBuilderService builder = (GUIBuilderService) this.ciShellContext
          .getService(GUIBuilderService.class.getName());

      String errorMessage = "An error occurred while preparing to run "
        + "the algorithm \"" + this.serviceReference.getProperty(AlgorithmProperty.LABEL)
        + ".\"";
           

      builder.showError("Error!", errorMessage, e);
      log(LogService.LOG_ERROR, errorMessage, e);
    }

    return null;
  }
View Full Code Here

          + serviceReference.getProperty(AlgorithmProperty.LABEL)
          + "\".";
      String details = "The algorithm's pid was \""
          + serviceReference.getProperty(Constants.SERVICE_PID)
          + "\" (potentially useful for debugging purposes).";
      GUIBuilderService builder = (GUIBuilderService) this.ciShellContext
          .getService(GUIBuilderService.class.getName());
      builder.showError("Error!", errorMessage, details);
      this.log(LogService.LOG_ERROR, errorMessage);
    }

    return algorithmFactory;
  }
View Full Code Here

      return null;
    } catch (AlgorithmCreationFailedException e) {
      String format = "An error occurred when creating algorithm \"%s\".  (Reason: %s)";
      String errorMessage = String.format(format, algorithmName,
          e.getMessage());
      GUIBuilderService builder = (GUIBuilderService) ciContext
          .getService(GUIBuilderService.class.getName());
      builder.showError("Error!", errorMessage, e);
      log(LogService.LOG_ERROR, errorMessage, e);

      return null;
    } catch (Exception e) {
      String errorMessage = String
          .format("Unexpected error occurred while creating algorithm \"%s\".",
              algorithmName);
      GUIBuilderService builder = (GUIBuilderService) ciContext
          .getService(GUIBuilderService.class.getName());
      // TODO: This is where uncaught exceptions are displayed.
      builder.showError("Error!", errorMessage, e);
      log(LogService.LOG_ERROR, errorMessage, e);

      return null;
    }
  }
View Full Code Here

      String logMessage = String.format(
          "The algorithm: \"%s\" had an error while executing: %s",
          algorithmName, e.getMessage());
      log(LogService.LOG_ERROR, logMessage, e);
    } catch (RuntimeException e) {
      GUIBuilderService builder = (GUIBuilderService) this.ciShellContext
          .getService(GUIBuilderService.class.getName());
      String errorMessage = String
          .format("An unxpected error occurred while executing the algorithm \"%s\".",
              algorithmName);
      builder.showError("Error!", errorMessage, e);
    }

    return outData;
  }
View Full Code Here

  protected Dictionary<String, Object> getUserEnteredParameters(
      String metatypePID, MetaTypeProvider provider) {
    Dictionary<String, Object> parameters = new Hashtable<String, Object>();

    if (provider != null) {
      GUIBuilderService builder = (GUIBuilderService) this.ciShellContext
          .getService(GUIBuilderService.class.getName());

      // TODO: Make builder.createGUIAndWait return a Dictionary<String,
      // Object>.
      parameters = builder.createGUIandWait(metatypePID, provider);
    }

    return parameters;
  }
View Full Code Here

TOP

Related Classes of org.cishell.service.guibuilder.GUIBuilderService

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.