|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.externaltools.macro.MacroExpander
public abstract class MacroExpander
Macro expanders are registered with the MacroRegistry and can be used to expand macros prior to running external tools.
This interface extends Displayable
. The
getShortLabel()
method
is used when this macro is displayed to users in the external
tools UI. When a longer description of the macro is displayed to users, the
getLongLabel()
method
is used.
The getMacro()
method should be used to return a short string that
will be recognized in input strings as belonging to this macro expander.
For example, if the getMacro() method returns "mymacro", then the sequence
"${mymacro}" will be recognized in input strings as belonging to this
expander. Note that the string should not contain the macro
escape characters "${...}".
Implement the expand( Context )
method to actually expand an
IDE context into a String. Whenever possible, this should happen
automatically, however it's acceptable to display UI (e.g. a prompt) while
expanding a macro - macro expansion occurs just prior to running external
tools.
Constructor Summary | |
---|---|
MacroExpander()
|
Method Summary | |
---|---|
abstract java.lang.String |
expand(Context context)
Expand the specified context into a String. |
javax.swing.Icon |
getIcon()
Get the icon for this macro. |
abstract java.lang.String |
getMacro()
Get the macro string recognized by this expander. |
java.lang.String |
getSampleExpansion(Context context)
Get a sample expansion of this macro. |
java.lang.String |
getToolTipText()
Get the tool tip text for this macro. |
boolean |
isAvailableForType(ExternalToolType type)
Should this macro be made available for external tools of the specified type? |
boolean |
isDirectoryMacro()
Does this macro expand to a directory? Some of the external tools UI provides a restricted list of macros where only directory values can be used. |
java.lang.String |
toMacroString()
Gets the text of this macro exactly as it appears in an unexpanded string. |
java.lang.String |
toString()
Get a string representation of this macro. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Displayable |
---|
getLongLabel, getShortLabel |
Constructor Detail |
---|
public MacroExpander()
Method Detail |
---|
public javax.swing.Icon getIcon()
getIcon
in interface Displayable
public java.lang.String getToolTipText()
getToolTipText
in interface Displayable
public java.lang.String toString()
Displayable.getShortLabel()
.
toString
in interface Displayable
toString
in class java.lang.Object
Object.toString()
,
Displayable.getShortLabel()
public abstract java.lang.String getMacro()
public java.lang.String toMacroString()
This implementation returns "${" +
getMacro()
+ "}"
public boolean isDirectoryMacro()
This implementation returns false.
public java.lang.String getSampleExpansion(Context context)
The simplest implementation of this method just returns the same
result as expand( Context )
.
Because these commmand lines are displayed while the external tools UI is on screen, and are not necessarily related to actually running an external tool, you should avoid displaying UI in this method.
In addition, because this is an example string, you may choose to ignore the specified context and just provide a string that resembles the expansion of this macro.
This implementation just calls expand( Context )
. You should
override this if expand() displays UI or takes a long time.
context
- an IDE context
public abstract java.lang.String expand(Context context)
context
- an IDE context
public boolean isAvailableForType(ExternalToolType type)
This implementation returns true.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |