public abstract class AbstractMavenActionsProvider extends Object implements MavenActionsProvider
Modifier and Type | Field and Description |
---|---|
protected ActionToGoalMapping |
originalMappings |
protected NetbeansBuildActionXpp3Reader |
reader |
Constructor and Description |
---|
AbstractMavenActionsProvider()
Creates a new instance of DefaultActionProvider
|
Modifier and Type | Method and Description |
---|---|
RunConfig |
createConfigForDefaultAction(String actionName,
Project project,
Lookup lookup)
Create an instance of RunConfig configured for execution.
|
static String |
dynamicSubstitutions(Map<String,String> replaceMap,
String in) |
protected static FileObject[] |
extractFileObjectsfromLookup(Lookup lookup)
just gets the array of FOs from lookup.
|
static MavenActionsProvider |
fromNbActions(Project mavenProject,
URL resourceURL)
Constructs a
MavenActionsProvider from declarative action descriptions. |
protected abstract InputStream |
getActionDefinitionStream()
content of the input stream shall be the xml with action definitions
|
NetbeansActionMapping |
getMappingForAction(String actionName,
Project project)
get a action to maven mapping configuration for the given action.
|
ActionToGoalMapping |
getRawMappings() |
String |
getRawMappingsAsString() |
Set<String> |
getSupportedDefaultActions()
default implementation will look in the content of the
|
boolean |
isActionEnable(String action,
Project project,
Lookup lookup)
return is action is supported or not
|
boolean |
isActionEnable(String action,
String prjPack)
|
protected Reader |
performDynamicSubstitutions(Map<String,String> replaceMap,
String in)
takes the input stream and a map, and for each occurence of
${<mapKey>} , replaces it with map entry value.. |
protected boolean |
reloadStream()
override in children that are listening on changes of model and need refreshing..
|
protected ActionToGoalMapping originalMappings
protected NetbeansBuildActionXpp3Reader reader
public AbstractMavenActionsProvider()
protected static FileObject[] extractFileObjectsfromLookup(Lookup lookup)
lookup
- public boolean isActionEnable(String action, Project project, Lookup lookup)
MavenActionsProvider
isActionEnable
in interface MavenActionsProvider
action
- action name, see ActionProvider for details.project
- project that the action is invoked on.lookup
- context for the actionpublic final boolean isActionEnable(String action, String prjPack)
AbstractMavenActionsProvider.isActionEnable(java.lang.String, org.netbeans.api.project.Project, org.openide.util.Lookup)
.
Avoids redundant and potentially costly packaging retrieval.action
- prjPack
- public final RunConfig createConfigForDefaultAction(String actionName, Project project, Lookup lookup)
MavenActionsProvider
createConfigForDefaultAction
in interface MavenActionsProvider
actionName
- one of the ActionProvider constantspublic ActionToGoalMapping getRawMappings()
public String getRawMappingsAsString()
public Set<String> getSupportedDefaultActions()
getSupportedDefaultActions
in interface MavenActionsProvider
protected boolean reloadStream()
public NetbeansActionMapping getMappingForAction(String actionName, Project project)
getMappingForAction
in interface MavenActionsProvider
actionName
- project
- protected abstract InputStream getActionDefinitionStream()
protected Reader performDynamicSubstitutions(Map<String,String> replaceMap, String in) throws IOException
${<mapKey>}
, replaces it with map entry value..replaceMap
- in
- IOException
public static String dynamicSubstitutions(Map<String,String> replaceMap, String in)
public static MavenActionsProvider fromNbActions(Project mavenProject, URL resourceURL)
MavenActionsProvider
from declarative action descriptions. The
resourceURL
parameter identifies a nbactions.xml
-format resource which
can add/define actions in the default configuration. It can also contribute
configurations (profiles) using the nested <profile>
element.
Actions in the contributed configuration profiles are merged; multiple MavenActionsProvider
s
created by AbstractMavenActionsProvider.fromNbActions(org.netbeans.api.project.Project, java.net.URL)
can supply their
actions. The first definition of a given actionName
counts, subsequent definitions from
MavenActionsProvider
further in the project's Lookup are ignored.
Note: at the moment it is not possible to build the default configuration actions
from multiple MavenActionsProvider
s.
This is a part of Maven module's friend API. If possible, use se MavenActions to register actions declaratively, using module layers.
mavenProject
- the maven project.resourceURL
- action definitions.MavenActionsProvider
instance.