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 49652
Collapse All | Expand All

(-)projects/projectapi/apichanges.xml (+19 lines)
Lines 75-80 Link Here
75
    <!-- ACTUAL CHANGES BEGIN HERE: -->
75
    <!-- ACTUAL CHANGES BEGIN HERE: -->
76
76
77
    <changes>
77
    <changes>
78
        
79
        <change id="ProjectConfigurationProvider">
80
            <api name="general"/>
81
            <summary>Added support for project configurations</summary>
82
            <version major="1" minor="11"/>
83
            <date day="22" month="6" year="2006"/>
84
            <author login="jglick"/>
85
            <compatibility addition="yes"/>
86
            <description>
87
                <p>
88
                    Added an interface <code>ProjectConfigurationProvider</code>
89
                    which can be included in a project's lookup to support
90
                    switchable configurations / profiles.
91
                </p>
92
            </description>
93
            <class package="org.netbeans.spi.project" name="ProjectConfiguration"/>
94
            <class package="org.netbeans.spi.project" name="ProjectConfigurationProvider"/>
95
            <issue number="49652"/>
96
        </change>
78
97
79
        <change id="copy-move-support">
98
        <change id="copy-move-support">
80
            <api name="general"/>
99
            <api name="general"/>
(-)projects/projectapi/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.projectapi/1
2
OpenIDE-Module: org.netbeans.modules.projectapi/1
3
OpenIDE-Module-Specification-Version: 1.10
3
OpenIDE-Module-Specification-Version: 1.11
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties
5
5
(-)projects/projectapi/src/org/netbeans/api/project/Project.java (+1 lines)
Lines 68-73 Link Here
68
     * </ol>
68
     * </ol>
69
     * <p>You might also have e.g.:</p>
69
     * <p>You might also have e.g.:</p>
70
     * <ol>
70
     * <ol>
71
     * <li>{@link org.netbeans.spi.project.ProjectConfigurationProvider}</li>
71
     * <li>{@link org.netbeans.spi.queries.FileBuiltQueryImplementation}</li>
72
     * <li>{@link org.netbeans.spi.queries.FileBuiltQueryImplementation}</li>
72
     * <li>{@link org.netbeans.spi.queries.SharabilityQueryImplementation}</li>
73
     * <li>{@link org.netbeans.spi.queries.SharabilityQueryImplementation}</li>
73
     * <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/ProjectOpenedHook.html"><code>ProjectOpenedHook</code></a></li>
74
     * <li><a href="@org-netbeans-modules-projectuiapi@/org/netbeans/spi/project/ui/ProjectOpenedHook.html"><code>ProjectOpenedHook</code></a></li>
