Java Doc for Components.java in  » Testing » jacareto » jacareto » comp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jacareto » jacareto.comp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   jacareto.system.EnvironmentMember
      jacareto.comp.Components

Components
public class Components extends EnvironmentMember implements PopUpCatcherObserver(Code)
This class provides access mechanisms and utilities for sets of component trees. You can add whole component trees by calling the addTree()-methods. If a component has been added, it is known. Known components can be included or not. Excluded components will never be considered by this instance. If a component is included, it can be enabled for capturing or not. That means, only events on known, included and enabled components will be handled during a capture process. The different attributes have the following sense: all components which are new (because they have popped up recently) are not known by the Components instance. They must be added first. Those components can belong to the capture&replay application itself and should therefore be ignored (you do not want to capture events on the capture&replay application like CleverPHL). Those components must be excluded. Some components of the application whose events you are capturing should perhaps not be considered during the capture process. Those components are known, included, but disabled for capturing.

You can hide all known, included components by calling the method Components.hideAllComponents() . It does not matter if the component is enabled or disabled; all known, included components will be hidden. Before you call this method, you should call the method Components.saveVisibility() to store the visibility status of all known, included components. After hiding them you can restore the state before hiding by calling the method Components.restoreVisibility() .

All components which are known and included will get a name. This name is the name of the component's parent, succeeded by a dot, the name of the component delivered by its handler, and a number surrounded by a prefix and a suffix string.


author:
   Thomas Leonhard
author:
   Christian Spannagel (Version 1.1)
version:
   1.21


Field Summary
final public static  intINIT_CUSTOM
     Load the component handlers from the customization at the beginning.
final public static  intINIT_EMPTY
     The components instance should have no handlers at the beginning.

Constructor Summary
public  Components(Environment env, int init, ClassLoader classLoader)
     Creates a new Components instance.
public  Components(Environment env, int init)
     Creates a new Components instance.

Method Summary
public  voidaddComponentHandler(ComponentHandler compHandler, int priority)
     Registers a component handler with the specified priority.
public  voidaddComponentHandler(ComponentHandler compHandler)
     Registers a component handler with the lowest priority.
public  voidaddComponentsListener(ComponentsListener listener)
     Adds a components listeners.
public synchronized  voidaddTree(Component component, boolean isIncluded, boolean isEnabled)
     Adds the whole component tree the specified component belongs to.
public synchronized  voidaddTree(Component component)
     Adds the whole component tree the specified component belongs to.
public synchronized  voidallToFront()
     Puts all included, visible components to the front.
public synchronized  voiddetectComponents(boolean isIncluded, boolean isEnabled)
     This method tries to detect new components which are not known yet.
public  voidfireComponentsEvent(ComponentsEvent event)
     Fires a components event to all registered listeners.
public  WindowgetActiveIncludedRoot()
     Returns the active included root.
public static  StringgetClassName(Object component)
     Returns the source class name belonging to a component.
public synchronized  ComponentgetComponent(String componentName)
     Returns the component belonging to a given component's name.
public synchronized  ComponentgetComponentByUserDefinedName(String userDefinedName)
     This method can be used if the method getComponent (String) has failed.
public  ComponentListenergetComponentListener()
     Returns the component listener.
public  ComponentSelectiongetComponentSelection()
    
public  ComponentWatchergetComponentWatcher()
    
public  ComponentHandlergetFirstComponentHandler(Component comp)
     Returns the first component handler which feels responsible for the given component.
public  GlassPaneManagergetGlassPaneManager()
    
public  SetgetIncludedRoots()
     Returns the included roots.
public synchronized  StringgetIndicatorString(Component component)
     Returns the an indicator string of a given component.
public  SetgetJacaretoNames()
     Returns all Jacareto names.
public  ComponentModegetMode()
     Returns the component mode.
public synchronized  StringgetName(Component component)
     Returns the name of a given component.
public  HashtablegetNameToItem()
    
public  SetgetNames()
     Returns the names of all known and included components as set.
public  ComponentgetRoot(Component component)
     Returns the root component of the component tree of a given component.
public  StringgetUserDefinedName(String jacaretoName)
     Returns a user defined name for a given Jacareto name, or null if there is no user defined name.
public  HashtablegetUserDefinedNames()
     Returns a hashtable which maps Jacareto names to user defined names.
