public abstract class MacroRegistry
extends java.lang.Object
The MacroRegistry stores MacroExpander instances, which are capable of translating specific, escaped macro strings (e.g. "${mymacro}") into context specific strings (e.g. "c:\currently\selected\File.java").
You can use the macro registry to query registered MacroExpanders, register additional MacroExpanders, or to actually carry out macro expansion on a given string for a given context.
This class should not be subclassed by extension writers.
Constructor and Description |
---|
MacroRegistry() |
Modifier and Type | Method and Description |
---|---|
abstract void |
deregister(MacroExpander expander)
Deprecated.
since 11.0. No replacement.
|
java.lang.String |
expand(java.lang.String inputString,
Context context)
Expand macros in the specified String for the specified IDE context, and
return a String containing expanded macros.
|
abstract java.lang.String |
expand(java.lang.String inputString,
Context context,
boolean isSample)
Expand macros in the specified String for the specified IDE context, and
return a String containing expanded macros.
|
abstract MacroExpander |
findMacro(java.lang.String moniker)
Finds the macro with the specified moniker (name).
|
abstract java.util.Collection<MacroExpander> |
getMacros()
Get all registered macros.
|
abstract MacroPicker |
getPicker(ExternalToolType type,
boolean onlyDirectories)
Get the macro picker UI.
|
MacroTextField |
getTextField(ExternalToolType type,
boolean onlyDirectories)
Get a completion-insight enabled text field for this registry.
|
java.util.Iterator<MacroExpander> |
iterator()
Deprecated.
since 11.0. use getMacros().iterator().
|
abstract void |
register(MacroExpander expander)
Deprecated.
since 11.0. Register macros using the <externaltools>
section of the extension manifest.
|
public abstract MacroExpander findMacro(java.lang.String moniker)
moniker
- the moniker to find. Must not be null.public java.util.Iterator<MacroExpander> iterator()
public abstract java.util.Collection<MacroExpander> getMacros()
public abstract void register(MacroExpander expander)
expander
- the expander to registerpublic abstract void deregister(MacroExpander expander)
expander
- the expander to deregisterpublic abstract java.lang.String expand(java.lang.String inputString, Context context, boolean isSample)
inputString
- the string to expandcontext
- the IDE context to use for macro expansionpublic java.lang.String expand(java.lang.String inputString, Context context)
inputString
- the string to expandcontext
- the IDE context to use for macro expansionpublic abstract MacroPicker getPicker(ExternalToolType type, boolean onlyDirectories)
type
- the external tool type to get a picker foronlyDirectories
- if true, only directory macros will be displayed.public MacroTextField getTextField(ExternalToolType type, boolean onlyDirectories)
type
- if not null, the available macros will be filtered
to only show macros for the specified external tool typeonlyDirectories
- if true, only directory based macros will be
displayed