1 package net.sourceforge.phpeclipse.wiki.actions;
3 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
5 import org.eclipse.swt.graphics.Color;
6 import org.eclipse.ui.console.ConsolePlugin;
7 import org.eclipse.ui.console.IConsole;
8 import org.eclipse.ui.console.MessageConsole;
9 import org.eclipse.ui.console.MessageConsoleStream;
11 public class ProblemConsole {
12 private MessageConsole myConsole;
14 private MessageConsoleStream stream;
16 private boolean hasMessages;
18 public ProblemConsole() {
20 myConsole = new MessageConsole("Wikipedia Editor Problems", null);
21 ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { myConsole });
23 ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
24 // layout.addView(IConsoleConstants.ID_CONSOLE_VIEW, IPageLayout.BOTTOM, .5f,IPageLayout.ID_EDITOR_AREA);
25 stream = myConsole.newMessageStream();
31 public Color getColor() {
32 return stream.getColor();
38 public MessageConsole getConsole() {
39 return stream.getConsole();
45 * @see java.lang.Object#hashCode()
47 public int hashCode() {
48 return stream.hashCode();
54 public void print(String message) {
56 stream.print(message);
62 public void println() {
70 public void println(String message) {
72 stream.println(message);
78 public void setColor(Color color) {
79 stream.setColor(color);
82 public void reportError(String title, String message) {
84 WikiEditorPlugin.getDefault().reportError(title, message);
88 public void reportError() {
89 reportError("Problems listed", "Open console view for problems log!");