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

(-)a/editor.lib/src/org/netbeans/editor/ext/ExtKit.java (-4 / +4 lines)
Lines 443-452 Link Here
443
443
444
    }
444
    }
445
445
446
//    @EditorActionRegistration(
446
    @EditorActionRegistration(
447
//            name = buildToolTipAction,
447
            name = buildToolTipAction,
448
//            shortDescription = editorBundleHash + buildToolTipAction
448
            shortDescription = editorBundleHash + buildToolTipAction
449
//    )
449
    )
450
    public static class BuildToolTipAction extends BaseAction {
450
    public static class BuildToolTipAction extends BaseAction {
451
451
452
        static final long serialVersionUID =-2701131863705941250L;
452
        static final long serialVersionUID =-2701131863705941250L;
(-)a/editor.lib2/apichanges.xml (+15 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="EditorActionRegistration-weight">
111
            <summary>Add "weight" attribute to EditorActionRegistration.</summary>
112
            <version major="1" minor="53"/>
113
            <date day="14" month="11" year="2011"/>
114
            <author login="mmetelka"/>
115
            <compatibility binary="compatible" source="compatible" semantic="compatible" addition="yes"/>
116
            <description>
117
                <p>
118
                    Add "weight" attribute to EditorActionRegistration annotation
119
                    to allow for a clean actions overriding.
120
                </p>
121
            </description>
122
            <issue number="199823"/>
123
        </change>
124
110
        <change id="zoom-text-action-names-added">
125
        <change id="zoom-text-action-names-added">
111
            <summary>Zoom text actions added</summary>
126
            <summary>Zoom text actions added</summary>
112
            <version major="1" minor="45"/>
127
            <version major="1" minor="45"/>
(-)a/editor.lib2/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.editor.lib2/1
2
OpenIDE-Module: org.netbeans.modules.editor.lib2/1
3
OpenIDE-Module-Implementation-Version: 24
3
OpenIDE-Module-Implementation-Version: 25
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib2/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/lib2/Bundle.properties
5
OpenIDE-Module-Layer: org/netbeans/modules/editor/lib2/resources/layer.xml
5
OpenIDE-Module-Layer: org/netbeans/modules/editor/lib2/resources/layer.xml
6
OpenIDE-Module-Needs: org.netbeans.modules.editor.actions
6
OpenIDE-Module-Needs: org.netbeans.modules.editor.actions
(-)a/editor.lib2/nbproject/project.properties (-1 / +1 lines)
Lines 43-49 Link Here
43
is.autoload=true
43
is.autoload=true
44
javac.source=1.6
44
javac.source=1.6
45
javac.compilerargs=-Xlint:unchecked
45
javac.compilerargs=-Xlint:unchecked
46
spec.version.base=1.52.0
46
spec.version.base=1.53.0
47
47
48
javadoc.arch=${basedir}/arch.xml
48
javadoc.arch=${basedir}/arch.xml
49
javadoc.apichanges=${basedir}/apichanges.xml
49
javadoc.apichanges=${basedir}/apichanges.xml
(-)a/editor.lib2/src/org/netbeans/api/editor/EditorActionRegistration.java (+11 lines)
Lines 177-181 Link Here
177
     * global mime-lookup <code>MimeLookup.getLookup(MimePath.EMPTY)</code>.
177
     * global mime-lookup <code>MimeLookup.getLookup(MimePath.EMPTY)</code>.
178
     */
178
     */
179
    String preferencesKey() default "";
179
    String preferencesKey() default "";
180
    
181
    /**
182
     * Allows to make an override of an action by adding a "weight" attribute
183
     * into a generated file object (in the system filesystem).
184
     * <a href="http://bits.netbeans.org/6.9/javadoc/org-openide-filesystems/apichanges.html#MultiFileSystem.weight">
185
     * More about weight attribute</a>.
186
     * 
187
     * @return value of the weight attribute. When ommited (default value is used)
188
     *   then no weight attribute gets generated.
189
     */
190
    int weight() default Integer.MIN_VALUE;
180
191
181
}
192
}
(-)a/editor.lib2/src/org/netbeans/modules/editor/lib2/EditorActionRegistrationProcessor.java (+6 lines)
Lines 314-319 Link Here
314
        // some tools may query FO's properties and expect it there.
314
        // some tools may query FO's properties and expect it there.
315
        file.stringvalue(Action.NAME, actionName);
315
        file.stringvalue(Action.NAME, actionName);
316
316
317
        // Resolve weight attribute that allows to override existing action
318
        int weight = annotation.weight();
319
        if (weight != Integer.MIN_VALUE) {
320
            file.intvalue("weight", weight);
321
        }
322
317
        if (directActionCreation) {
323
        if (directActionCreation) {
318
            if (methodName != null) {
324
            if (methodName != null) {
319
                file.methodvalue("instanceCreate", className, methodName);
325
                file.methodvalue("instanceCreate", className, methodName);
(-)a/editor/src/org/netbeans/modules/editor/NbEditorKit.java (-1 / +1 lines)
Lines 631-637 Link Here
631
    }
631
    }
632
632
633
633
634
    @EditorActionRegistration(name = buildToolTipAction)
634
    @EditorActionRegistration(name = buildToolTipAction, weight = 100)
635
    public static class NbBuildToolTipAction extends BuildToolTipAction {
635
    public static class NbBuildToolTipAction extends BuildToolTipAction {
636
636
637
        public @Override void actionPerformed(ActionEvent evt, JTextComponent target) {
637
        public @Override void actionPerformed(ActionEvent evt, JTextComponent target) {
(-)a/o.n.core/test/qa-functional/src/org/netbeans/core/validation/ValidateLayerConsistencyTest.java (-8 lines)
Lines 623-636 Link Here
623
            Set<String> overriders = overrides.keySet();
623
            Set<String> overriders = overrides.keySet();
624
            String file = e.getKey();
624
            String file = e.getKey();
625
625
626
            if (file.matches("Editors/Actions/build-(popup-menu|tool-tip)[.]instance")) {
627
                // Provided by editor.lib but overridden (direct dep) by editor.
628
                // Seems like the editor.lib definition might be needed if editor is missing.
629
                // @EditorActionRegistration does not supply a way to define a weight.
630
                // So for now, just permit this special case.
631
                continue;
632
            }
633
634
            if (new HashSet<ContentAndAttrs>(overrides.values()).size() == 1) {
626
            if (new HashSet<ContentAndAttrs>(overrides.values()).size() == 1) {
635
                // All the same. Check whether these are parallel declarations (e.g. CND debugger vs. Java debugger), or vertical.
627
                // All the same. Check whether these are parallel declarations (e.g. CND debugger vs. Java debugger), or vertical.
636
                for (String overrider : overriders) {
628
                for (String overrider : overriders) {

Return to bug 199823