(-)projects/projectapi/src/org/netbeans/spi/project/ProjectConfiguration.java (+32 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.spi.project;
15
16
/**
17
 * Represents one user-selectable configuration of a particular project.
18
 * For example, it might represent a choice of main class and arguments.
19
 * Besides the implementor, only the project UI infrastructure is expected to use this class.
20
 *
21
 * @author Adam Sotona, Jesse Glick
22
 * @since org.netbeans.modules.projectapi/1 1.11
23
 */
24
public interface ProjectConfiguration {
25
26
    /**
27
     * Provides a display name by which this configuration may be identified in the GUI.
28
     * @return a human-visible display name
29
     */
30
    String getDisplayName();
31
32
}
(-)projects/projectapi/src/org/netbeans/spi/project/ProjectConfigurationProvider.java (+92 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.spi.project;
15
16
import java.beans.PropertyChangeListener;
17
import java.io.IOException;
18
import java.util.Collection;
19
20
/**
21
 * Provider of configurations for a project.
22
 * Should be registered in a project's {@link org.netbeans.api.project.Project#getLookup lookup}.
23
 * Besides the implementor, only the project UI infrastructure is expected to use this class.
24
 *
25
 * @author Adam Sotona, Jesse Glick
26
 * @since org.netbeans.modules.projectapi/1 1.11
27
 */
28
public interface ProjectConfigurationProvider {
29
30
    /**
31
     * Property name for the active configuration.
32
     * Use it when firing a change in the active configuration.
33
     */
34
    String PROP_CONFIGURATION_ACTIVE = "activeConfiguration"; // NOI18N
35
36
    /**
37
     * Property name of the set of configurations.
38
     * Use it when firing a change in the set of configurations.
39
     */
40
    String PROP_CONFIGURATIONS = "configurations"; // NOI18N
41
42
    /**
43
     * Gets a list of configurations.
44
     * Permitted to return different instances from one invocation to the next
45
     * but it is advisable for the "same" instances to compare as equal.
46
     * @return all available configurations for this project
47
     */
48
    Collection<? extends ProjectConfiguration> getConfigurations();
49
50
    /**
51
     * Gets the currently active configuration.
52
     * @return the active configuration for this project (should be a member of {@link #getConfigurations}, or null only if that is empty)
53
     */
54
    ProjectConfiguration getActiveConfiguration();
55
56
    /**
57
     * Sets the active configuration.
58
     * Should fire a change in {@link #PROP_CONFIGURATION_ACTIVE}.
59
     * It should be true afterwards that <code>configuration.equals(getActiveConfiguration())</code>
60
     * though it might not be true that <code>configuration == getActiveConfiguration()</code>.
61
     * @param configuration new active configuration
62
     * @throws IllegalArgumentException if the requested configuration is not a member of {@link #getConfigurations}
63
     * @throws IOException if storing the configuration change failed
64
     */
65
    void setActiveConfiguration(ProjectConfiguration configuration) throws IllegalArgumentException, IOException;
66
67
    /**
68
     * Checks if this project can provide a GUI customizer for its configurations.
69
     * @return true if {@link #customize} may be called
70
     */
71
    boolean hasCustomizer();
72
73
    /**
74
     * Customize this project's configurations.
75
     * Only permitted if {@link #hasCustomizer} is true.
76
     * May, for example, open the project properties dialog.
77
     */
78
    void customize();
79
80
    /**
81
     * Adds a listener to check for changes in {@link #PROP_CONFIGURATION_ACTIVE} or {@link #PROP_CONFIGURATIONS}.
82
     * @param lst a listener to add
83
     */
84
    void addPropertyChangeListener(PropertyChangeListener lst);
85
86
    /**
87
     * Removes a listener.
88
     * @param lst a listener to remove
89
     */
90
    void removePropertyChangeListener(PropertyChangeListener lst);
91
92
}
(-)projects/projectui/src/org/netbeans/modules/project/ui/actions/Actions.java (+5 lines)
Lines 33-38 Link Here
33
import org.openide.util.Utilities;
33
import org.openide.util.Utilities;
34
import org.openide.util.actions.CallableSystemAction;
34
import org.openide.util.actions.CallableSystemAction;
35
import org.openide.util.actions.NodeAction;
35
import org.openide.util.actions.NodeAction;
36
import org.openide.util.actions.SystemAction;
36
37
37
/** Factory for all kinds of actions used in projectui and
38
/** Factory for all kinds of actions used in projectui and
38
 *projectuiapi.
39
 *projectuiapi.
Lines 347-352 Link Here
347
            new ImageIcon( Utilities.loadImage( "org/netbeans/modules/project/ui/resources/debugProject.gif" ) ) ); //NOI18N
348
            new ImageIcon( Utilities.loadImage( "org/netbeans/modules/project/ui/resources/debugProject.gif" ) ) ); //NOI18N
348
        a.putValue("iconBase","org/netbeans/modules/project/ui/resources/debugProject.gif"); //NOI18N
349
        a.putValue("iconBase","org/netbeans/modules/project/ui/resources/debugProject.gif"); //NOI18N
349
        return a;
350
        return a;
351
    }
352
353
    public Action setProjectConfigurationAction() {
354
        return SystemAction.get(ActiveConfigAction.class);
350
    }
355
    }
351
356
352
}
357
}
(-)projects/projectui/src/org/netbeans/modules/project/ui/actions/ActiveConfigAction.java (+301 lines)
Added Link Here
1
/*
2
 *                 Sun Public License Notice
3
 *
4
 * The contents of this file are subject to the Sun Public License
5
 * Version 1.0 (the "License"). You may not use this file except in
6
 * compliance with the License. A copy of the License is available at
7
 * http://www.sun.com/
8
 *
9
 * The Original Code is NetBeans. The Initial Developer of the Original
10
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11
 * Microsystems, Inc. All Rights Reserved.
12
 */
13
14
package org.netbeans.modules.project.ui.actions;
15
16
import java.awt.Component;
17
import java.awt.Dimension;
18
import java.awt.GridBagConstraints;
19
import java.awt.GridBagLayout;
20
import java.awt.Insets;
21
import java.awt.event.ActionEvent;
22
import java.awt.event.ActionListener;
23
import java.beans.PropertyChangeEvent;
24
import java.beans.PropertyChangeListener;
25
import java.io.IOException;
26
import java.util.Collection;
27
import java.util.logging.Level;
28
import java.util.logging.Logger;
29
import javax.swing.AbstractAction;
30
import javax.swing.Action;
31
import javax.swing.ComboBoxModel;
32
import javax.swing.DefaultComboBoxModel;
33
import javax.swing.DefaultListCellRenderer;
34
import javax.swing.JComboBox;
35
import javax.swing.JComponent;
36
import javax.swing.JList;
37
import javax.swing.JMenu;
38
import javax.swing.JMenuItem;
39
import javax.swing.JPanel;
40
import javax.swing.JRadioButtonMenuItem;
41
import org.netbeans.api.project.Project;
42
import org.netbeans.modules.project.ui.OpenProjectList;
43
import org.netbeans.spi.project.ProjectConfiguration;
44
import org.netbeans.spi.project.ProjectConfigurationProvider;
45
import org.openide.awt.DynamicMenuContent;
46
import org.openide.awt.Mnemonics;
47
import org.openide.util.ContextAwareAction;
48
import org.openide.util.HelpCtx;
49
import org.openide.util.Lookup;
50
import org.openide.util.NbBundle;
51
import org.openide.util.actions.CallableSystemAction;
52
import org.openide.util.actions.Presenter;
53
54
/**
55
 * Action permitting selection of a configuration for the main project.
56
 * @author Greg Crawley, Adam Sotona, Jesse Glick
57
 */
58
public class ActiveConfigAction extends CallableSystemAction implements ContextAwareAction {
59
60
    private static final DefaultComboBoxModel EMPTY_MODEL = new DefaultComboBoxModel();
61
    private static final Object CUSTOMIZE_ENTRY = new Object();
62
63
    private final PropertyChangeListener lst;
64
    private final JComboBox configListCombo;
65
    private boolean listeningToCombo = true;
66
67
    private Project currentProject;
68
    private ProjectConfigurationProvider cp;
69
70
    public ActiveConfigAction() {
71
        super();
72
        putValue("noIconInMenu", Boolean.TRUE); // NOI18N
73
        configListCombo = new JComboBox();
74
        configListCombo.setRenderer(new ConfigCellRenderer());
75
        configListCombo.setToolTipText(org.openide.awt.Actions.cutAmpersand(getName()));
76
        configurationsListChanged(null);
77
        configListCombo.addActionListener(new ActionListener() {
78
            public void actionPerformed(ActionEvent e) {
79
                if (!listeningToCombo) {
80
                    return;
81
                }
82
                Object o = configListCombo.getSelectedItem();
83
                if (o == CUSTOMIZE_ENTRY) {
84
                    activeConfigurationChanged(cp != null ? cp.getActiveConfiguration() : null);
85
                    cp.customize();
86
                } else if (o != null) {
87
                    activeConfigurationSelected((ProjectConfiguration) o);
88
                }
89
            }
90
        });
91
        lst = new PropertyChangeListener() {
92
            public void propertyChange(PropertyChangeEvent evt) {
93
                if (ProjectConfigurationProvider.PROP_CONFIGURATIONS.equals(evt.getPropertyName())) {
94
                    configurationsListChanged(cp.getConfigurations());
95
                } else if (ProjectConfigurationProvider.PROP_CONFIGURATION_ACTIVE.equals(evt.getPropertyName())) {
96
                    activeConfigurationChanged(cp.getActiveConfiguration());
97
                }
98
            }
99
        };
100
        activeProjectChanged(OpenProjectList.getDefault().getMainProject());
101
        OpenProjectList.getDefault().addPropertyChangeListener(new PropertyChangeListener() {
102
            public void propertyChange(PropertyChangeEvent evt) {
103
                if (OpenProjectList.PROPERTY_MAIN_PROJECT.equals(evt.getPropertyName())) {
104
                    activeProjectChanged(OpenProjectList.getDefault().getMainProject());
105
                }
106
            }
107
        });
108
    }
109
110
111
    private synchronized void configurationsListChanged(Collection<? extends ProjectConfiguration> configs) {
112
        if (configs == null) {
113
            configListCombo.setModel(EMPTY_MODEL);
114
            configListCombo.setEnabled(false);
115
        } else {
116
            DefaultComboBoxModel model = new DefaultComboBoxModel(configs.toArray());
117
            if (cp.hasCustomizer()) {
118
                model.addElement(CUSTOMIZE_ENTRY);
119
            }
120
            configListCombo.setModel(model);
121
            configListCombo.setEnabled(true);
122
        }
123
        if (cp != null) {
124
            activeConfigurationChanged(cp.getActiveConfiguration());
125
        }
126
    }
127
128
    private synchronized void activeConfigurationChanged(ProjectConfiguration config) {
129
        listeningToCombo = false;
130
        try {
131
            configListCombo.setSelectedIndex(-1);
132
            if (config != null) {
133
                ComboBoxModel m = configListCombo.getModel();
134
                for (int i = 0; i < m.getSize(); i++) {
135
                    if (config.equals(m.getElementAt(i))) {
136
                        configListCombo.setSelectedIndex(i);
137
                        break;
138
                    }
139
                }
140
            }
141
        } finally {
142
            listeningToCombo = true;
143
        }
144
    }
145
146
    private synchronized void activeConfigurationSelected(ProjectConfiguration cfg) {
147
        if (cp != null && cfg != null && !cfg.equals(cp.getActiveConfiguration())) {
148
            try {
149
                cp.setActiveConfiguration(cfg);
150
            } catch (IOException x) {
151
                Logger.getLogger(ActiveConfigAction.class.getName()).log(Level.WARNING, null, x);
152
            }
153
        }
154
    }
155
156
    public HelpCtx getHelpCtx() {
157
        return new HelpCtx(ActiveConfigAction.class);
158
    }
159
160
    public String getName() {
161
        return NbBundle.getMessage(ActiveConfigAction.class, "ActiveConfigAction.label");
162
    }
163
164
    public void performAction() {
165
        assert false;
166
    }
167
168
    public Component getToolbarPresenter() {
169
        // Do not return combo box directly; looks bad.
170
        JPanel panel = new JPanel(new GridBagLayout());
171
        panel.setOpaque(false); // don't interrupt JToolBar background
172
        panel.setMaximumSize(new Dimension(150, 80));
173
        panel.setMinimumSize(new Dimension(150, 0));
174
        panel.setPreferredSize(new Dimension(150, 23));
175
        // XXX top inset of 2 looks better w/ small toolbar, but 1 seems to look better for large toolbar (the default):
176
        panel.add(configListCombo, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(1, 6, 1, 5), 0, 0));
177
        return panel;
178
    }
179
180
    class ConfigMenu extends JMenu implements DynamicMenuContent {
181
182
        private final Lookup context;
183
184
        public ConfigMenu(Lookup context) {
185
            this.context = context;
186
            if (context != null) {
187
                Mnemonics.setLocalizedText(this, NbBundle.getMessage(ActiveConfigAction.class, "ActiveConfigAction.context.label"));
188
            } else {
189
                Mnemonics.setLocalizedText(this, ActiveConfigAction.this.getName());
190
            }
191
        }
192
193
        public JComponent[] getMenuPresenters() {
194
            removeAll();
195
            final ProjectConfigurationProvider pcp;
196
            if (context != null) {
197
                Collection<? extends Project> projects = context.lookupAll(Project.class);
198
                if (projects.size() == 1) {
199
                    pcp = projects.iterator().next().getLookup().lookup(ProjectConfigurationProvider.class);
200
                } else {
201
                    // No selection, or multiselection.
202
                    pcp = null;
203
                }
204
            } else {
205
                pcp = cp; // global menu item; take from main project
206
            }
207
            if (pcp != null) {
208
                boolean something = false;
209
                ProjectConfiguration activeConfig = pcp.getActiveConfiguration();
210
                for (final ProjectConfiguration config : pcp.getConfigurations()) {
211
                    JRadioButtonMenuItem jmi = new JRadioButtonMenuItem(config.getDisplayName(), config.equals(activeConfig));
212
                    jmi.addActionListener(new ActionListener() {
213
                        public void actionPerformed(ActionEvent e) {
214
                            activeConfigurationSelected(config);
215
                        }
216
                    });
217
                    add(jmi);
218
                    something = true;
219
                }
220
                if (pcp.hasCustomizer()) {
221
                    if (something) {
222
                        addSeparator();
223
                    }
224
                    something = true;
225
                    JMenuItem customize = new JMenuItem();
226
                    Mnemonics.setLocalizedText(customize, NbBundle.getMessage(ActiveConfigAction.class, "ActiveConfigAction.customize"));
227
                    customize.addActionListener(new ActionListener() {
228
                        public void actionPerformed(ActionEvent e) {
229
                            pcp.customize();
230
                        }
231
                    });
232
                    add(customize);
233
                }
234
                setEnabled(something);
235
            } else {
236
                // No configurations supported for this project.
237
                setEnabled(false);
238
                // to hide entirely just use: return new JComponent[0];
239
            }
240
            return new JComponent[] {this};
241
        }
242
243
        public JComponent[] synchMenuPresenters(JComponent[] items) {
244
            // Always rebuild submenu.
245
            // For performance, could try to reuse it if context == null and nothing has changed.
246
            return getMenuPresenters();
247
        }
248
249
    }
250
251
    public JMenuItem getMenuPresenter() {
252
        return new ConfigMenu(null);
253
    }
254
255
    private static class ConfigCellRenderer extends DefaultListCellRenderer {
256
257
        public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
258
            if (value instanceof ProjectConfiguration) {
259
                return super.getListCellRendererComponent(list, ((ProjectConfiguration) value).getDisplayName(), index, isSelected, cellHasFocus);
260
            } else if (value == CUSTOMIZE_ENTRY) {
261
                String label = org.openide.awt.Actions.cutAmpersand(NbBundle.getMessage(ActiveConfigAction.class, "ActiveConfigAction.customize"));
262
                return super.getListCellRendererComponent(list, label, index, isSelected, cellHasFocus);
263
            } else {
264
                assert value == null;
265
                return super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
266
            }
267
        }
268
    }
269
270
    private synchronized void activeProjectChanged(Project p) {
271
        if (currentProject != p) {
272
            if (cp != null) {
273
                cp.removePropertyChangeListener(lst);
274
            }
275
            currentProject = p;
276
            if (currentProject != null) {
277
                cp = currentProject.getLookup().lookup(ProjectConfigurationProvider.class);
278
                if (cp != null) {
279
                    cp.addPropertyChangeListener(lst);
280
                }
281
            } else {
282
                cp = null;
283
            }
284
            configurationsListChanged(cp == null ? null : cp.getConfigurations());
285
286
        }
287
    }
288
289
    public Action createContextAwareInstance(final Lookup actionContext) {
290
        class A extends AbstractAction implements Presenter.Popup {
291
            public void actionPerformed(ActionEvent e) {
292
                assert false;
293
            }
294
            public JMenuItem getPopupPresenter() {
295
                return new ConfigMenu(actionContext);
296
            }
297
        }
298
        return new A();
299
    }
300
301
}
(-)projects/projectui/src/org/netbeans/modules/project/ui/actions/Bundle.properties (+4 lines)
Lines 79-81 Link Here
79
OpenProjectFolderAction.LBL_menu_one=Open Project "{0}"
79
OpenProjectFolderAction.LBL_menu_one=Open Project "{0}"
80
# {0} - project count
80
# {0} - project count
81
OpenProjectFolderAction.LBL_menu_multiple=Open {0} Projects
81
OpenProjectFolderAction.LBL_menu_multiple=Open {0} Projects
82
83
ActiveConfigAction.label=Set Main Project Con&figuration
84
ActiveConfigAction.context.label=Set Configuration
85
ActiveConfigAction.customize=&Customize...
(-)projects/projectui/src/org/netbeans/modules/project/ui/resources/layer.xml (-2 / +16 lines)
Lines 125-130 Link Here
125
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.project.ui.ProjectTabAction.projectsPhysical"/>
125
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.project.ui.ProjectTabAction.projectsPhysical"/>
126
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/project/ui/resources/filesTab.gif"/> 
126
                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/project/ui/resources/filesTab.gif"/> 
