merged tag ooo/DEV300_m102
[LibreOffice.git] / toolkit / test / accessibility / ov / ObjectView.java
blob0c96969e733ba12948892de92cb5899b982bfc8f
1 package ov;
3 import javax.swing.JPanel;
5 import com.sun.star.accessibility.XAccessibleContext;
7 /** This is the base class for all object views that can be placed inside an
8 object view container.
10 <p>When provided with a new accessible object the container will call
11 the Create method to create a new instance when certain conditions are
12 met. It then calls SetObject to pass the object to the instance.
13 Finally it calls Update.</p>
15 <p>The SetObject and Update methods may be called for a new object
16 without calling Create first. In this way an existing instance is
17 recycled.</p>
19 abstract public class ObjectView
20 extends JPanel
22 /** This factory method creates a new instance of the (derived) class
23 when the given accessible object supports all necessary features.
24 In the ususal case this will be the support of a specific
25 accessibility interface.
27 static public ObjectView Create (
28 ObjectViewContainer aContainer,
29 XAccessibleContext xContext)
31 return null;
34 public ObjectView (ObjectViewContainer aContainer)
36 maContainer = aContainer;
37 mxContext = null;
40 /** Call this when you want the object to be destroyed. Release all
41 resources when called.
43 public void Destroy ()
47 /** Tell the view to display information for a new accessible object.
48 @param xObject
49 The given object may be null. A typical behaviour in this case
50 would be to display a blank area. But is also possible to show
51 information about the last object.
53 public void SetObject (XAccessibleContext xContext)
55 mxContext = xContext;
56 Update ();
60 /** This is a request of a repaint with the current state of the current
61 object. The current object may or may not be the same as the one
62 when Update() was called the last time.
64 public void Update ()
69 /** Return a string that is used as a title of an enclosing frame.
71 abstract public String GetTitle ();
73 /// Reference to the current object to display information about.
74 protected XAccessibleContext mxContext;
76 protected ObjectViewContainer maContainer;