KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > editor > hints > options > AdvancedHintsPanel


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 package org.netbeans.modules.editor.hints.options;
20 import java.beans.PropertyChangeListener JavaDoc;
21 import java.beans.PropertyChangeSupport JavaDoc;
22 import javax.swing.JComponent JavaDoc;
23 import org.netbeans.spi.options.OptionsPanelController;
24 import org.openide.util.HelpCtx;
25 import org.openide.util.Lookup;
26
27 /**
28  *
29  * @author Jan Lahoda
30  */

31 public class AdvancedHintsPanel extends OptionsPanelController {
32
33     private JComponent JavaDoc component;
34     private ModelImpl model;
35     private PropertyChangeSupport JavaDoc pcs;
36
37     /** Creates a new instance of AdvancedHintsPanel */
38  public AdvancedHintsPanel() {
39     model = new ModelImpl(this);
40     pcs = new PropertyChangeSupport JavaDoc(this);
41     }
42
43     public void update() {
44     //what is this supposed to do?
45
}
46
47     public synchronized void applyChanges() {
48     model.commit();
49     }
50
51     public synchronized void cancel() {
52     model.rollBack();
53     }
54
55     public boolean isValid() {
56         return true;
57     }
58
59     public synchronized boolean isChanged() {
60     return model.isModified();
61     }
62     
63     public synchronized JComponent JavaDoc getComponent(Lookup ignored) {
64         if (component == null) {
65             component = new AdvancedPanelImpl(model);
66         }
67         
68         return component;
69     }
70
71     public HelpCtx getHelpCtx() {
72         return HelpCtx.DEFAULT_HELP;
73     }
74
75     public void addPropertyChangeListener(PropertyChangeListener JavaDoc l) {
76     pcs.addPropertyChangeListener(l);
77     }
78
79     public void removePropertyChangeListener(PropertyChangeListener JavaDoc l) {
80     pcs.removePropertyChangeListener(l);
81     }
82     
83     void firePropertyChange(String JavaDoc name, Object JavaDoc old, Object JavaDoc nue) {
84     pcs.firePropertyChange(name, old, nue);
85     }
86     
87 }
88
Popular Tags