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

(-)f526b2a560a6 (+38 lines)
Added Link Here
1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
#
3
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4
#
5
# The contents of this file are subject to the terms of either the GNU
6
# General Public License Version 2 only ("GPL") or the Common
7
# Development and Distribution License("CDDL") (collectively, the
8
# "License"). You may not use this file except in compliance with the
9
# License. You can obtain a copy of the License at
10
# http://www.netbeans.org/cddl-gplv2.html
11
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12
# specific language governing permissions and limitations under the
13
# License.  When distributing the software, include this License Header
14
# Notice in each file and include the License file at
15
# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
16
# particular file as subject to the "Classpath" exception as provided
17
# by Sun in the GPL Version 2 section of the License file that
18
# accompanied this code. If applicable, add the following below the
19
# License Header, with the fields enclosed by brackets [] replaced by
20
# your own identifying information:
21
# "Portions Copyrighted [year] [name of copyright owner]"
22
#
23
# If you wish your version of this file to be governed by only the CDDL
24
# or only the GPL Version 2, indicate your decision by adding
25
# "[Contributor] elects to include this software in this distribution
26
# under the [CDDL or GPL Version 2] license." If you do not indicate a
27
# single choice of license, a recipient has the option to distribute
28
# your version of this file under either the CDDL, the GPL Version 2 or
29
# to extend the choice of license to its licensees as provided above.
30
# However, if you add GPL Version 2 code and therefore, elected the GPL
31
# Version 2 license, then the option applies only if the new code is
32
# made subject to such option by the copyright holder.
33
# 
34
# Contributor(s):
35
#
36
# Portions Copyrighted 2008 Sun Microsystems, Inc.
37
38
mainModule=org.netbeans.modules.identity.kit
(-)a/ide.ergonomics/manifest.mf (+1 lines)
Lines 3-8 Link Here
3
OpenIDE-Module-Layer: org/netbeans/modules/ide/ergonomics/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/ide/ergonomics/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/ergonomics/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/ergonomics/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.2
5
OpenIDE-Module-Specification-Version: 1.2
6
OpenIDE-Module-Recommends: org.netbeans.modules.server
6
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Essential-Module: true
8
AutoUpdate-Essential-Module: true
8
9
(-)a/ide.ergonomics/project-wizard.xsl (+73 lines)
Lines 25-30 Link Here
25
            <xsl:attribute name="name">Debugger</xsl:attribute>
25
            <xsl:attribute name="name">Debugger</xsl:attribute>
26
                <xsl:apply-templates mode="attach-types"/>
26
                <xsl:apply-templates mode="attach-types"/>
27
        </xsl:element>
27
        </xsl:element>
28
    </xsl:template>
29
30
    <xsl:template match="filesystem/folder[@name='Servers']/folder[@name='Actions']">
31
        <xsl:element name="folder">
32
            <xsl:attribute name="name">Servers</xsl:attribute>
33
            <xsl:element name="folder">
34
                <xsl:attribute name="name">Actions</xsl:attribute>
35
                <xsl:apply-templates mode="actions"/>
36
            </xsl:element>
37
        </xsl:element>
38
        <xsl:call-template 
39
            name="actions-definition"
40
        >
41
            <xsl:with-param
42
                name="originalFile"
43
                select="file/attr[@name='originalFile']"
44
            />
45
        </xsl:call-template>
28
    </xsl:template>
46
    </xsl:template>
29
47
30
    <xsl:template match="filesystem/folder[@name='Services']/folder[@name='AntBasedProjectTypes']">
48
    <xsl:template match="filesystem/folder[@name='Services']/folder[@name='AntBasedProjectTypes']">
Lines 130-135 Link Here
130
        <xsl:copy-of select="."/>
148
        <xsl:copy-of select="."/>
131
    </xsl:template>
149
    </xsl:template>
132
150
151
152
    <!-- actions -->
153
    <xsl:template match="file" mode="actions">
154
        <xsl:element name="file">
155
            <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
156
            <xsl:if test="@url">
157
                <xsl:attribute name="url"><xsl:value-of select="@url"/></xsl:attribute>
158
            </xsl:if>
159
            <xsl:apply-templates mode="actions"/>
160
        </xsl:element>
161
    </xsl:template>
162
163
    <xsl:template match="attr[@name='delegate']" mode="actions">
164
        <xsl:element name="attr">
165
            <xsl:attribute name="name">delegate</xsl:attribute>
166
            <xsl:attribute name="methodvalue">org.netbeans.modules.ide.ergonomics.fod.FeatureAction.create</xsl:attribute>
167
        </xsl:element>
168
    </xsl:template>
169
170
    <xsl:template match="attr" mode="actions">
171
        <xsl:copy-of select="."/>
172
    </xsl:template>
173
174
    <xsl:template name="actions-definition">
175
        <xsl:param name="originalFile"/>
176
        <xsl:call-template name="actions-definition-impl">
177
            <xsl:with-param name="path" select="$originalFile/@stringvalue"/>
178
            <xsl:with-param name="query" select="'filesystem'"/>
179
        </xsl:call-template>
180
    </xsl:template>
181
182
    <xsl:template name="actions-definition-impl">
183
        <xsl:param name="path"/>
184
        <xsl:param name="query"/>
185
        <xsl:variable name="category" select="substring-before($path,'/')"/>
