summaryrefslogtreecommitdiff
path: root/java/source/org/openoffice/ide/eclipse/java/export/JavaExportPageControl.java
blob: 1bcee19b35d43dba5cc528253d9fef3b5cf69f4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*************************************************************************
 *
 * This library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as 
 * published by the Free Software Foundation, either version 3 of 
 * the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program. 
 * If not, see <http://www.gnu.org/licenses/>.
 * 
 * Copyright: 2010 by Cédric Bosdonnat
 *
 * All Rights Reserved.
 * 
 ************************************************************************/
package org.openoffice.ide.eclipse.java.export;

/**
 * Controller object for the fields of the {@link JavaExportPart} view.
 * 
 * @author Cédric Bosdonnat
 *
 */
public class JavaExportPageControl {

    public static final String DEFAULT_ANT_FILENAME = "build.xml"; //$NON-NLS-1$
    
    private boolean mSaveAntScript;
    private String mSavePath;
    
    private boolean mSavePathEnabled;
    
    /**
     * Default constructor.
     */
    public JavaExportPageControl() {
        setSaveAntScript( false );
        setSavePath( DEFAULT_ANT_FILENAME );
    }
    
    /** 
     * @param pSave the state of the save ant script box.
     */
    public void setSaveAntScript( boolean pSave ) {
        mSaveAntScript = pSave;
        
        // Don't activate the path field unless the save is selected
        mSavePathEnabled = pSave;
    }
    
    /**
     * @param pPath the path to set in the save field
     */
    public void setSavePath( String pPath ) {
        mSavePath = pPath;
    }
    
    /**
     * @return the state of the save ant script box
     */
    public boolean getSaveAntScript( ) {
        return mSaveAntScript;
    }
    
    /** 
     * @return the value of the save path text field
     */
    public String getSavePath( ) {
        return mSavePath;
    }
    
    /**
     * @return whether the save path field is enabled
     */
    public boolean isSavePathEnabled( ) {
        return mSavePathEnabled;
    }
}