EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivegui.dialog]

COVERAGE SUMMARY FOR SOURCE FILE [AbstractTabbedDialogPanel.java]

nameclass, %method, %block, %line, %
AbstractTabbedDialogPanel.java0%   (0/1)0%   (0/6)0%   (0/163)0%   (0/42)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractTabbedDialogPanel0%   (0/1)0%   (0/6)0%   (0/163)0%   (0/42)
AbstractTabbedDialogPanel (String): void 0%   (0/1)0%   (0/72)0%   (0/17)
acceptAllTabs (): void 0%   (0/1)0%   (0/15)0%   (0/4)
addTabPane (DialogTabPanel): void 0%   (0/1)0%   (0/12)0%   (0/3)
canClose (): boolean 0%   (0/1)0%   (0/19)0%   (0/5)
initLayout (): void 0%   (0/1)0%   (0/30)0%   (0/9)
reset (): void 0%   (0/1)0%   (0/15)0%   (0/4)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hivegui.dialog;
16 
17import java.awt.GridBagConstraints;
18import java.awt.GridBagLayout;
19import java.awt.Insets;
20import java.util.ArrayList;
21import java.util.List;
22 
23import javax.swing.JTabbedPane;
24 
25abstract public class AbstractTabbedDialogPanel extends AbstractDialogPanel
26{
27        protected AbstractTabbedDialogPanel(String id)
28        {
29                super(id);
30                _tabbedPane.setName(id + "-tabs");
31                setLayout(new GridBagLayout());
32                GridBagConstraints constraints = new GridBagConstraints();
33                constraints.gridx = 0;
34                constraints.gridy = 0;
35                constraints.gridwidth = 1;
36                constraints.gridheight = 1;
37                constraints.anchor = GridBagConstraints.NORTHWEST;
38                constraints.fill = GridBagConstraints.BOTH;
39                constraints.weightx = 1.0;
40                constraints.weighty = 1.0;
41                constraints.insets = new Insets(INSETS, INSETS, INSETS, INSETS);
42                add(_tabbedPane, constraints);
43        }
44        
45        @Override protected void initLayout()
46        {
47                int index = 0;
48                for (DialogTabPanel tab: _tabs)
49                {
50                        tab.setContext(_context);
51                        String title = tab.getDialogTitle();
52                        if (title != null)
53                        {
54                                _tabbedPane.setTitleAt(index, title);
55                        }
56                        index++;
57                }
58        }
59 
60        final protected void acceptAllTabs()
61        {
62                for (DialogTabPanel tab: _tabs)
63                {
64                        tab.accept();
65                }
66        }
67        
68        @Override public void reset()
69        {
70                for (DialogTabPanel panel: _tabs)
71                {
72                        panel.reset();
73                }
74        }
75 
76        @Override public boolean canClose()
77        {
78                for (DialogTabPanel panel: _tabs)
79                {
80                        if (!panel.canClose())
81                        {
82                                return false;
83                        }
84                }
85                return true;
86        }
87        
88        final public void addTabPane(DialogTabPanel tabPane)
89        {
90                _tabs.add(tabPane);
91                _tabbedPane.add(tabPane.getPanel());
92        }
93        
94        static final private int                INSETS = 4;
95        protected JTabbedPane                        _tabbedPane = new JTabbedPane();
96        protected List<DialogTabPanel>        _tabs = new ArrayList<DialogTabPanel>();        
97}

[all classes][net.sourceforge.hivegui.dialog]
EMMA 2.0.5312 (C) Vladimir Roubtsov