186
        <xsl:choose>
187
            <xsl:when test="$category">
188
                <xsl:element name="folder">
189
                    <xsl:attribute name="name">
190
                        <xsl:value-of select="$category"/>
191
                    </xsl:attribute>
192
                    <xsl:call-template name="actions-definition-impl">
193
                        <xsl:with-param name="path" select="substring-after($path,'/')"/>
194
                    </xsl:call-template>
195
                </xsl:element>
196
            </xsl:when>
197
            <xsl:otherwise>
198
                <xsl:apply-templates
199
                    select="//filesystem/folder[@name='Actions']/descendant::file[@name=$path]"
200
                    mode="actions"
201
                />
202
            </xsl:otherwise>
203
        </xsl:choose>
204
    </xsl:template>
205
133
    <!-- project type -->
206
    <!-- project type -->
134
    <xsl:template match="file" mode="project-types">
207
    <xsl:template match="file" mode="project-types">
135
        <xsl:element name="file">
208
        <xsl:element name="file">
(-)a/ide.ergonomics/src-ant/org/netbeans/modules/ide/ergonomics/ant/relative-refs.xsl (+21 lines)
Lines 47-52 Link Here
47
                    <xsl:attribute name="name">Debugger</xsl:attribute>
47
                    <xsl:attribute name="name">Debugger</xsl:attribute>
48
                    <xsl:apply-templates
48
                    <xsl:apply-templates
49
                        select="//*/folder[@name='Debugger']/*"
49
                        select="//*/folder[@name='Debugger']/*"
50
                        mode="project-wizard"
51
                    />
52
                </xsl:element>
53
            </xsl:if>
54
            <xsl:if test="//*/folder[@name='Servers']/folder[@name='Actions']">
55
                <xsl:element name="folder">
56
                    <xsl:attribute name="name">Servers</xsl:attribute>
57
                    <xsl:element name="folder">
58
                        <xsl:attribute name="name">Actions</xsl:attribute>
59
                        <xsl:apply-templates
60
                            select="//*/folder[@name='Servers']/folder[@name='Actions']/*"
61
                            mode="project-wizard"
62
                        />
63
                    </xsl:element>
64
                </xsl:element>
65
            </xsl:if>
66
            <xsl:if test="//filesystem/folder[@name='Actions']">
67
                <xsl:element name="folder">
68
                    <xsl:attribute name="name">Actions</xsl:attribute>
69
                    <xsl:apply-templates
70
                        select="//filesystem/folder[@name='Actions']/*"
50
                        mode="project-wizard"
71
                        mode="project-wizard"
51
                    />
72
                    />
52
                </xsl:element>
73
                </xsl:element>
(-)a/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/Bundle.properties (+4 lines)
Lines 86-88 Link Here
86
MSG_Opening_File=Opening File {0}
86
MSG_Opening_File=Opening File {0}
87
CAP_Opening_File=Opening File
87
CAP_Opening_File=Opening File
88
FodDataObjectFactoryPanel.fileName.text=
88
FodDataObjectFactoryPanel.fileName.text=
89
90
91
MSG_Action=Preparing Action "{0}"
92
CAP_Action=Executing Action
(-)a/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FeatureAction.java (-9 / +48 lines)
Lines 38-49 Link Here
38
 */
38
 */