public  WindowgetWindow(Component comp)
     Returns the window a given component belongs to.
public  voidhandlePopUp(Window window)
     This function will be called by the pop up catcher when a window has been opened.
public synchronized  voidhideAllComponents()
     Hides all known components (except the excluded ones).
public  EnumerationincludedRoots()
     Returns an enumeration on all included roots.
public synchronized  booleanisEnabled(Component component)
     Returns whether the specified component is enabled or not.
public synchronized  booleanisEnabled(String componentName)
     Returns whether the component specified by its name is enabled or not.
public synchronized  booleanisIncluded(Component component)
     Returns whether or not a given component is included.
public synchronized  booleanisIncluded(String componentName)
     Returns whether the component specified by its name is included or not.
public synchronized  booleanisKnown(Component component)
     Returns whether the specified component is known or not.
public synchronized  booleanisKnown(String componentName)
     Returns whether the component with the specified component's name is known or not.
public  voidprintRootNames()
     Prints all root names.
public synchronized  voidremoveAll()
     Disposes all components known by this instance which are included and clears the tree model.
public  voidremoveComponentsListener(ComponentsListener listener)
     Removes a components listeners.
public  voidrenameOnlyVisibleWindowMatchingTo(String targetName)
     Tries to find a window for a window's Jacareto name which has the same class and is the only one of this class which is visible.
public synchronized  voidrestoreVisibility()
     Restores the visibility status of all included components (whether they are visible or not) stored with the method Components.saveVisibility() .
public synchronized  voidsaveVisibility()
     Saves the visibility status of all included components (whether they are visible or not).
public  voidsetDebugPrinting(boolean isDebugPrinting)
     Sets whether or not debug messages should be printed.
public synchronized  voidsetEnabled(Component component, boolean isEnabled)
     Enables or disables a component for capturing.
public synchronized  voidsetEnabled(String componentName, boolean isEnabled)
     Enables or disabled a component for capturing specified by its name.
public  voidsetListeningToPopUps(boolean isListeningToPopUps)
     Defines whether this instance should listen to window pop ups or not.
public  voidsetMode(ComponentMode mode)
     Sets the component mode.
public  voidsetNameToItem(Hashtable hashtable)
    
public synchronized  voidsetSubTreeEnabled(Component component, boolean isEnabled)
     Enabled or disabled a component and its whole subtree.
public synchronized  voidsetSubTreeEnabled(String componentName, boolean isEnabled)
     Enables or disabled a component and its whole subtree specified by the component's name.
public  voidsetUserDefinedName(String jacaretoName, String userDefinedName)
     Sets the user defined name for a given component.
public synchronized  voidsetVisible(Component component, boolean isVisible)
     Makes a component visible or not.
public  voidtoFront(Component comp)
     Puts a component and the whole tree this component is contained in to the front.
public  StringtoString()
     Returns a string representation of this instance.
public synchronized  voidupdate()
     Updates the information hold by this instance top down.
public synchronized  voidvalidatePath(String componentName)
     Validates a path from a component to its root from bottom up.

Field Detail
INIT_CUSTOM
final public static int INIT_CUSTOM(Code)
Load the component handlers from the customization at the beginning.



INIT_EMPTY
final public static int INIT_EMPTY(Code)
The components instance should have no handlers at the beginning.




Constructor Detail
Components
public Components(Environment env, int init, ClassLoader classLoader)(Code)
Creates a new Components instance. The component handlers are loaded by the given class loader.
Parameters:
  env - the environment.
Parameters:
  init - defines where to get the initial values from (Components.INIT_CUSTOM or Components.INIT_EMPTY)
Parameters:
  classLoader - the class loader which loads the component handlers



Components
public Components(Environment env, int init)(Code)
Creates a new Components instance. The component handlers are loaded by the default class loader.
Parameters:
  env - the environment.
Parameters:
  init - defines where to get the initial values from (Components.INIT_CUSTOM or Components.INIT_EMPTY)




Method Detail
addComponentHandler
public void addComponentHandler(ComponentHandler compHandler, int priority)(Code)
Registers a component handler with the specified priority. A greater value of priority symbolizes a higher priority.
Parameters:
  compHandler - the component handler to add
Parameters:
  priority - the priority



