Extension SDK 10.1.2

oracle.jdeveloper.externaltools.macro
Class MacroRegistry

java.lang.Object
  extended byoracle.jdeveloper.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.


Constructor Summary
MacroRegistry()
           
 
Method Summary
abstract  void deregister(MacroExpander expander)
          Deregister a previously registered MacroExpander.
 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  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.
abstract  java.util.Iterator iterator()
          Get an iterator over all registered MacroExpanders.
abstract  void register(MacroExpander expander)
          Register a MacroExpander with the registry.
 
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

iterator

public abstract java.util.Iterator iterator()
Get an iterator over all registered MacroExpanders.

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

register

public abstract void register(MacroExpander expander)
Register a MacroExpander with the registry.

Parameters:
expander - the expander to register

deregister

public abstract void deregister(MacroExpander expander)
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

Extension SDK

 

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