39
package org.netbeans.modules.ide.ergonomics.fod;
39
package org.netbeans.modules.ide.ergonomics.fod;
40
40
41
import java.awt.EventQueue;
42
import java.awt.Frame;
41
import java.awt.event.ActionEvent;
43
import java.awt.event.ActionEvent;
42
import java.awt.event.ActionListener;
44
import java.awt.event.ActionListener;
43
import javax.swing.SwingUtilities;
45
import java.util.logging.Level;
46
import javax.swing.JDialog;
47
import javax.swing.JFrame;
48
import org.netbeans.api.progress.ProgressHandle;
49
import org.netbeans.api.progress.ProgressHandleFactory;
44
import org.openide.filesystems.FileObject;
50
import org.openide.filesystems.FileObject;
45
import org.openide.filesystems.FileUtil;
51
import org.openide.filesystems.FileUtil;
52
import org.openide.util.NbBundle;
46
import org.openide.util.RequestProcessor;
53
import org.openide.util.RequestProcessor;
54
import org.openide.util.Utilities;
47
55
48
/**
56
/**
49
 *
57
 *
Lines 53-73 Link Here
53
61
54
    private boolean success;
62
    private boolean success;
55
    private FileObject fo;
63
    private FileObject fo;
56
    private boolean isDelegateAction = false;
64
    private ProgressHandle handle;
65
    private JDialog dialog;
57
66
58
    public FeatureAction(FileObject fo, boolean delegate) {
67
    private FeatureAction(FileObject fo) {
59
        this.fo = fo;
68
        this.fo = fo;
60
        this.isDelegateAction = delegate;
69
    }
70
71
    public static ActionListener create(FileObject fo) {
72
        return new FeatureAction(fo);
61
    }
73
    }
62
74
63
    public void actionPerformed(ActionEvent e) {
75
    public void actionPerformed(ActionEvent e) {
64
        success = false;
76
        success = false;
77
        if (EventQueue.isDispatchThread()) {
78
            handle = ProgressHandleFactory.createHandle(
79
                NbBundle.getMessage(FeatureAction.class, "MSG_Action", fo.getAttribute("displayName"))
80
            ); // NOI18N
81
            Frame[] arr = JFrame.getFrames();
82
            final Frame mainWindow = arr.length > 0 ? arr[0] : null;
83
            dialog = new JDialog(
84
                mainWindow,
85
                NbBundle.getMessage(FodDataObjectFactory.class, "CAP_Action"),
86
                true
87
            );
88
            dialog.getContentPane().add(new FodDataObjectFactoryPanel(handle, null, (String)fo.getAttribute("displayName")));
89
            dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
90
            dialog.pack();
91
            dialog.setBounds(Utilities.findCenterBounds(dialog.getPreferredSize()));
92
            FoDFileSystem.LOG.log(Level.FINE, "Bounds {0}", dialog.getBounds());
93
        }
65
        RequestProcessor.Task t = RequestProcessor.getDefault().post(this, 0, Thread.NORM_PRIORITY);
94
        RequestProcessor.Task t = RequestProcessor.getDefault().post(this, 0, Thread.NORM_PRIORITY);
66
        if (isDelegateAction) {
95
        if (dialog != null) {
67
            t.waitFinished ();
96
            dialog.setVisible(true);
68
        } else {
69
            return ;
70
        }
97
        }
98
        t.waitFinished ();
71
        
99
        
72
        if (! success) {
100
        if (! success) {
73
            return ;
101
            return ;
Lines 85-92 Link Here
85
    }
113
    }
86
114
87
    public void run() {
115
    public void run() {
88
        assert ! SwingUtilities.isEventDispatchThread () : "Cannot run in EQ!";
116
        assert ! EventQueue.isDispatchThread () : "Cannot run in EQ!";
89
        FeatureInfo info = FoDFileSystem.getInstance().whichProvides(fo);
117
        FeatureInfo info = FoDFileSystem.getInstance().whichProvides(fo);
118
        if (handle != null) {
119
            handle.start();
120
        }
90
        success = ModulesInstaller.installModules(info);
121
        success = ModulesInstaller.installModules(info);
122
        if (dialog != null) {
123
            dialog.setVisible(false);
124
        }
125
        if (handle != null) {
126
            handle.finish();
127
        }
128
        handle = null;
129
        dialog = null;
91
    }
130
    }
92
}
131
}
(-)a/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FodDataObjectFactory.java (-1 / +1 lines)
Lines 164-170 Link Here
164
                Frame[] arr = JFrame.getFrames();
164
                Frame[] arr = JFrame.getFrames();
165
                final Frame mainWindow = arr.length > 0 ? arr[0] : null;
165
                final Frame mainWindow = arr.length > 0 ? arr[0] : null;
166
                dialog = new JDialog(mainWindow, NbBundle.getMessage(FodDataObjectFactory.class, "CAP_Opening_File"), true);
166
                dialog = new JDialog(mainWindow, NbBundle.getMessage(FodDataObjectFactory.class, "CAP_Opening_File"), true);
167
                dialog.getContentPane().add(new FodDataObjectFactoryPanel(handle, fo));
167
                dialog.getContentPane().add(new FodDataObjectFactoryPanel(handle, fo, null));
168
                dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
168
                dialog.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
169
                dialog.pack();
169
                dialog.pack();
170
                dialog.setBounds(Utilities.findCenterBounds(dialog.getPreferredSize()));
170
                dialog.setBounds(Utilities.findCenterBounds(dialog.getPreferredSize()));
(-)a/ide.ergonomics/src/org/netbeans/modules/ide/ergonomics/fod/FodDataObjectFactoryPanel.java (-2 / +7 lines)
Lines 52-61 Link Here
52
 */
52
 */