addComponentHandler
public void addComponentHandler(ComponentHandler compHandler)(Code)
Registers a component handler with the lowest priority.
Parameters:
  compHandler - the component handler to add



addComponentsListener
public void addComponentsListener(ComponentsListener listener)(Code)
Adds a components listeners.
Parameters:
  listener - DOCUMENT ME!



addTree
public synchronized void addTree(Component component, boolean isIncluded, boolean isEnabled)(Code)
Adds the whole component tree the specified component belongs to. You can choose whether or not the added components should be included. If they are included, you can specify whether or not they should be enabled for capturing. If they are excluded, the value of isEnabled will not be taken into account.
Parameters:
  component - the component
Parameters:
  isIncluded - whether or not the components should be included
Parameters:
  isEnabled - true if all added components should be enabled, otherwisefalse.



addTree
public synchronized void addTree(Component component)(Code)
Adds the whole component tree the specified component belongs to. Afterwards all added components will be known, included and enabled for capturing.
Parameters:
  component - the component



allToFront
public synchronized void allToFront()(Code)
Puts all included, visible components to the front.



detectComponents
public synchronized void detectComponents(boolean isIncluded, boolean isEnabled)(Code)
This method tries to detect new components which are not known yet. All components belonging to the windows will be added with the specified attributes.
Parameters:
  isIncluded - whether or not the new components will be included
Parameters:
  isEnabled - whether or not the new components will be enabled for capturing. (onlytaken into account if they ae included)



fireComponentsEvent
public void fireComponentsEvent(ComponentsEvent event)(Code)
Fires a components event to all registered listeners.
Parameters:
  event - DOCUMENT ME!



getActiveIncludedRoot
public Window getActiveIncludedRoot()(Code)
Returns the active included root. the active included root, or null if no included root is active



getClassName
public static String getClassName(Object component)(Code)
Returns the source class name belonging to a component. If the component is an instance of an inner class, the superclass will be taken if there is one.
Parameters:
  component - DOCUMENT ME! DOCUMENT ME!



getComponent
public synchronized Component getComponent(String componentName)(Code)
Returns the component belonging to a given component's name.
Parameters:
  componentName - the name the component belonging to the specified name, or null if there is nocomponent with that name.



getComponentByUserDefinedName
public synchronized Component getComponentByUserDefinedName(String userDefinedName)(Code)
This method can be used if the method getComponent (String) has failed. This method tries to find the component by the user defined name.
Parameters:
  userDefinedName - DOCUMENT ME! the component, or null if the component could not be found



getComponentListener
public ComponentListener getComponentListener()(Code)
Returns the component listener. DOCUMENT ME!



getComponentSelection
public ComponentSelection getComponentSelection()(Code)
Returns the component selection the component selection



getComponentWatcher
public ComponentWatcher getComponentWatcher()(Code)
Returns the component watcher the component watcher



getFirstComponentHandler
public ComponentHandler getFirstComponentHandler(Component comp)(Code)
Returns the first component handler which feels responsible for the given component. If no component handler is responsible, null will be returned.
Parameters:
  comp - the component the first handler which feels responsible, or null if no handler isresponsible.



getGlassPaneManager
public GlassPaneManager getGlassPaneManager()(Code)
Returns the glass pane manager the manager for glass panes



getIncludedRoots
public Set getIncludedRoots()(Code)
Returns the included roots. DOCUMENT ME!



getIndicatorString
public synchronized String getIndicatorString(Component component)(Code)
Returns the an indicator string of a given component. This is a string which allows for identifiing the component more easily (for example, the text of the menu item or anything like this). If the component is not known by this instance, it will be added to it (and the whole component tree the component belongs to.) In this case all added components will be included and enabled for capturing afterwards.
Parameters:
  component - the component the indicator string, or null if the component's name cannot bedetermined or if the component does not have an indicator



getJacaretoNames
public Set getJacaretoNames()(Code)
Returns all Jacareto names. DOCUMENT ME!



getMode
public ComponentMode getMode()(Code)
Returns the component mode. the mode



getName
public synchronized String getName(Component component)(Code)
Returns the name of a given component. If the component is not known by this instance, it will be added to it (and the whole component tree the component belongs to.) In this case all added components will be included and enabled for capturing afterwards.
Parameters:
  component - the component the component's name, or null if the component's name cannot bedetermined



