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 });
22 ConsolePlugin.getDefault().getConsoleManager().showConsoleView(myConsole);
23 // layout.addView(IConsoleConstants.ID_CONSOLE_VIEW, IPageLayout.BOTTOM, .5f,IPageLayout.ID_EDITOR_AREA);
24 stream = myConsole.newMessageStream();
30 public Color getColor() {
31 return stream.getColor();
37 public MessageConsole getConsole() {
38 return stream.getConsole();
44 * @see java.lang.Object#hashCode()
46 public int hashCode() {
47 return stream.hashCode();
53 public void print(String message) {
55 stream.print(message);
61 public void println() {
69 public void println(String message) {
71 stream.println(message);
77 public void setColor(Color color) {
78 stream.setColor(color);
81 public void reportError(String title, String message) {
83 WikiEditorPlugin.getDefault().reportError(title, message);
87 public void reportError() {
88 reportError("Problems listed", "Open console view for problems log!");