Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.ILog


  public static Image getJettyIcon() {
    return plugin.getImageRegistry().get(JETTY_ICON);
  }

  static public void logError(Exception e) {
    ILog log = plugin.getLog();
    StringWriter stringWriter = new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    String msg = stringWriter.getBuffer().toString();
    Status status = new Status(IStatus.ERROR, getDefault().getBundle()
        .getSymbolicName(), IStatus.ERROR, msg, null);
    log.log(status);
  }
View Full Code Here


        .getSymbolicName(), IStatus.ERROR, msg, null);
    log.log(status);
  }

  static public void logError(String msg) {
    ILog log = plugin.getLog();
    Status status = new Status(IStatus.ERROR, getDefault().getBundle()
        .getSymbolicName(), IStatus.ERROR, msg + "\n", null);
    log.log(status);
  }
View Full Code Here

  public static Image getJettyIcon() {
    return plugin.getImageRegistry().get(JETTY_ICON);
  }

  static public void logError(Exception e) {
    ILog log = plugin.getLog();
    StringWriter stringWriter = new StringWriter();
    e.printStackTrace(new PrintWriter(stringWriter));
    String msg = stringWriter.getBuffer().toString();
    Status status = new Status(IStatus.ERROR, getDefault().getBundle()
        .getSymbolicName(), IStatus.ERROR, msg, null);
    log.log(status);
  }
View Full Code Here

        .getSymbolicName(), IStatus.ERROR, msg, null);
    log.log(status);
  }

  static public void logError(String msg) {
    ILog log = plugin.getLog();
    Status status = new Status(IStatus.ERROR, getDefault().getBundle()
        .getSymbolicName(), IStatus.ERROR, msg + "\n", null); //$NON-NLS-1$
    log.log(status);
  }
View Full Code Here

            "    RootPanel rootPanel = RootPanel.get();",
            "  }",
            "}");
    frame.refresh();
    // add log listener for exception validation
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        Throwable exception = status.getException();
        assertThat(exception).isExactlyInstanceOf(IllegalStateException.class);
        assertEquals("Bad getElement()", exception.getMessage());
      }
    };
    // temporary intercept logging
    try {
      log.addLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(false);
      // prepare new component
      WidgetInfo myButton = createWidget("test.client.MyButton");
      // ask image
      {
        Image image = myButton.getImage();
        assertNotNull(image);
        assertThat(image.getBounds().width).isEqualTo(200);
        assertThat(image.getBounds().height).isEqualTo(50);
      }
    } finally {
      log.removeLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(true);
    }
    // dispose
    do_projectDispose();
  }
View Full Code Here

            "}");
    frame.refresh();
    String originalSource = m_lastEditor.getSource();
    // add log listener for exception validation
    final AtomicInteger exceptionCount = new AtomicInteger();
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        exceptionCount.getAndIncrement();
      }
    };
    // temporary intercept logging
    try {
      log.addLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(false);
      // prepare new component
      WidgetInfo myButton = createWidget("test.client.MyButton");
      // ask image
      {
        Image image = myButton.getImage();
        assertNotNull(image);
      }
    } finally {
      log.removeLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(true);
    }
    // no exceptions
    assertEquals(0, exceptionCount.get());
    // no changes in editor
View Full Code Here

   *
   * @param message
   *            A {@link String} to be logged.
   */
  public void logInfoStatus(String message) {
    ILog log = Platform.getLog(getBundle());
    log.log(getStatus(Status.INFO, message));
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
      }
    };
    //
    try {
      log.addLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(false);
      {
        Object receiver = m_testProject.getJavaProject();
        assertFalse(doTest(receiver, "no-such-property"));
      }
    } finally {
      log.removeLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(true);
    }
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
      }
    };
    //
    try {
      log.addLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(false);
      {
        Object receiver = m_testProject.getJavaProject();
        assertFalse(doTest(receiver, "no-such-property"));
      }
    } finally {
      log.removeLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(true);
    }
  }
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_unknownProperty() throws Exception {
    ILog log = DesignerPlugin.getDefault().getLog();
    ILogListener logListener = new ILogListener() {
      public void logging(IStatus status, String plugin) {
        assertEquals(IStatus.ERROR, status.getSeverity());
        assertEquals(DesignerPlugin.PLUGIN_ID, status.getPlugin());
        assertEquals(IStatus.ERROR, status.getCode());
        assertInstanceOf(IllegalArgumentException.class, status.getException());
      }
    };
    //
    try {
      log.addLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(false);
      {
        Object receiver = m_testProject.getJavaProject();
        assertFalse(doTest(receiver, "no-such-property"));
      }
    } finally {
      log.removeLogListener(logListener);
      DesignerPlugin.setDisplayExceptionOnConsole(true);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.ILog

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.