127
            </file>
127
            </file>
128
            
129
            <file name="org-netbeans-modules-project-ui-actions-ActiveConfigAction.instance"/>
128
                                                            
130
                                                            
129
        </folder>
131
        </folder>
130
        
132
        
Lines 343-350 Link Here
343
            </file>
345
            </file>
344
            
346
            
345
347
346
            <attr name="org-netbeans-modules-project-ui-RebuildMainProject.shadow/SeparatorMainProject.instance" boolvalue="true"/>                       
348
            <attr name="org-netbeans-modules-project-ui-RebuildMainProject.shadow/org-netbeans-modules-project-ui-actions-ActiveConfigAction.shadow" boolvalue="true"/>
347
            
349
350
            <file name="org-netbeans-modules-project-ui-actions-ActiveConfigAction.shadow">
351
                <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-ActiveConfigAction.instance"/>
352
            </file>
353
354
            <attr name="org-netbeans-modules-project-ui-actions-ActiveConfigAction.shadow/SeparatorMainProject.instance" boolvalue="true"/>
355
348
            <file name="SeparatorMainProject.instance">
356
            <file name="SeparatorMainProject.instance">
349
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
357
                <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
350
            </file>
358
            </file>
Lines 483-488 Link Here
483
        <folder name="Build">            