getNameToItem
public Hashtable getNameToItem()(Code)
DOCUMENT ME! HashTable



getNames
public Set getNames()(Code)
Returns the names of all known and included components as set. DOCUMENT ME!



getRoot
public Component getRoot(Component component)(Code)
Returns the root component of the component tree of a given component. This method uses the jacareto.comp.ComponentHandler.getParent(Component) method for determing the root component.
Parameters:
  component - The component the root



getUserDefinedName
public String getUserDefinedName(String jacaretoName)(Code)
Returns a user defined name for a given Jacareto name, or null if there is no user defined name.
Parameters:
  jacaretoName - DOCUMENT ME! DOCUMENT ME!



getUserDefinedNames
public Hashtable getUserDefinedNames()(Code)
Returns a hashtable which maps Jacareto names to user defined names. DOCUMENT ME!



getWindow
public Window getWindow(Component comp)(Code)
Returns the window a given component belongs to. If the specified component is a window itself, the method will return the component.
Parameters:
  comp - The component the window, or null if there is no window (can this be?)



handlePopUp
public void handlePopUp(Window window)(Code)
This function will be called by the pop up catcher when a window has been opened. The specified window will be added if it is not already known. All components belonging to the window will also be added. All added components will be initially enabled for capturing.
Parameters:
  window - the window which has popped up



hideAllComponents
public synchronized void hideAllComponents()(Code)
Hides all known components (except the excluded ones). If you want to restore the actual visibility status later on with the method Components.restoreVisibility() , you should call the method Components.saveVisibility() before hiding the components.



includedRoots
public Enumeration includedRoots()(Code)
Returns an enumeration on all included roots. DOCUMENT ME!



isEnabled
public synchronized boolean isEnabled(Component component)(Code)
Returns whether the specified component is enabled or not. If the component is not known, it will be added to the components before (and the whole tree it belongs to, too). All those components will be initially included and enabled.
Parameters:
  component - the component to test true if it is enabled, false if it is excluded



isEnabled
public synchronized boolean isEnabled(String componentName)(Code)
Returns whether the component specified by its name is enabled or not.
Parameters:
  componentName - the name of the component to test true if it is enabled, false if it is enabled or if thecomponent's name is unknown



isIncluded
public synchronized boolean isIncluded(Component component)(Code)
Returns whether or not a given component is included.
Parameters:
  component - DOCUMENT ME! DOCUMENT ME!



isIncluded
public synchronized boolean isIncluded(String componentName)(Code)
Returns whether the component specified by its name is included or not.
Parameters:
  componentName - the name of the component to test true if it is included, false if it is excluded or if thecomponent's name is unknown



isKnown
public synchronized boolean isKnown(Component component)(Code)
Returns whether the specified component is known or not.
Parameters:
  component - the component true if it is known, otherwise false



isKnown
public synchronized boolean isKnown(String componentName)(Code)
Returns whether the component with the specified component's name is known or not.
Parameters:
  componentName - the component's name true if it is known, otherwise false



printRootNames
public void printRootNames()(Code)
Prints all root names.



removeAll
public synchronized void removeAll()(Code)
Disposes all components known by this instance which are included and clears the tree model. After this method has been executed, the instance knows all system wide windows; those windows are ignored.



removeComponentsListener
public void removeComponentsListener(ComponentsListener listener)(Code)
Removes a components listeners.
Parameters:
  listener - DOCUMENT ME!



renameOnlyVisibleWindowMatchingTo
public void renameOnlyVisibleWindowMatchingTo(String targetName)(Code)
Tries to find a window for a window's Jacareto name which has the same class and is the only one of this class which is visible. This method should only be used when a window must not be visible and all other component finding mechanism have failed. It should only be used by WindowReplayers. If just one visible component is found with this class, its component tree is renamed to the new one.
Parameters:
  targetName - DOCUMENT ME!



restoreVisibility
public synchronized void restoreVisibility()(Code)
Restores the visibility status of all included components (whether they are visible or not) stored with the method Components.saveVisibility() . If that method has never been invoked before, the components will be visible if and only if they had been visible at the moment they've been added to the components instance. Windows which are made visible by this method will also be opened. This method will not touch forbidden components.



