KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > module > AntPanelController


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.apache.tools.ant.module;
21
22 import java.beans.PropertyChangeListener JavaDoc;
23 import javax.swing.JComponent JavaDoc;
24 import org.netbeans.spi.options.OptionsPanelController;
25 import org.openide.util.HelpCtx;
26 import org.openide.util.Lookup;
27
28 /**
29  * Implementation of one panel in Options Dialog.
30  *
31  * @author Jan Jancura
32  */

33 public final class AntPanelController extends OptionsPanelController {
34
35     @Override JavaDoc
36     public void update () {
37         getAntCustomizer ().update ();
38     }
39
40     @Override JavaDoc
41     public void applyChanges () {
42         getAntCustomizer ().applyChanges ();
43     }
44     
45     @Override JavaDoc
46     public void cancel () {
47         getAntCustomizer ().cancel ();
48     }
49     
50     @Override JavaDoc
51     public boolean isValid () {
52         return getAntCustomizer ().dataValid ();
53     }
54     
55     @Override JavaDoc
56     public boolean isChanged () {
57         return getAntCustomizer ().isChanged ();
58     }
59     
60     @Override JavaDoc
61     public HelpCtx getHelpCtx () {
62         return new HelpCtx ("netbeans.optionsDialog.advanced.ant");
63     }
64     
65     @Override JavaDoc
66     public JComponent JavaDoc getComponent (Lookup lookup) {
67         return getAntCustomizer ();
68     }
69
70     @Override JavaDoc
71     public void addPropertyChangeListener (PropertyChangeListener JavaDoc l) {
72         getAntCustomizer ().addPropertyChangeListener (l);
73     }
74
75     @Override JavaDoc
76     public void removePropertyChangeListener (PropertyChangeListener JavaDoc l) {
77         getAntCustomizer ().removePropertyChangeListener (l);
78     }
79
80     
81     private AntCustomizer antCustomizer;
82     
83     private AntCustomizer getAntCustomizer () {
84         if (antCustomizer == null)
85             antCustomizer = new AntCustomizer ();
86         return antCustomizer;
87     }
88 }
89
Popular Tags