diff options
Diffstat (limited to 'src/cppcheckplus/tab/MyTabPage.java')
-rw-r--r-- | src/cppcheckplus/tab/MyTabPage.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cppcheckplus/tab/MyTabPage.java b/src/cppcheckplus/tab/MyTabPage.java new file mode 100644 index 0000000..ef26580 --- /dev/null +++ b/src/cppcheckplus/tab/MyTabPage.java | |||
@@ -0,0 +1,46 @@ | |||
1 | |||
2 | package cppcheckplus.tab; | ||
3 | |||
4 | import java.awt.BorderLayout; | ||
5 | import javax.swing.JComponent; | ||
6 | import javax.swing.JPanel; | ||
7 | |||
8 | import cppcheckplus.toolbar.MyToolBar; | ||
9 | |||
10 | |||
11 | public class MyTabPage extends JPanel | ||
12 | { | ||
13 | private MyToolBar toolbar; | ||
14 | private JPanel centerPane; | ||
15 | |||
16 | public MyTabPage() | ||
17 | { | ||
18 | this(null); | ||
19 | } | ||
20 | |||
21 | public MyTabPage(JComponent contentComponent) | ||
22 | { | ||
23 | toolbar = new MyToolBar(); | ||
24 | centerPane = new JPanel(new BorderLayout()); | ||
25 | init(contentComponent); | ||
26 | } | ||
27 | |||
28 | private void init(JComponent contentComponent) | ||
29 | { | ||
30 | setLayout(new BorderLayout()); | ||
31 | add(toolbar, "North"); | ||
32 | add(centerPane, "Center"); | ||
33 | if (contentComponent != null) | ||
34 | centerPane.add(contentComponent, "Center"); | ||
35 | } | ||
36 | |||
37 | public JPanel getCenterPane() | ||
38 | { | ||
39 | return centerPane; | ||
40 | } | ||
41 | |||
42 | public MyToolBar getToolBar() | ||
43 | { | ||
44 | return toolbar; | ||
45 | } | ||
46 | } | ||