abbot
Interface ComponentFinder

All Known Implementing Classes:
DefaultComponentFinder

public interface ComponentFinder

Interface to support looking up existing components based on a number of different criteria.


Method Summary
 void closeWindows()
          Send close events to all available showing windows.
 void disposeWindows()
          Discard all currently available windows.
 void filterComponent(Component comp)
          Don't return the given component in any queries.
 Component findActivePopupMenu(Component invoker)
          Find the active popup menu invoked by the given component.
 Component findComponent(ComponentReference ref)
          Attempt to find the given component.
 Component findMenuItemByName(Component root, String name)
          Look up the first menu item below root with the given title.
 Window findWindow(String nameOrTitle)
          Find the first showing window with a name or title that matches the given string.
 Frame getComponentFrame(Component comp)
          Return the component's owning frame.
 String getComponentName(Component comp)
          Return the component's name.
 Component getComponentParent(Component comp)
          Look up the apparent parent of a component.
 Component[] getComponents(Container c)
          Return all children of the given container, including Windows, MenuElements, and popup menus.
 Window getComponentTitledWindow(Component comp)
          Return the component's nearest owning window with a title.
 Window getComponentWindow(Component comp)
          Returns the parent window for the given component.
 String getComponentWindowTitle(Component comp)
          Return the title of the nearest ancestor window with a title.
 Window[] getRootWindows()
          Returns all available root Windows (those that have no parent).
 Window[] getWindows()
          Returns the set of all available windows.
 Window[] getWindows(Window parent)
          Returns all immediate child windows of the given parent window.
 void ignoreComponent(Component comp)
          Ignore (for the purpose of future lookup) the given component.
 void ignoreExistingComponents()
          Ignore (for the purposes of future lookup) all currently available components.
 boolean isFiltered(Component comp)
          Returns true if the component or its Window ancestor is filtered.
 boolean isShowing(Component c)
          Return whether the given component is showing and ready for input.
 void setFilterEnabled(boolean enable)
          Indicate whether to filter component lists.
 

Method Detail

findComponent

public Component findComponent(ComponentReference ref)
                        throws ComponentNotFoundException,
                               MultipleComponentsFoundException
Attempt to find the given component.

findWindow

public Window findWindow(String nameOrTitle)
                  throws ComponentNotFoundException,
                         MultipleComponentsFoundException
Find the first showing window with a name or title that matches the given string. If a title is given, a regular expression is allowed.

findActivePopupMenu

public Component findActivePopupMenu(Component invoker)
Find the active popup menu invoked by the given component. Returns null if none found.

findMenuItemByName

public Component findMenuItemByName(Component root,
                                    String name)
Look up the first menu item below root with the given title.

getRootWindows

public Window[] getRootWindows()
Returns all available root Windows (those that have no parent).

getWindows

public Window[] getWindows(Window parent)
Returns all immediate child windows of the given parent window.

getWindows

public Window[] getWindows()
Returns the set of all available windows.

getComponents

public Component[] getComponents(Container c)
Return all children of the given container, including Windows, MenuElements, and popup menus.

getComponentParent

public Component getComponentParent(Component comp)
Look up the apparent parent of a component.

getComponentWindow

public Window getComponentWindow(Component comp)
Returns the parent window for the given component. In this context, the parent of a popup menu is its invoker.

getComponentWindowTitle

public String getComponentWindowTitle(Component comp)
Return the title of the nearest ancestor window with a title. If no title is found, return null.

getComponentFrame

public Frame getComponentFrame(Component comp)
Return the component's owning frame. This will only be null in the case of an Applet Dialog, since even a frameless window will have a temporary frame generated for it.

getComponentTitledWindow

public Window getComponentTitledWindow(Component comp)
Return the component's nearest owning window with a title.

getComponentName

public String getComponentName(Component comp)
Return the component's name.

isFiltered

public boolean isFiltered(Component comp)
Returns true if the component or its Window ancestor is filtered.

filterComponent

public void filterComponent(Component comp)
Don't return the given component in any queries. Makes the given component unavailable unless filtering is turned off.

setFilterEnabled

public void setFilterEnabled(boolean enable)
Indicate whether to filter component lists.

ignoreComponent

public void ignoreComponent(Component comp)
Ignore (for the purpose of future lookup) the given component.

ignoreExistingComponents

public void ignoreExistingComponents()
Ignore (for the purposes of future lookup) all currently available components.

disposeWindows

public void disposeWindows()
Discard all currently available windows.

closeWindows

public void closeWindows()
Send close events to all available showing windows.

isShowing

public boolean isShowing(Component c)
Return whether the given component is showing and ready for input.


Copyright © 2002-2003 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge