Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.ide.externaltools.macro
Class MacroRegistry

java.lang.Object
  extended by oracle.ide.externaltools.macro.MacroRegistry

public abstract class MacroRegistry
extends java.lang.Object

Macros use information from the current JDeveloper context to pass into or influence the behavior of external tools.

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 Summary
MacroRegistry()
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroRegistry

public MacroRegistry()
Method Detail

findMacro

public abstract MacroExpander findMacro(java.lang.String moniker)
Finds the macro with the specified moniker (name).

Parameters:
moniker - the moniker to find. Must not be null.
Returns:
the macro with the specified moniker, or null if no such macro exists.
Since:
11.0

iterator

public java.util.Iterator<MacroExpander> iterator()
Deprecated. since 11.0. use getMacros().iterator().

Get an iterator over all registered MacroExpanders.

Returns:
an Iterator, the values of which are MacroExpander instances.

getMacros

public abstract java.util.Collection<MacroExpander> getMacros()
Get all registered macros.

Returns:
all registered macros. The collection is not modifiable.
Since:
11.0

register

public abstract void register(MacroExpander expander)
Deprecated. since 11.0. Register macros using the <externaltools> section of the extension manifest.

Register a MacroExpander with the registry.

Parameters:
expander - the expander to register

deregister

public abstract void deregister(MacroExpander expander)
Deprecated. since 11.0. No replacement.

Deregister a previously registered MacroExpander.

Parameters:
expander - the expander to deregister

expand

public 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.

Parameters:
inputString - the string to expand
context - the IDE context to use for macro expansion
Returns:
an string with all the macros expanded.

expand

public 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.

Parameters:
inputString - the string to expand
context - the IDE context to use for macro expansion
Returns:
an string with all the macros expanded.

getPicker

public abstract MacroPicker getPicker(ExternalToolType type,
                                      boolean onlyDirectories)
Get the macro picker UI. This is a panel allowing the user to choose a macro.

Parameters:
type - the external tool type to get a picker for
onlyDirectories - if true, only directory macros will be displayed.

getTextField

public MacroTextField getTextField(ExternalToolType type,
                                   boolean onlyDirectories)
Get a completion-insight enabled text field for this registry.

Parameters:
type - if not null, the available macros will be filtered to only show macros for the specified external tool type
onlyDirectories - if true, only directory based macros will be displayed

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.