Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extPublish / src / org / gvsig / publish / gui / properties / rsync / RsyncPropertiesWindow.java @ 32205

History | View | Annotate | Download (3.46 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 org.gvsig.publish.gui.properties.rsync;
42

    
43

    
44
import org.gvsig.publish.serversmodel.Publication;
45

    
46
import com.iver.andami.PluginServices;
47
import com.iver.andami.ui.mdiManager.IWindow;
48
import com.iver.andami.ui.mdiManager.WindowInfo;
49
/**
50
 * gvSIG window for rsync parameters
51
 * @author jvhigon
52
 *
53
 */
54
public class RsyncPropertiesWindow extends RsyncPropertiesPanel implements IWindow{
55
        /**
56
         * 
57
         */
58
        private static final long serialVersionUID = 3443166352499186502L;
59
        private WindowInfo mWindowInfo = null;
60
        private RsyncPropertiesPanelHandler handler = null;
61
        /**
62
         * Initializes the window with a publication a sets an event handler
63
         * @param p
64
         */
65
        public RsyncPropertiesWindow(Publication p) {
66
                //initialize variables
67
                getUserField().setText(p.getUser());
68
                getPasswordField().setText(p.getPassword());
69
                if (p.getDstDir() == null){
70
                        getDstDirTextField().setText("$HOME/.gvSIG-publish");
71
                }else{
72
                        String aux = p.getDstDir().replaceFirst("$HOME","/home/"+ p.getUser());
73
                        getDstDirTextField().setText(aux);
74
                }
75
                //set listener
76
                handler = new RsyncPropertiesPanelHandler(p, this);
77
                getAcceptButton().addActionListener(handler);
78
                getAcceptButton().setActionCommand(RsyncPropertiesPanelHandler.ACCEPT_COMMAND);
79
                getCancelButton().addActionListener(handler);
80
                getCancelButton().setActionCommand(RsyncPropertiesPanelHandler.CANCEL_COMMAND);
81
        }
82
        /*
83
         * (non-Javadoc)
84
         * @see com.iver.andami.ui.mdiManager.IWindow#getWindowInfo()
85
         */
86
        public WindowInfo getWindowInfo() {
87
                if (mWindowInfo == null){
88
                        //mWindowInfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
89
                        mWindowInfo=new WindowInfo(WindowInfo.MODALDIALOG | WindowInfo.RESIZABLE);
90
                        mWindowInfo.setTitle(PluginServices.getText(this,"publish_rsync_params"));
91
                        mWindowInfo.setHeight(150);
92
                        mWindowInfo.setWidth(250);
93
        }
94
        return mWindowInfo;
95
        }
96
        /**
97
         * closes the window using the gvSIG MDI manager
98
         */
99
        public void closeWindow(){
100
                PluginServices.getMDIManager().closeWindow(this);
101
        }
102
        /*
103
         * (non-Javadoc)
104
         * @see com.iver.andami.ui.mdiManager.IWindow#getWindowProfile()
105
         */
106
        public Object getWindowProfile() {
107
                return WindowInfo.PROPERTIES_PROFILE;
108
        }
109
        /**
110
         * shows the window using the gvSIG MDI manager
111
         */
112
        public void showWindow(){
113
                PluginServices.getMDIManager().addCentredWindow(this);
114
        }
115

    
116
}