LowerTabbedView.java
01 /* This file is part of the project "Hilbert II" - http://www.qedeq.org
02  *
03  * Copyright 2000-2013,  Michael Meyling <mime@qedeq.org>.
04  *
05  * "Hilbert II" is free software; you can redistribute
06  * it and/or modify it under the terms of the GNU General Public
07  * License as published by the Free Software Foundation; either
08  * version 2 of the License, or (at your option) any later version.
09  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  */
15 
16 package org.qedeq.gui.se.main;
17 
18 import java.awt.GridLayout;
19 
20 import javax.swing.BorderFactory;
21 import javax.swing.JPanel;
22 import javax.swing.JTabbedPane;
23 
24 import org.qedeq.base.trace.Trace;
25 import org.qedeq.gui.se.control.SelectionListenerList;
26 import org.qedeq.gui.se.pane.LogPane;
27 import org.qedeq.gui.se.pane.ModuleErrorAndWarningListPane;
28 import org.qedeq.kernel.bo.common.QedeqBo;
29 import org.qedeq.kernel.bo.log.ModuleEventLog;
30 import org.qedeq.kernel.bo.log.QedeqLog;
31 
32 
33 /**
34  * Lower tabbed pane view.
35  *
36  @version $Revision: 1.7 $
37  @author  Michael Meyling
38  */
39 public final class LowerTabbedView extends JPanel {
40 
41     /** This class. */
42     private static final Class CLASS = LowerTabbedView.class;
43 
44     /** Holds all panes. */
45     private JTabbedPane tabbedPane = new JTabbedPane();
46 
47     /** Global logging events. */
48     private LogPane logPane;
49 
50     /** Selected module specific errors. */
51     private ModuleErrorAndWarningListPane errorListPane;
52 
53     /** Selected module has this properties. */
54     private QedeqBo prop;
55 
56     /**
57      * Constructor.
58      *
59      @param   listener    Listener that gets selection events.
60      */
61     public LowerTabbedView(final SelectionListenerList listener) {
62         try {
63             logPane = new LogPane();
64             QedeqLog.getInstance().addLog(logPane);
65 
66             errorListPane = new ModuleErrorAndWarningListPane(listener);
67             ModuleEventLog.getInstance().addLog(errorListPane);
68 
69             tabbedPane.putClientProperty("jgoodies.noContentBorder", Boolean.TRUE);
70 
71 //            tabbedPane.add(Factory.createStrippedScrollPane(logPane), "Log");
72             tabbedPane.add(logPane, "Log");
73             tabbedPane.add(errorListPane, "Errors");
74         catch (RuntimeException e) {
75             Trace.trace(CLASS, this, "constructor", e);
76             throw e;
77         }
78         add(tabbedPane);
79         setLayout(new GridLayout(11));
80         setBorder(BorderFactory.createEmptyBorder(0000));
81     }
82 
83     public void setQedeqModel(final QedeqBo model) {
84         prop = model;
85         errorListPane.setModel(model);
86     }
87 
88     public QedeqBo getQedeqModel() {
89         return prop;
90     }
91 
92 }