svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / test / java / org / gvsig / app / panelGroup / Test2TabbedPanel.java @ 40558
History | View | Annotate | Download (2.76 KB)
1 | 40558 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40558 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | 40435 | jjdelcerro | *
|
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40558 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | 40558 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | package org.gvsig.app.panelGroup; |
||
25 | |||
26 | import javax.swing.JFrame; |
||
27 | |||
28 | import org.gvsig.gui.beans.panelGroup.PanelGroupManager; |
||
29 | import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel; |
||
30 | import org.gvsig.tools.exception.BaseException; |
||
31 | |||
32 | import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint; |
||
33 | import org.gvsig.app.panelGroup.samples.Samples_ExtensionPointsOfIPanels; |
||
34 | |||
35 | /**
|
||
36 | * <p>Tests the creation of a {@link TabbedPanel TabbedPanel} object using {@link PanelGroupLoaderFromExtensionPoint PanelGroupLoaderFromExtensionPoint} .</p>
|
||
37 | *
|
||
38 | * @version 16/10/2007
|
||
39 | * @author Pablo Piqueras Bartolom? (pablo.piqueras@iver.es)
|
||
40 | */
|
||
41 | public class Test2TabbedPanel { |
||
42 | /**
|
||
43 | * <p>Test method for the Test2TabbedPanel.</p>
|
||
44 | *
|
||
45 | * @param args optional arguments
|
||
46 | */
|
||
47 | public static void main(String[] args) { |
||
48 | try {
|
||
49 | Samples_ExtensionPointsOfIPanels.loadSample(); |
||
50 | |||
51 | PanelGroupManager manager = PanelGroupManager.getManager(); |
||
52 | manager.registerPanelGroup(TabbedPanel.class); |
||
53 | manager.setDefaultType(TabbedPanel.class); |
||
54 | |||
55 | TabbedPanel panelGroup = (TabbedPanel) manager.getPanelGroup(Samples_ExtensionPointsOfIPanels.REFERENCE2); |
||
56 | PanelGroupLoaderFromExtensionPoint loader = new PanelGroupLoaderFromExtensionPoint(Samples_ExtensionPointsOfIPanels.EXTENSIONPOINT2_NAME);
|
||
57 | |||
58 | // Begin: Test the normal load
|
||
59 | panelGroup.loadPanels(loader); |
||
60 | // End: Test the normal load
|
||
61 | |||
62 | // Objects creation
|
||
63 | JFrame jFrame = new JFrame(); |
||
64 | jFrame.setTitle("Test TabbedPanel using PanelGroupLoaderFromExtensionPoint");
|
||
65 | jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||
66 | jFrame.setSize(panelGroup.getPreferredSize()); |
||
67 | jFrame.getContentPane().add(panelGroup); |
||
68 | |||
69 | jFrame.setVisible(true);
|
||
70 | |||
71 | } catch (BaseException bE) {
|
||
72 | System.out.println(bE.getLocalizedMessageStack());
|
||
73 | } catch (Exception e) { |
||
74 | e.printStackTrace(); |
||
75 | } |
||
76 | } |
||
77 | } |