53
final class FodDataObjectFactoryPanel extends javax.swing.JPanel {
53
final class FodDataObjectFactoryPanel extends javax.swing.JPanel {
54
    /** Creates new form OpeningProjectPanel */
54
    /** Creates new form OpeningProjectPanel */
55
    public FodDataObjectFactoryPanel(ProgressHandle handle, FileObject fo) {
55
    public FodDataObjectFactoryPanel(ProgressHandle handle, FileObject fo, String msg) {
56
        initComponents();
56
        initComponents();
57
        progressPanel.add(BorderLayout.CENTER, ProgressHandleFactory.createProgressComponent(handle));
57
        progressPanel.add(BorderLayout.CENTER, ProgressHandleFactory.createProgressComponent(handle));
58
        fileName.setText(fo.getPath());
58
        if (fo != null) {
59
            fileName.setText(fo.getPath());
60
        }
61
        if (msg != null) {
62
            actionName.setText(msg);
63
        }
59
    }
64
    }
60
    
65
    
61
    /** This method is called from within the constructor to
66
    /** This method is called from within the constructor to
(-)a/ide.ergonomics/test/unit/src/org/netbeans/modules/ide/ergonomics/DynamicVerifyTest.java (+2 lines)
Lines 66-71 Link Here
66
            addTest(ProjectTemplatesCheck.class).
66
            addTest(ProjectTemplatesCheck.class).
67
            addTest(FilesAndAttributesCheck.class, "testGetAllTemplates", "testCheckAllTemplatesPretest").
67
            addTest(FilesAndAttributesCheck.class, "testGetAllTemplates", "testCheckAllTemplatesPretest").
68
            addTest(DebuggerAttachTypesCheck.class, "testGetAllDebuggers").
68
            addTest(DebuggerAttachTypesCheck.class, "testGetAllDebuggers").
69
            addTest(ServersNodeActionsCheck.class, "testGetAll", "testCheckAllPretest").
69
            gui(false).
70
            gui(false).
70
            clusters("ergonomics.*").
71
            clusters("ergonomics.*").
71
            clusters(".*").
72
            clusters(".*").
Lines 77-82 Link Here
77
            addTest(AllClustersProcessedCheck.class).
78
            addTest(AllClustersProcessedCheck.class).
78
            addTest(FilesAndAttributesCheck.class, "testCheckAllTemplatesReal").
79
            addTest(FilesAndAttributesCheck.class, "testCheckAllTemplatesReal").
79
            addTest(DebuggerAttachTypesCheck.class, "testGetAllDebuggersReal").
80
            addTest(DebuggerAttachTypesCheck.class, "testGetAllDebuggersReal").
81
            addTest(ServersNodeActionsCheck.class, "testCheckAllReal").
80
            gui(false).
82
            gui(false).
81
            clusters("ergonomics.*").
83
            clusters("ergonomics.*").
82
            clusters(".*").
84
            clusters(".*").
(-)f526b2a560a6 (+219 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
package org.netbeans.modules.ide.ergonomics;
40
41
import java.io.IOException;
42
import java.net.URL;
43
import java.util.ArrayList;
44
import java.util.Collection;
45
import java.util.Collections;
46
import java.util.Enumeration;
47
import java.util.Iterator;
48
import java.util.List;
49
import java.util.Map;
50
import java.util.TreeMap;
51
import org.netbeans.junit.NbTestCase;
52
import org.openide.filesystems.FileObject;
53
import org.openide.filesystems.FileStateInvalidException;
54
import org.openide.filesystems.FileUtil;
55
import org.openide.util.Enumerations;
56
57
/**
58
 *
59
 * @author Jaroslav Tulach <jtulach@netbeans.org>
60
 */
61
public class ServersNodeActionsCheck extends NbTestCase {
62
63
    public ServersNodeActionsCheck(String name) {
64
        super(name);
65
    }
66
67
    public void testGetAll() throws Exception {
68
        clearWorkDir();
69
       
70
        FileObject orig = FileUtil.getConfigFile("Servers/Actions");
71
        assertNotNull("actions folder is there", orig);
72
73
        Enumeration<? extends FileObject> nodes = orig.getChildren(true);
74
        class VisitOriginalFile implements Enumerations.Processor<FileObject,FileObject> {
75
            public FileObject process(FileObject fo, Collection<FileObject> toAdd) {
76
                Object attr = fo.getAttribute("originalFile");
77
                if (attr instanceof String) {
78
                    FileObject originalFile = FileUtil.getConfigFile((String)attr);
79
                    assertNotNull("Original file for " + attr + " found", originalFile);
80
                    toAdd.add(originalFile);
81
                }
82
                return fo;
83
            }
84
        }
85
86
87
        StringBuilder errors = new StringBuilder();
88
        Enumeration<? extends FileObject> en = Enumerations.queue(nodes, new VisitOriginalFile());
89
        while (en.hasMoreElements()) {
90
            FileObject fo = en.nextElement();
91
92
            int cnt = 0;
93
            Enumeration<String> allAttributes = fo.getAttributes();
94
            while (allAttributes.hasMoreElements()) {
95
                String name = allAttributes.nextElement();
96
                Object attr = fo.getAttribute(name);
97
                if (attr == null) {
98
                    fail("fo: " + fo + " has null " + name + " attribute");
99
                }
100
                System.setProperty(dynAttr + fo.getPath() + "@" + name, attr.toString());
101
                cnt++;
102
103
                if (attr instanceof URL) {
104
                    URL u = (URL) attr;
105
                    int read = -1;
106
                    try {
107
                        read = u.openStream().read(new byte[4096]);
108
                    } catch (IOException ex) {
109
                        errors.append(ex.getMessage()).append('\n');
110
                    }
111
                    if (read <= 0) {
112
                        errors.append("Resource shall exist: " + fo + " attr: " + name + " value: " + attr + "\n");
113
                    }
114
                }
115
            }
116
            System.setProperty(dynVery + fo.getPath(), String.valueOf(cnt));
117
            String locName = getDisplayName(fo);
118
            System.setProperty(dynName + fo.getPath(), locName);
119
        }
120
121
        if (errors.length() > 0) {
122
            fail(errors.toString());
123
        }
124
    }
125
    private static final String dynName = "serversnodedynamic/name/";
126
    private static final String dynVery = "serversnodedynamic/verify/";
127
    private static final String dynAttr = "serversnodedynamic/attr/";
128
129
    public void testCheckAllPretest() throws Exception {
130
        testCheckAllReal();
131
    }
132
    public void testCheckAllReal() throws Exception {
133
        Map<String, List<String>> filesAndAttribs = new TreeMap<String, List<String>>();
134
        for (Object o : System.getProperties().keySet()) {
135
            String f = (String)o;
136
            if (f.startsWith(dynVery)) {
137
                int cnt = Integer.parseInt(System.getProperties().getProperty(f));
138
                f = f.substring(dynVery.length());
139
                ArrayList<String> arr = new ArrayList<String>();
140
                String pref = dynAttr + f + "@";
141
                for (Map.Entry<Object, Object> entry : System.getProperties().entrySet()) {
142
                    if (entry.getKey() instanceof String) {
143
                        String a = (String) entry.getKey();
144
                        if (a.startsWith(pref)) {
145
                            a = a.substring(pref.length());
146
                            arr.add(a);
147
                        }
148
                    }
149
                }
150
                if (arr.size() != cnt) {
151
                    fail("There shall be " + cnt + " attributes for " + f);
152
                }
153
                filesAndAttribs.put(f, arr);
154
            }
155
        }
156
        if (filesAndAttribs.size() == 0) {
157
            fail("Some properties shall be set: " + System.getProperties());
158
        }
159
160
        Iterator<? extends String> allTemplates = filesAndAttribs.keySet().iterator();
161
        StringBuilder errors = new StringBuilder();
162
        while (allTemplates.hasNext()) {
163
            String fo = allTemplates.next();
164
            FileObject clone = FileUtil.getConfigFile(fo);
165
166
            if (clone == null) {
167
                errors.append("Both files exist: " + fo + "\n");
168
                continue;
169
            }
170
            Enumeration<String> allAttributes = Collections.enumeration(filesAndAttribs.get(fo));
171
            while (allAttributes.hasMoreElements()) {
172
                String name = allAttributes.nextElement();
173
                Object attr = clone.getAttribute(name);
174
                if (attr == null && "templateWizardIterator".equals(name)) {
175
                    attr = clone.getAttribute("instantiatingIterator");
176
                }
177
178
                if (attr == null) {
179
                    errors.append("Attribute " + name + " present in orig on " + fo + " but null in clone\n");
180
                }
181
182
                if (name.equals("iconResource")) {
183
                    attr = Thread.currentThread().getContextClassLoader().getResource((String)attr);
184
                    if (!(attr instanceof URL)) {
185
                        errors.append("iconResource attr for " + fo + " shall exist "  + attr);
186
                    }
187
                }
188
                
189
                if (attr instanceof URL) {
190
                    URL u = (URL) attr;
191
                    int read = -1;
192
                    try {
193
                        read = u.openStream().read(new byte[4096]);
194
                    } catch (IOException ex) {
195
                        errors.append(ex.getMessage()).append('\n');
196
                    }
197
                    if (read <= 0) {
198
                        errors.append("Resource shall exist: " + fo + " attr: " + name + " value: " + attr + "\n");
199
                    }
200
                }
201
            }
202
            allTemplates.remove();
203
        }
204
205
        if (errors.length() > 0) {
206
            fail(errors.toString());
207
        }
208
209
        if (!filesAndAttribs.isEmpty()) {
210
            fail("All should be empty: " + filesAndAttribs);
211
        }
212
    }
213
214
    private static String getDisplayName(FileObject f) throws FileStateInvalidException {
215
        return f.getFileSystem().getStatus().annotateName(
216
            f.getNameExt(), Collections.<FileObject>singleton(f)
217
        );
218
    }
219
}
(-)a/identity.server.manager/nbproject/project.xml (-4 / +16 lines)
Lines 5-14 Link Here
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>org.netbeans.modules.identity.server.manager</code-name-base>
6
            <code-name-base>org.netbeans.modules.identity.server.manager</code-name-base>
7
            <module-dependencies>
7
            <module-dependencies>
8
                <dependency>
9
                    <code-name-base>org.netbeans.modules.j2ee.sun.appsrv81</code-name-base>
10
                    <build-prerequisite/>
11
                </dependency>
12
                <dependency>
8
                <dependency>
13
                    <code-name-base>org.jdesktop.layout</code-name-base>
9
                    <code-name-base>org.jdesktop.layout</code-name-base>
14
                    <build-prerequisite/>
10
                    <build-prerequisite/>
Lines 33-38 Link Here
33
                    <run-dependency>
29
                    <run-dependency>
34
                        <release-version>1</release-version>
30
                        <release-version>1</release-version>
35
                        <specification-version>1.5</specification-version>
31
                        <specification-version>1.5</specification-version>
32
                    </run-dependency>
33
                </dependency>
34
                <dependency>
35
                    <code-name-base>org.netbeans.modules.j2ee.sun.appsrv81</code-name-base>
36
                    <run-dependency>
37
                        <release-version>1</release-version>
38
                        <specification-version>1.7</specification-version>
39
                    </run-dependency>
40
                </dependency>
41
                <dependency>
42
                    <code-name-base>org.netbeans.modules.javahelp</code-name-base>
43
                    <build-prerequisite/>
44
                    <compile-dependency/>
45
                    <run-dependency>
46
                        <release-version>1</release-version>
47
                        <specification-version>2.12</specification-version>
36
                    </run-dependency>
48
                    </run-dependency>
37
                </dependency>
49
                </dependency>
38
                <dependency>
50
                <dependency>
(-)a/identity.server.manager/src/org/netbeans/modules/identity/server/manager/layer.xml (+17 lines)
Lines 42-49 Link Here
42
-->
42
-->
43
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
43
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
44
<filesystem>
44
<filesystem>
45
    <folder name="Actions">
46
        <folder name="Help">
47
            <file name="org-netbeans-modules-identity-server-manager-ui-actions-InfoAction.instance">
48
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
49
                <attr name="delegate" newvalue="org.netbeans.modules.identity.server.manager.ui.actions.InfoAction"/>
50
                <attr name="displayName" bundlevalue="org.netbeans.modules.identity.server.manager.ui.actions.Bundle#CTL_InfoAction"/>
51
            </file>
52
        </folder>
53
    </folder>
45
    <folder name="Identity">
54
    <folder name="Identity">
46
        <folder name="ConfiguredServers">
55
        <folder name="ConfiguredServers">
56
        </folder>
57
    </folder>
58
    <folder name="Servers">
59
        <folder name="Actions">
60
            <file name="org-netbeans-modules-identity-server-manager-ui-actions-InfoAction.shadow">
61
                <attr name="originalFile" stringvalue="Actions/Help/org-netbeans-modules-identity-server-manager-ui-actions-InfoAction.instance"/>
62
                <attr name="position" intvalue="600"/>
63
            </file>
47
        </folder>
64
        </folder>
48
    </folder>
65
    </folder>
49
    
66
    
(-)a/identity.server.manager/src/org/netbeans/modules/identity/server/manager/ui/actions/Bundle.properties (+1 lines)
Lines 38-43 Link Here
38
# Version 2 license, then the option applies only if the new code is
38
# Version 2 license, then the option applies only if the new code is
39
# made subject to such option by the copyright holder.
39
# made subject to such option by the copyright holder.
40
40
41
CTL_InfoAction=Identity Usage...
41
LBL_AddServerInstance=Add Server...
42
LBL_AddServerInstance=Add Server...
42
LBL_RemoveServerInstance=Remove
43
LBL_RemoveServerInstance=Remove
43
LBL_ViewAdminConsole=View Admin Console
44
LBL_ViewAdminConsole=View Admin Console
(-)f526b2a560a6 (+59 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.identity.server.manager.ui.actions;
41
42
import java.awt.Toolkit;
43
import java.awt.event.ActionEvent;
44
import java.awt.event.ActionListener;
45
import org.netbeans.api.javahelp.Help;
46
import org.openide.util.HelpCtx;
47
import org.openide.util.Lookup;
48
49
public final class InfoAction implements ActionListener {
50
    public void actionPerformed(ActionEvent e) {
51
        Help h = (Help)Lookup.getDefault().lookup(Help.class);
52
        if (h == null) {
53
            Toolkit.getDefaultToolkit().beep();
54
            return;
55
        }
56
        HelpCtx ctx = new HelpCtx("idmtools_am_ww_am_instances"); //NOI18N
57
        h.showHelp(ctx);
58
    }
59
}
(-)a/j2ee.sun.appsrv81/nbproject/project.xml (+9 lines)
Lines 192-197 Link Here
192
                    </run-dependency>
192
                    </run-dependency>
193
                </dependency>
193
                </dependency>
194
                <dependency>
194
                <dependency>
195
                    <code-name-base>org.netbeans.modules.javahelp</code-name-base>
196
                    <build-prerequisite/>
197
                    <compile-dependency/>
198
                    <run-dependency>
199
                        <release-version>1</release-version>
200
                        <specification-version>2.12</specification-version>
201
                    </run-dependency>
202
                </dependency>
203
                <dependency>
195
                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
204
                    <code-name-base>org.netbeans.modules.project.ant</code-name-base>
196
                    <build-prerequisite/>
205
                    <build-prerequisite/>
197
                    <compile-dependency/>
206
                    <compile-dependency/>
(-)a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/Bundle.properties (+2 lines)
Lines 42-44 Link Here
42
LBL_GlassFishV1=GlassFish v1
42
LBL_GlassFishV1=GlassFish v1
43
LBL_GlassFishV2=GlassFish v2.x
43
LBL_GlassFishV2=GlassFish v2.x
44
LBL_JavaEEPlusSIP=Sailfin v1
44
LBL_JavaEEPlusSIP=Sailfin v1
45
46
CTL_InfoAction=Java EE Usage...
(-)f526b2a560a6 (+59 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.j2ee.sun.ide;
41
42
import java.awt.Toolkit;
43
import java.awt.event.ActionEvent;
44
import java.awt.event.ActionListener;
45
import org.netbeans.api.javahelp.Help;
46
import org.openide.util.HelpCtx;
47
import org.openide.util.Lookup;
48
49
public final class InfoAction implements ActionListener {
50
    public void actionPerformed(ActionEvent e) {
51
        Help h = (Help)Lookup.getDefault().lookup(Help.class);
52
        if (h == null) {
53
            Toolkit.getDefaultToolkit().beep();
54
            return;
55
        }
56
        HelpCtx ctx = new HelpCtx("register_appserver"); //NOI18N
57
        h.showHelp(ctx);
58
    }
59
}
(-)a/j2ee.sun.appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/layer.xml (+13 lines)
Lines 298-304 Link Here
298
            <file name="com-sun-enterprise-tools-studio-j2ee-mainpage.xml" url="com-sun-enterprise-tools-studio-j2ee-mainpage.xml">
298
            <file name="com-sun-enterprise-tools-studio-j2ee-mainpage.xml" url="com-sun-enterprise-tools-studio-j2ee-mainpage.xml">
299
            	<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.j2ee.sun.ide.j2ee.Bundle"/> 
299
            	<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.j2ee.sun.ide.j2ee.Bundle"/> 
300
            </file>
300
            </file>
301
            <file name="org-netbeans-modules-j2ee-sun-ide-InfoAction.instance">
302
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
303
                <attr name="delegate" newvalue="org.netbeans.modules.j2ee.sun.ide.InfoAction"/>
304
                <attr name="displayName" bundlevalue="org.netbeans.modules.j2ee.sun.ide.Bundle#CTL_InfoAction"/>
305
            </file>
301
        </folder>        
306
        </folder>        
307
    </folder>
308
    <folder name="Servers">
309
        <folder name="Actions">
310
            <file name="org-netbeans-modules-j2ee-sun-ide-InfoAction.shadow">
311
                <attr name="originalFile" stringvalue="Actions/Help/org-netbeans-modules-j2ee-sun-ide-InfoAction.instance"/>
312
                <attr name="position" intvalue="550"/>
313
            </file>
314
        </folder>
302
    </folder>
315
    </folder>
303
316
304
317
(-)a/ruby.help/nbproject/project.xml (-1 / +19 lines)
Lines 4-10 Link Here
4
    <configuration>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>org.netbeans.modules.ruby.help</code-name-base>
6
            <code-name-base>org.netbeans.modules.ruby.help</code-name-base>
7
            <module-dependencies/>
7
            <module-dependencies>
8
                <dependency>
9
                    <code-name-base>org.netbeans.modules.javahelp</code-name-base>
10
                    <build-prerequisite/>
11
                    <compile-dependency/>
12
                    <run-dependency>
13
                        <release-version>1</release-version>
14
                        <specification-version>2.12</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
18
                    <code-name-base>org.openide.util</code-name-base>
19
                    <build-prerequisite/>
20
                    <compile-dependency/>
21
                    <run-dependency>
22
                        <specification-version>7.22</specification-version>
23
                    </run-dependency>
24
                </dependency>
25
            </module-dependencies>
8
            <public-packages/>
26
            <public-packages/>
9
        </data>
27
        </data>
10
    </configuration>
28
    </configuration>
(-)a/ruby.help/src/org/netbeans/modules/ruby/help/Bundle.properties (+1 lines)
Lines 43-45 Link Here
43
OpenIDE-Module-Long-Description=\
43
OpenIDE-Module-Long-Description=\
44
    Contains the actual JavaHelp content files for the Ruby Support
44
    Contains the actual JavaHelp content files for the Ruby Support
45
45
46
CTL_InfoAction=Ruby Usage...
(-)f526b2a560a6 (+59 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.ruby.help;
41
42
import java.awt.Toolkit;
43
import java.awt.event.ActionEvent;
44
import java.awt.event.ActionListener;
45
import org.netbeans.api.javahelp.Help;
46
import org.openide.util.HelpCtx;
47
import org.openide.util.Lookup;
48
49
public final class InfoAction implements ActionListener {
50
    public void actionPerformed(ActionEvent e) {
51
        Help h = (Help)Lookup.getDefault().lookup(Help.class);
52
        if (h == null) {
53
            Toolkit.getDefaultToolkit().beep();
54
            return;
55
        }
56
        HelpCtx ctx = new HelpCtx("nbruby_about_ruby"); //NOI18N
57
        h.showHelp(ctx);
58
    }
59
}
(-)a/ruby.help/src/org/netbeans/modules/ruby/help/layer.xml (+17 lines)
Lines 8-12 Link Here
8
            </file>
8
            </file>
9
        </folder>
9
        </folder>
10
    </folder>
10
    </folder>
11
    <folder name="Actions">
12
        <folder name="Help">
13
            <file name="org-netbeans-modules-ruby-help-InfoAction.instance">
14
                <attr name="instanceCreate" methodvalue="org.openide.awt.Actions.alwaysEnabled"/>
15
                <attr name="delegate" newvalue="org.netbeans.modules.ruby.help.InfoAction"/>
16
                <attr name="displayName" bundlevalue="org.netbeans.modules.ruby.help.Bundle#CTL_InfoAction"/>
17
            </file>
18
        </folder>
19
    </folder>
20
    <folder name="Servers">
21
        <folder name="Actions">
22
            <file name="org-netbeans-modules-ruby-help-InfoAction.shadow">
23
                <attr name="originalFile" stringvalue="Actions/Help/org-netbeans-modules-ruby-help-InfoAction.instance"/>
24
                <attr name="position" intvalue="650"/>
25
            </file>
26
        </folder>
27
    </folder>
11
</filesystem>
28
</filesystem>
12
29
(-)a/server/apichanges.xml (+13 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
    <changes>
109
    <changes>
110
        <change id="node.actions">
111
            <api name="common_server_properties_api"/>
112
            <summary>Extensible actions on root server node</summary>
113
            <version major="1" minor="4"/>
114
            <date day="3" month="4" year="2009"/>
115
            <author login="jtulach"/>
116
            <compatibility addition="yes"/>
117
            <description>
118
                By registering actions to <code>Servers/Actions</code> you
119
                can extend the list of popup actions on Servers node in
120
                Services tab.
121
            </description>
122
        </change>
110
        <change>
123
        <change>
111
            <api name="common_server_properties_api"/>
124
            <api name="common_server_properties_api"/>
112
            <summary>Support API for server instance persistence</summary>
125
            <summary>Support API for server instance persistence</summary>
(-)a/server/arch.xml (+7 lines)
Lines 69-74 Link Here
69
   module provides support API
69
   module provides support API
70
   <api group="java" name="CommonServerPropertiesAPI" type="export" category="devel" url="@TOP@org/netbeans/api/server/properties/package-summary.html"/>
70
   <api group="java" name="CommonServerPropertiesAPI" type="export" category="devel" url="@TOP@org/netbeans/api/server/properties/package-summary.html"/>
71
   to do that. This support API is not mandatory for clients to use in any way.
71
   to do that. This support API is not mandatory for clients to use in any way.
72
  </p>
73
  <p>
74
      <api group="layer" name="ServersNodeActions" type="export" category="devel">
75
                By registering actions to <code>Servers/Actions</code> you
76
                can extend the list of popup actions on Servers node in
77
                Services tab.
78
      </api>
72
  </p>
79
  </p>
73
 </answer>
80
 </answer>
74
81
(-)a/server/manifest.mf (-1 / +2 lines)
Lines 2-7 Link Here
2
OpenIDE-Module: org.netbeans.modules.server/0
2
OpenIDE-Module: org.netbeans.modules.server/0
3
OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.3
5
OpenIDE-Module-Specification-Version: 1.4
6
OpenIDE-Module-Provides: org.netbeans.modules.server
6
AutoUpdate-Show-In-Client: false
7
AutoUpdate-Show-In-Client: false
7
8
(-)a/server/src/org/netbeans/modules/server/resources/layer.xml (-1 / +11 lines)
Lines 62-66 Link Here
62
        </folder>
62
        </folder>
63
    </folder>
63
    </folder>
64
    
64
    
65
    <folder name="Servers"/>
65
    <folder name="Servers">
66
        <folder name="Actions">
67
            <file name="org-netbeans-modules-server-ui-node-AddServerInstanceAction.instance">
68
                <attr name="position" intvalue="100"/>
69
            </file>
70
            <file name="JSeparator1.instance">
71
                <attr name="instanceCreate" newvalue="javax.swing.JSeparator"/>
72
                <attr name="position" intvalue="500"/>
73
            </file>
74
        </folder>
75
    </folder>
66
</filesystem>
76
</filesystem>
(-)a/server/src/org/netbeans/modules/server/ui/node/RootNode.java (-1 / +3 lines)
Lines 57-64 Link Here
57
import org.openide.nodes.Node;
57
import org.openide.nodes.Node;
58
import org.openide.util.NbBundle;
58
import org.openide.util.NbBundle;
59
import org.openide.util.RequestProcessor;
59
import org.openide.util.RequestProcessor;
60
import org.openide.util.Utilities;
60
import org.openide.util.WeakListeners;
61
import org.openide.util.WeakListeners;
61
import org.openide.util.actions.SystemAction;
62
import org.openide.util.actions.SystemAction;
63
import org.openide.util.lookup.Lookups;
62
64
63
public final class RootNode extends AbstractNode {
65
public final class RootNode extends AbstractNode {
64
66
Lines 87-93 Link Here
87
89
88
    @Override
90
    @Override
89
    public Action[] getActions(boolean context) {
91
    public Action[] getActions(boolean context) {
90
        return new SystemAction[] {SystemAction.get(AddServerInstanceAction.class)};
92
        return Utilities.actionsForPath("Servers/Actions").toArray(new Action[0]); // NOI18N
91
    }
93
    }
92
94
93
    private static class ChildFactory extends org.openide.nodes.ChildFactory<ServerInstance> implements ChangeListener {
95
    private static class ChildFactory extends org.openide.nodes.ChildFactory<ServerInstance> implements ChangeListener {
(-)f526b2a560a6 (+89 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.server.ui.node;
41
42
import javax.swing.Action;
43
import org.netbeans.junit.NbTestCase;
44
import org.openide.filesystems.FileObject;
45
import org.openide.filesystems.FileUtil;
46
import org.openide.util.HelpCtx;
47
import org.openide.util.actions.CallableSystemAction;
48
49
/**
50
 *
51
 * @author Jaroslav Tulach <jtulach@netbeans.org>
52
 */
53
public class RootNodeTest extends NbTestCase {
54
55
    public RootNodeTest(String s) {
56
        super(s);
57
    }
58
59
    public void testGetActions() throws Exception {
60
        RootNode rn = RootNode.getInstance();
61
        FileObject fo = FileUtil.getConfigFile("Servers/Actions");
62
        assertNotNull("Folder for actions precreated", fo);
63
        fo.createData(MyAction.class.getName().replace('.', '-') + ".instance");
64
        Action[] arr = rn.getActions(true);
65
        assertEquals("Two actions found", 2, arr.length);
66
        MyAction a = MyAction.get(MyAction.class);
67
68
        if (a != arr[0] && a != arr[1]) {
69
            fail("My action shall be present in the node context actions: " + arr[0] + " 2nd: " + arr[1]);
70
        }
71
    }
72
73
    public static final class MyAction extends CallableSystemAction {
74
        @Override
75
        public void performAction() {
76
        }
77
78
        @Override
79
        public String getName() {
80
            return "My";
81
        }
82
83
        @Override
84
        public HelpCtx getHelpCtx() {
85
            return HelpCtx.DEFAULT_HELP;
86
        }
87
88
    }
89
}

Return to bug 158765