diff --git a/java.api.common/apichanges.xml b/java.api.common/apichanges.xml --- a/java.api.common/apichanges.xml +++ b/java.api.common/apichanges.xml @@ -105,6 +105,22 @@ + + + Added ability to receive action specific properties + + + + + +

+ Added ability to receive action specific properties + when calling ActionProvider.invokeAction(command,lookup) +

+
+ + +
Added methods to track ant invocation diff --git a/java.api.common/manifest.mf b/java.api.common/manifest.mf --- a/java.api.common/manifest.mf +++ b/java.api.common/manifest.mf @@ -1,4 +1,4 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.java.api.common/0 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/api/common/resources/Bundle.properties -OpenIDE-Module-Specification-Version: 1.34 +OpenIDE-Module-Specification-Version: 1.35 diff --git a/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java b/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java --- a/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java +++ b/java.api.common/src/org/netbeans/modules/java/api/common/project/BaseActionProvider.java @@ -147,6 +147,10 @@ * @since org.netbeans.modules.java.api.common/1 1.20 */ public abstract class BaseActionProvider implements ActionProvider { + public static interface ActionPropertiesProvider { + Properties getProperties(); + } + public static final String AUTOMATIC_BUILD_TAG = ".netbeans_automatic_build"; private static final Logger LOG = Logger.getLogger(BaseActionProvider.class.getName()); @@ -417,7 +421,7 @@ return; } called.set(true); - Properties p = new Properties(); + Properties p = getProperties(context); String[] targetNames; targetNames = getTargetNames(command, context, p, doJavaChecks); @@ -429,7 +433,7 @@ showBuildActionWarning(context); return ; } - Map execProperties = new HashMap(); + Map execProperties = getPropertiesMap(context); copyMultiValue(ProjectProperties.RUN_JVM_ARGS, execProperties); prepareWorkDir(execProperties); @@ -1902,4 +1906,27 @@ return result; } + private static Properties getProperties(Lookup context) { + ActionPropertiesProvider app = context.lookup(ActionPropertiesProvider.class); + Properties props = new Properties(); + if (app != null) { + props.putAll(app.getProperties()); + } + return props; + } + + private static Map getPropertiesMap(Lookup context) { + Properties props = getProperties(context); + + Map map = new HashMap(); + for(Map.Entry e : props.entrySet()) { + Object k = e.getKey(); + Object v = e.getValue(); + if (k != null && k instanceof String) { + map.put((String)k, v); + } + } + + return map; + } }