491
        <folder name="Build">            
484
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.project.ui.Bundle" />
492
            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.project.ui.Bundle" />
485
            
493
            
494
            <file name="org-netbeans-modules-project-ui-actions-ActiveConfigAction.shadow">
495
                <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-actions-ActiveConfigAction.instance"/>
496
            </file>
497
498
            <attr name="org-netbeans-modules-project-ui-actions-ActiveConfigAction.shadow/org-netbeans-modules-project-ui-BuildMainProject.shadow" boolvalue="true"/>
499
486
            <file name="org-netbeans-modules-project-ui-BuildMainProject.shadow">
500
            <file name="org-netbeans-modules-project-ui-BuildMainProject.shadow">
487
                <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-BuildMainProject.instance"/>
501
                <attr name="originalFile" stringvalue="Actions/Project/org-netbeans-modules-project-ui-BuildMainProject.instance"/>
488
            </file>
502
            </file>
(-)projects/projectuiapi/apichanges.xml (+18 lines)
Lines 75-80 Link Here
75
    <!-- ACTUAL CHANGES BEGIN HERE: -->
75
    <!-- ACTUAL CHANGES BEGIN HERE: -->
76
76
77
    <changes>
77
    <changes>
78
        
79
        <change id="CommonProjectActions.setProjectConfigurationAction">
