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

(-)a/java.api.common/apichanges.xml (+16 lines)
Lines 105-110 Link Here
105
105
106
    <!-- ACTUAL CHANGES BEGIN HERE: -->
106
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <changes>
107
    <changes>
108
        <change id="action.properties">
109
            <api name="java-api-common"/>
110
            <summary>Added ability to receive action specific properties</summary>
111
            <version majori="1" minor="35"/>
112
            <data day="5" month="1" year="2011"/>
113
            <author login="yardus"/>
114
            <compatibility addition="yes"/>
115
            <description>
116
                <p>
117
                    Added ability to receive action specific properties 
118
                    when calling <code>ActionProvider.invokeAction(command,lookup)</code>
119
                </p>
120
            </description>
121
            <class package="org.netbeans.modules.java.api.common.project" name="BaseActionProvider$ActionPropertiesProvider"/>
122
            <issue number="206931"/>
123
        </change>
108
        <change id="ant-hooks">
124
        <change id="ant-hooks">
109
            <api name="java-api-common"/>
125
            <api name="java-api-common"/>
110
            <summary>Added methods to track ant invocation</summary>
126
            <summary>Added methods to track ant invocation</summary>
(-)a/java.api.common/manifest.mf (-1 / +1 lines)
Lines 1-4 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.java.api.common/0
2
OpenIDE-Module: org.netbeans.modules.java.api.common/0
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/api/common/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/api/common/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.34
4
OpenIDE-Module-Specification-Version: 1.35
(-)a/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java (-2 / +29 lines)
Lines 147-152 Link Here
147
 * @since org.netbeans.modules.java.api.common/1 1.20
147
 * @since org.netbeans.modules.java.api.common/1 1.20
148
 */
148
 */
149
public abstract class BaseActionProvider implements ActionProvider {
149
public abstract class BaseActionProvider implements ActionProvider {
150
    public static interface ActionPropertiesProvider {
151
        Properties getProperties();
152
    }
153
    
150
    public static final String AUTOMATIC_BUILD_TAG = ".netbeans_automatic_build";
154
    public static final String AUTOMATIC_BUILD_TAG = ".netbeans_automatic_build";
151
155
152
    private static final Logger LOG = Logger.getLogger(BaseActionProvider.class.getName());
156
    private static final Logger LOG = Logger.getLogger(BaseActionProvider.class.getName());
Lines 417-423 Link Here
417
                    return;
421
                    return;
418
                }
422
                }
419
                called.set(true);
423
                called.set(true);
420
                Properties p = new Properties();
424
                Properties p = getProperties(context);
421
                String[] targetNames;
425
                String[] targetNames;
422
426
423
                targetNames = getTargetNames(command, context, p, doJavaChecks);
427
                targetNames = getTargetNames(command, context, p, doJavaChecks);
Lines 429-435 Link Here
429
                        showBuildActionWarning(context);
433
                        showBuildActionWarning(context);
430
                        return ;
434
                        return ;
431
                    }
435
                    }
432
                    Map<String, Object> execProperties = new HashMap<String, Object>();
436
                    Map<String, Object> execProperties = getPropertiesMap(context);
433
437
434
                    copyMultiValue(ProjectProperties.RUN_JVM_ARGS, execProperties);
438
                    copyMultiValue(ProjectProperties.RUN_JVM_ARGS, execProperties);
435
                    prepareWorkDir(execProperties);
439
                    prepareWorkDir(execProperties);
Lines 1902-1905 Link Here
1902
        return result;
1906
        return result;
1903
    }
1907
    }
1904
    
1908
    
1909
    private static Properties getProperties(Lookup context) {
1910
        ActionPropertiesProvider app = context.lookup(ActionPropertiesProvider.class);
1911
        Properties props = new Properties();
1912
        if (app != null) { 
1913
            props.putAll(app.getProperties());
1914
        }
1915
        return props;
1916
    }
1917
    
1918
    private static Map<String, Object> getPropertiesMap(Lookup context) {
1919
        Properties props = getProperties(context);
1920
        
1921
        Map<String, Object> map = new HashMap<String, Object>();
1922
        for(Map.Entry<Object, Object> e : props.entrySet()) {
1923
            Object k = e.getKey();
1924
            Object v = e.getValue();
1925
            if (k != null && k instanceof String) {
1926
                map.put((String)k, v);
1927
            }
1928
        }
1929
        
1930
        return map;
1931
    }
1905
}
1932
}

Return to bug 206931