This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 200691
Collapse All | Expand All

(-)a/java.j2seproject/apichanges.xml (+18 lines)
Lines 109-114 Link Here
109
109
110
        <change>
110
        <change>
111
            <api name="jseprojects"/>
111
            <api name="jseprojects"/>
112
            <summary>Enable correct handling of properties in Project Property dialog of an extension of JSE Project</summary>
113
            <version major="1" minor="46"/>
114
            <date day="5" month="8" year="2011"/>
115
            <author login="psomol"/>
116
            <compatibility addition="yes"/>
117
            <description>
118
                Added interface <code>J2SECustomPropertySaver</code> with method <code>save()</code>
119
                to enable correct saving of properties added by JSE Project extending modules.
120
                If a JSE Project extending module adds/modifies panels in Project Property
121
                panels, then a mechanism is needed to ensure that all user-modified properties
122
                are correctly stored in project.properties and private.properties when OK pressed.
123
            </description>
124
            <class package="org.netbeans.modules.java.j2seproject.api" name="J2SECustomPropertySaver"/>
125
            <issue number="200691"/>
126
        </change>
127
128
        <change>
129
            <api name="jseprojects"/>
112
            <summary>Added class for accessing PropertyEvaluator for given JSE Project</summary>
130
            <summary>Added class for accessing PropertyEvaluator for given JSE Project</summary>
113
            <version major="1" minor="10"/>
131
            <version major="1" minor="10"/>
114
            <date day="4" month="1" year="2007"/>
132
            <date day="4" month="1" year="2007"/>
(-)a/java.j2seproject/manifest.mf (-1 / +1 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.java.j2seproject/1
2
OpenIDE-Module: org.netbeans.modules.java.j2seproject/1
3
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seproject/ui/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/java/j2seproject/ui/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seproject/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/j2seproject/Bundle.properties
5
OpenIDE-Module-Implementation-Version: 45
5
OpenIDE-Module-Implementation-Version: 46
6
AutoUpdate-Show-In-Client: false
6
AutoUpdate-Show-In-Client: false
7
7
(-)a/java.j2seproject/nbproject/project.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
javac.compilerargs=-Xlint -Xlint:-serial
43
javac.compilerargs=-Xlint -Xlint:-serial
44
javac.source=1.6
44
javac.source=1.6
45
spec.version.base=1.45.0
45
spec.version.base=1.46.0
46
46
47
javadoc.arch=${basedir}/arch.xml
47
javadoc.arch=${basedir}/arch.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
48
javadoc.apichanges=${basedir}/apichanges.xml
(-)98d245ff51ae (+60 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common Development and
11
 * Distribution License("CDDL") (collectively, the "License"). You may not use
12
 * this file except in compliance with the License. You can obtain a copy of
13
 * the License at http://www.netbeans.org/cddl-gplv2.html or
14
 * nbbuild/licenses/CDDL-GPL-2-CP. See the License for the specific language
15
 * governing permissions and limitations under the License. When distributing
16
 * the software, include this License Header Notice in each file and include
17
 * the License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
18
 * particular file as subject to the "Classpath" exception as provided by
19
 * Oracle in the GPL Version 2 section of the License file that accompanied
20
 * this code. If applicable, add the following below the License Header, with
21
 * the fields enclosed by brackets [] replaced by your own identifying
22
 * information: "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL or
25
 * only the GPL Version 2, indicate your decision by adding "[Contributor]
26
 * elects to include this software in this distribution under the [CDDL or GPL
27
 * Version 2] license." If you do not indicate a single choice of license, a
28
 * recipient has the option to distribute your version of this file under
29
 * either the CDDL, the GPL Version 2 or to extend the choice of license to its
30
 * licensees as provided above. However, if you add GPL Version 2 code and
31
 * therefore, elected the GPL Version 2 license, then the option applies only
32
 * if the new code is made subject to such option by the copyright holder.
33
 *
34
 * Contributor(s):
35
 *
36
 * Portions Copyrighted 2011 Sun Microsystems, Inc.
37
 */
38
package org.netbeans.modules.java.j2seproject.api;
39
40
/**
41
 * Property saver to be implemented by J2SE Project extension modules
42
 * that introduce new project properties. Registered savers are
43
 * used to save extended propertes in addition to standard J2SE Project properties
44
 * if modified by user in Project Properties dialog.
45
 * Implementation of the interface should be registered using {@link org.netbeans.spi.project.ProjectServiceProvider}.
46
 * 
47
 * @author Petr Somol
48
 * @since 1.46
49
 */
50
public interface J2SECustomPropertySaver {
51
52
    /**
53
     * Method is called when OK is pressed in JSE Project Properties dialog
54
     * and properties supplied by JSE Project extension module 
55
     * (thus not handled by JSE Project itself)
56
     * need to be stored in project.properties and private.properties.
57
     */
58
    void save();
59
60
}
(-)a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/ui/customizer/CustomizerProviderImpl.java (-3 / +8 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.modules.java.j2seproject.ui.customizer;
45
package org.netbeans.modules.java.j2seproject.ui.customizer;
46
46
47
import org.netbeans.modules.java.j2seproject.api.J2SECustomPropertySaver;
47
import java.awt.Component;
48
import java.awt.Component;
48
import java.awt.Cursor;
49
import java.awt.Cursor;
49
import java.awt.Dialog;
50
import java.awt.Dialog;
Lines 124-130 Link Here
124
            });
125
            });
125
126
126
            OptionListener listener = new OptionListener( project, uiProperties );
127
            OptionListener listener = new OptionListener( project, uiProperties );
127
            StoreListener storeListener = new StoreListener(uiProperties);
128
            StoreListener storeListener = new StoreListener( project, uiProperties );
128
            dialog = ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, preselectedCategory, listener, storeListener, null);
129
            dialog = ProjectCustomizer.createCustomizerDialog(CUSTOMIZER_FOLDER_PATH, context, preselectedCategory, listener, storeListener, null);
129
            dialog.addWindowListener( listener );
130
            dialog.addWindowListener( listener );
130
            dialog.setTitle( MessageFormat.format(                 
131
            dialog.setTitle( MessageFormat.format(                 
Lines 155-170 Link Here
155
156
156
    private class StoreListener implements ActionListener {
157
    private class StoreListener implements ActionListener {
157
    
158
    
159
        private Project project;
158
        private J2SEProjectProperties uiProperties;
160
        private J2SEProjectProperties uiProperties;
159
        
161
        
160
        StoreListener(J2SEProjectProperties uiProperties ) {
162
        StoreListener(Project project, J2SEProjectProperties uiProperties ) {
163
            this.project = project;
161
            this.uiProperties = uiProperties;
164
            this.uiProperties = uiProperties;
162
        }
165
        }
163
        
166
        
164
        public void actionPerformed(ActionEvent e) {
167
        public void actionPerformed(ActionEvent e) {
165
            uiProperties.save();
168
            uiProperties.save();
169
            for (J2SECustomPropertySaver saver : project.getLookup().lookupAll(J2SECustomPropertySaver.class)) {
170
                saver.save();
171
            }
166
        }
172
        }
167
        
168
    }
173
    }
169
    
174
    
170
    /** Listens to the actions on the Customizer's option buttons */
175
    /** Listens to the actions on the Customizer's option buttons */

Return to bug 200691