01: package org.dbbrowser.ui.helper.exporthelper.wizard.panel;
02:
03: import infrastructure.internationalization.InternationalizationManager;
04: import infrastructure.propertymanager.PropertyManager;
05: import java.awt.BorderLayout;
06: import java.io.File;
07: import java.io.IOException;
08: import java.net.MalformedURLException;
09: import javax.swing.BorderFactory;
10: import javax.swing.JEditorPane;
11: import javax.swing.JPanel;
12: import javax.swing.JScrollPane;
13: import org.dbbrowser.ui.UIControllerForQueries;
14:
15: /**
16: * Overview panel in a wizard.
17: * @author Amangat
18: */
19: public class OverviewPanelWizardPanel extends AbstractWizardPanel {
20: private static final long serialVersionUID = UIControllerForQueries.version;
21: private static final String PANEL_TITLE = InternationalizationManager
22: .getInstance().getMessage("dbbrowser-export-wizard",
23: "dbbrowser-ui-export-wizard-overview-panel-title",
24: null);;
25:
26: /**
27: * Constructer
28: */
29: public OverviewPanelWizardPanel() {
30: super (PANEL_TITLE);
31: this .add(setupPanel(), BorderLayout.CENTER);
32: }
33:
34: private JPanel setupPanel() {
35: JPanel panel = new JPanel();
36: panel.setBorder(BorderFactory.createEtchedBorder());
37: JEditorPane editorPane = null;
38:
39: String locationOfOverviewHTMLFile = PropertyManager
40: .getInstance()
41: .getProperty(
42: "dbbrowser-export-wizard-overview-html-file-location");
43: try {
44: //Set the page on a JEditorPane - this can be an HTML page
45: editorPane = new JEditorPane((new File(
46: locationOfOverviewHTMLFile)).toURL());
47: editorPane.setEditable(false);
48: } catch (MalformedURLException exc) {
49: editorPane.setText(exc.getMessage());
50: } catch (IOException exc) {
51: editorPane.setText(exc.getMessage());
52: }
53:
54: //Add to panel
55: JScrollPane pane = new JScrollPane(editorPane);
56: panel.setLayout(new BorderLayout());
57: panel.add(pane, BorderLayout.CENTER);
58:
59: return panel;
60: }
61: }
|