Examples of Growl


Examples of info.growl.Growl

  private static final String TEST_OK = QUICK_J_UNIT + "Test OK";
  private static final String TEST_FAILURE = QUICK_J_UNIT + "Test FAILURE";
  private static final String TEST_ERROR = QUICK_J_UNIT + "Test ERROR";

  public TestListenerForGrowl() {
    final Growl growl = GrowlUtils.getGrowlInstance(QUICK_J_UNIT);
    growl.addNotification(TEST_OK, true);
    growl.addNotification(TEST_FAILURE, true);
    growl.addNotification(TEST_ERROR, true);
    try {
      growl.register();
    } catch (GrowlException e) {
    }

    JUnitCore.addTestRunListener(new org.eclipse.jdt.junit.TestRunListener() {
      private TemplateParser parser = new TemplateParser();
      @Override
      public void sessionFinished(ITestRunSession session) {
        String template = Preference.TEMPLATE.getValue();
        parser.setTemplate(template);
        RenderedImage icon;
        Result testResult = session.getTestResult(true);
        InputStream input;
        String notification;
        if(Result.ERROR.equals(testResult)){
          notification = TEST_ERROR;
          input = getClass().getResourceAsStream("/icons/tsuiteerror.gif");
        }else if(Result.FAILURE.equals(testResult)){
          notification = TEST_FAILURE;
          input = getClass().getResourceAsStream("/icons/tsuitefail.gif");
        }else{
          notification = TEST_OK;
          input = getClass().getResourceAsStream("/icons/tsuiteok.gif");         
        }
        String parseTemplate = parser.parseTemplate(session);
        try {
          icon = ImageIO.read(input);
          growl.sendNotification(notification, testResult.toString(), parseTemplate, icon);
        } catch (IOException e) {
          e.printStackTrace();
        } catch (GrowlException e) {
          e.printStackTrace();
        }
View Full Code Here

Examples of net.bnubot.bot.gui.notifications.Growl

    long timeNow = System.currentTimeMillis();
    if(timeNow - lastSystemTrayTime < 1000)
      return;
    lastSystemTrayTime = timeNow;

    Growl growl = GuiDesktop.getGrowl();
    if(growl != null) {
      try {
        growl.notifyGrowlOf(gt, headline, text);
      } catch (Exception e) {
        Out.exception(e);
      }
    } else {
      TrayIcon tray = GuiDesktop.getTray();
View Full Code Here

Examples of net.bnubot.bot.gui.notifications.Growl

    if((tray != null) || (growl != null) || !GlobalSettings.trayIconMode.enableTray())
      return;

    try {
      if(OperatingSystem.userOS == OperatingSystem.OSX)
        growl = new Growl("BNU-Bot", "Contents/Resources/Icon.icns");
    } catch(Exception ex) {
      Out.exception(ex);
      Out.error(GuiEventHandler.class, "Growl is not supported");
      GlobalSettings.trayIconMode = TrayIconMode.DISABLED;
    }
View Full Code Here

Examples of org.primefaces.component.growl.Growl

public class GrowlRenderer extends org.primefaces.component.growl.GrowlRenderer {
   
    @Override
  public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
    Growl growl = (Growl) component;
       
        encodeMarkup(context, growl);
        encodeScript(context, growl);
  }
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.