saveVisibility
public synchronized void saveVisibility()(Code)
Saves the visibility status of all included components (whether they are visible or not). This status will be restored with the method Components.restoreVisibility() .



setDebugPrinting
public void setDebugPrinting(boolean isDebugPrinting)(Code)
Sets whether or not debug messages should be printed.
Parameters:
  isDebugPrinting - DOCUMENT ME!



setEnabled
public synchronized void setEnabled(Component component, boolean isEnabled)(Code)
Enables or disables a component for capturing. If the component is not known, it will be added to the components first (and the whole component tree it belongs to). In this case the added components will be included and enabled for capturing afterwards.
Parameters:
  component - the component to be enabled/disabled
Parameters:
  isEnabled - true if the component should be enabled; otherwisefalse



setEnabled
public synchronized void setEnabled(String componentName, boolean isEnabled)(Code)
Enables or disabled a component for capturing specified by its name.
Parameters:
  componentName - the name of the component to be enabled/disabled
Parameters:
  isEnabled - true if the component should be enabled; otherwisefalse



setListeningToPopUps
public void setListeningToPopUps(boolean isListeningToPopUps)(Code)
Defines whether this instance should listen to window pop ups or not.
Parameters:
  isListeningToPopUps - DOCUMENT ME!



setMode
public void setMode(ComponentMode mode)(Code)
Sets the component mode.
Parameters:
  mode - the component mode.



setNameToItem
public void setNameToItem(Hashtable hashtable)(Code)
DOCUMENT ME!
Parameters:
  hashtable -



setSubTreeEnabled
public synchronized void setSubTreeEnabled(Component component, boolean isEnabled)(Code)
Enabled or disabled a component and its whole subtree. If the component is not known, it will be added to the components first (and the whole tree it belongs to, too). In this case all added components will be included and enabled for capturing at first; the given component and its subtree will be then set to the given enabled state.
Parameters:
  component - the component to be enabled/disabled
Parameters:
  isEnabled - true if the component and its subtree should be enabled;otherwise false



setSubTreeEnabled
public synchronized void setSubTreeEnabled(String componentName, boolean isEnabled)(Code)
Enables or disabled a component and its whole subtree specified by the component's name.
Parameters:
  componentName - the name of the component to be enabled/disabled
Parameters:
  isEnabled - true if the component and its subtree should be enabled;otherwise false



setUserDefinedName
public void setUserDefinedName(String jacaretoName, String userDefinedName)(Code)
Sets the user defined name for a given component.
Parameters:
  jacaretoName - DOCUMENT ME!
Parameters:
  userDefinedName - DOCUMENT ME!



setVisible
public synchronized void setVisible(Component component, boolean isVisible)(Code)
Makes a component visible or not.
Parameters:
  component - the component
Parameters:
  isVisible - whether the component is visible or not



toFront
public void toFront(Component comp)(Code)
Puts a component and the whole tree this component is contained in to the front. The given component must not be a window.
Parameters:
  comp - the component to put to the front.



toString
public String toString()(Code)
Returns a string representation of this instance. a string containing information of this instance.



update
public synchronized void update()(Code)
Updates the information hold by this instance top down. Updates the component trees already known and detects and adds new components. The added components will be included and enabled for capturing.



validatePath
public synchronized void validatePath(String componentName)(Code)
Validates a path from a component to its root from bottom up. This method should be called if a component could not be found after this instance has been udpated with the update()-method. This method searches from the location of the component not found upwards until a known parent has been found. Then the whole tree of the parent's first child component which is also parent of the desired component will be renamed.
Parameters:
  componentName - DOCUMENT ME!



Fields inherited from jacareto.system.EnvironmentMember
protected Customization customization(Code)(Java Doc)
protected Environment env(Code)(Java Doc)
protected Files files(Code)(Java Doc)
protected Language language(Code)(Java Doc)
protected Logger logger(Code)(Java Doc)

Methods inherited from jacareto.system.EnvironmentMember
public Customization getCustomization()(Code)(Java Doc)
public Environment getEnvironment()(Code)(Java Doc)
public Files getFiles()(Code)(Java Doc)
public Language getLanguage()(Code)(Java Doc)
public Logger getLogger()(Code)(Java Doc)
public void setEnvironment(Environment env)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.