80
            <api name="general"/>
81
            <summary>Added <code>CommonProjectActions.setProjectConfigurationAction</code></summary>
82
            <version major="1" minor="16"/>
83
            <date day="22" month="6" year="2006"/>
84
            <author login="jglick"/>
85
            <compatibility addition="yes"/>
86
            <description>
87
                <p>
88
                    Added method <code>CommonProjectActions.setProjectConfigurationAction()</code>
89
                    to permit projects supporting configurations to include a context menu
90
                    item in their logical view to change the active configuration.
91
                </p>
92
            </description>
93
            <class package="org.netbeans.spi.project.ui.support" name="CommonProjectActions"/>
94
            <issue number="49652"/>
95
        </change>
78
96
79
        <change id="CompositeCategoryProvider">
97
        <change id="CompositeCategoryProvider">
80
            <api name="general"/>
98
            <api name="general"/>
(-)projects/projectuiapi/nbproject/project.properties (-1 / +1 lines)
Lines 9-15 Link Here
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
9
# Code is Sun Microsystems, Inc. Portions Copyright 1997-2005 Sun
10
# Microsystems, Inc. All Rights Reserved.
10
# Microsystems, Inc. All Rights Reserved.
11
11
12
spec.version.base=1.15.0
12
spec.version.base=1.16.0
13
is.autoload=true
13
is.autoload=true
14
javadoc.title=Project UI API
14
javadoc.title=Project UI API
15
javadoc.arch=${basedir}/arch.xml
15
javadoc.arch=${basedir}/arch.xml
(-)projects/projectuiapi/src/org/netbeans/modules/project/uiapi/ActionsFactory.java (+2 lines)
Lines 60-64 Link Here
60
    public Action fileCommandAction( String command, String name, Icon icon );
