00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.console.wizard;
00026
00027 import java.awt.Color;
00028 import java.awt.Font;
00029 import java.awt.HeadlessException;
00030 import java.io.IOException;
00031
00032 import javax.swing.JFrame;
00033 import javax.swing.JTextArea;
00034
00035 import org.objectweb.cjdbc.common.i18n.WizardTranslate;
00036 import org.objectweb.cjdbc.console.gui.constants.GuiConstants;
00037 import org.objectweb.cjdbc.console.gui.jtools.JTextAreaWriter;
00038
00039
00040
00041
00042
00043
00044
00045 public class XmlValidatorFrame extends JFrame
00046 {
00047
00048 final String eol = System.getProperty("line.separator");
00049 JTextArea report;
00050 JTextAreaWriter writer;
00051
00052
00053
00054
00055
00056
00057 public XmlValidatorFrame(String fileName) throws HeadlessException
00058 {
00059 super(WizardTranslate.get("init.validator.frame"));
00060 GuiConstants.centerComponent(this, WizardConstants.VALIDATOR_WIDTH,
00061 WizardConstants.VALIDATOR_HEIGHT);
00062 this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
00063 report = new JTextArea();
00064 writer = new JTextAreaWriter(report);
00065 report.setForeground(new Color(9498256));
00066 this.getContentPane().add(report);
00067 this.pack();
00068 this.setVisible(true);
00069 writeLine(WizardTranslate.get("init.validator.echo", fileName));
00070 }
00071
00072
00073
00074
00075
00076
00077 public void writeLine(String s)
00078 {
00079 try
00080 {
00081 writer.write(s + eol);
00082 writer.flush();
00083 report.repaint();
00084 }
00085 catch (IOException e)
00086 {
00087 e.printStackTrace();
00088 }
00089 }
00090
00091 public void setWarning()
00092 {
00093 Font font = report.getFont();
00094 report.setForeground(new Color(16758465));
00095 }
00096
00097 }