Statistics
| Revision:

root / branches / v10 / extensions / extPublish / src / com / iver / cit / gvsig / publish / gui / NewPublicationControlsPanel.java @ 13570

History | View | Annotate | Download (2.89 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004-2006 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
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
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *   Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Iba?ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *   +34 963862235
28
 *   gvsig@gva.es
29
 *   www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41
package com.iver.cit.gvsig.publish.gui;
42

    
43
import java.awt.Dimension;
44
import java.awt.FlowLayout;
45
import java.awt.event.ActionListener;
46

    
47
import javax.swing.JButton;
48
import javax.swing.JPanel;
49

    
50
import com.iver.andami.PluginServices;
51
import com.iver.cit.gvsig.publish.gui.control.NewPublicationController;
52

    
53
public class NewPublicationControlsPanel extends JPanel{
54
        
55
        /**
56
         * Components
57
         */
58
        private JButton acceptButton = null;
59
        private JButton cancelButton = null;
60
        
61
        public NewPublicationControlsPanel(){
62
                super();
63
                initialize();
64
        }
65
        
66
        public void setListener(ActionListener listener){
67
                this.getAcceptButton().addActionListener(listener);
68
                this.getCancelButton().addActionListener(listener);
69
        }
70
        
71
        private void initialize(){
72
                FlowLayout flowLayout = new FlowLayout();
73
                flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
74
                this.setPreferredSize(new java.awt.Dimension(250,50));
75
                this.setLayout(flowLayout);
76
                this.add(getAcceptButton(), null);
77
                this.add(getCancelButton(), null);
78
        }
79

    
80
        private JButton getCancelButton() {
81
                if (this.cancelButton == null) {
82
                        this.cancelButton = new JButton();
83
                        this.cancelButton.setText(PluginServices.getText(this, "cancel_new_server"));
84
                        this.cancelButton.setPreferredSize(new Dimension(100,30));
85
                        this.cancelButton.setActionCommand(NewPublicationController.NEWSERVER_EVENT_CANCEL);
86
                }
87
                return cancelButton;
88
        }
89

    
90
        private JButton getAcceptButton() {
91
                if (this.acceptButton == null) {
92
                        this.acceptButton = new JButton();
93
                        this.acceptButton.setText(PluginServices.getText(this, "accept_new_server"));
94
                        this.acceptButton.setPreferredSize(new Dimension(100,30));
95
                        this.acceptButton.setActionCommand(NewPublicationController.NEWSERVER_EVENT_ACCEPT);
96
                }
97
                return acceptButton;
98
        }
99

    
100

    
101
}