60
    public Action fileCommandAction( String command, String name, Icon icon );
61
61
62
    public Action renameProjectAction();
62
    public Action renameProjectAction();
63
64
    Action setProjectConfigurationAction();
63
    
65
    
64
}
66
}
(-)projects/projectuiapi/src/org/netbeans/spi/project/ui/support/CommonProjectActions.java (+16 lines)
Lines 172-175 Link Here
172
        return Utilities.getActionsFactory().newProjectAction();
172
        return Utilities.getActionsFactory().newProjectAction();
173
    }    
173
    }    
174
174
175
    /**
176
     * Creates an action that sets the configuration of the selected project.
177
     * It should be displayed with an action context containing
178
     * exactly one {@link org.netbeans.api.project.Project}.
179
     * The action itself should not be invoked but you may use its popup presenter.
180
     * <p class="nonnormative">
181
     * You might include this in the context menu of a logical view.
182
     * </p>
183
     * @return an action
184
     * @since org.netbeans.modules.projectuiapi/1 1.16
185
     * @see org.netbeans.spi.project.ProjectConfigurationProvider
186
     */
187
    public static Action setProjectConfigurationAction() {
188
        return Utilities.getActionsFactory().setProjectConfigurationAction();
189
    }
190
175
}
191
}

Return to bug 49652