1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 package helper;
28 
29 import com.sun.star.beans.UnknownPropertyException;
30 import com.sun.star.inspection.LineDescriptor;
31 import com.sun.star.inspection.XPropertyControlFactory;
32 import com.sun.star.inspection.XPropertyHandler;
33 
34 /**
35  * This implementation of <CODE>PropertyHandler</CODE> do currently nothig.
36  * All methods are implemented, but not filled with content.
37  * @see com.sun.star.inspection.XPropertyHandler
38  */
39 public class PropertyHandlerImpl implements XPropertyHandler{
40 
41     /** Creates a new instance of PropertyHandlerImpl */
42     public PropertyHandlerImpl() {
43     }
44 
45     /**
46      * This method currently do nothig
47      * @param ActuatingPropertyName the id of the actuating property.
48      * @param NewValue the new value of the property
49      * @param OldValue the old value of the property
50      * @param InspectorUI a callback for updating the object inspector UI
51      * @param FirstTimeInit If true , the method is called for the first-time update of the respective property, that is, when the property browser is just initializing with the properties of the introspected object.
52      * If false , there was a real ::com::sun::star::beans::XPropertyChangeListener::propertyChange event which triggered the call.
53      *
54      * In some cases it may be necessary to differentiate between both situations. For instance, if you want to set the value of another property when an actuating property's value changed, you should definately not do this when FirstTimeInit is true .
55      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if InspectorUI is NULL
56      */
57     public void actuatingPropertyChanged(
58             String ActuatingPropertyName,
59             Object NewValue,
60             Object OldValue,
61             com.sun.star.inspection.XObjectInspectorUI InspectorUI,
62             boolean FirstTimeInit)
63             throws com.sun.star.lang.NullPointerException {
64     }
65 
66     /**
67      * This method currently do nothig
68      * @param xEventListener the listener to notify about changes
69      */
70     public void addEventListener(com.sun.star.lang.XEventListener xEventListener) {
71     }
72 
73     /**
74      * This method currently do nothig
75      * @param xPropertyChangeListener the listener to notify about property changes
76      * @throws com.sun.star.lang.NullPointerException com::sun::star::lang::NullPointerException if the listener is NULL
77      */
78     public void addPropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) throws com.sun.star.lang.NullPointerException {
79     }
80 
81     /**
82      * This method currently do nothig
83      * @param PropertyName The name of the property whose value is to be converted.
84      * @param PropertyValue The to-be-converted property value.
85      * @param ControlValueType The target type of the conversion. This type is determined by the control which is used to display the property, which in turn is determined by the handler itself in describePropertyLine .
86      *    Speaking strictly, this is passed for convenience only, since every XPropertyHandler implementation should know exactly which type to expect, since it implicitly determined this type in describePropertyLine by creating an appropriate XPropertyControl .
87      *
88      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
89      * @return null
90      */
91     public Object convertToControlValue(
92             String PropertyName,
93             Object PropertyValue,
94             com.sun.star.uno.Type ControlValueType)
95             throws com.sun.star.beans.UnknownPropertyException {
96         return null;
97     }
98 
99     /**
100      * This method currently do nothig
101      * @param PropertyName The name of the conversion's target property.
102      * @param ControlValue The to-be-converted control value. This value has been obtained from an XPropertyControl , using its Value attribute.
103      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
104      * @return null
105      */
106     public Object convertToPropertyValue(String PropertyName, Object ControlValue) throws com.sun.star.beans.UnknownPropertyException {
107         return null;
108     }
109 
110     /**
111      * This method currently do nothig
112      * @param PropertyName the name of the property whose user interface is to be described
113      * @param  out_Descriptor the descriptor of the property line, to be filled by the XPropertyHandler implementation
114      * @param ControlFactory a factory for creating XPropertyControl instances. Must not be NULL .
115      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by this handler
116      *
117      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if ControlFactory is NULL .
118      */
119     public LineDescriptor describePropertyLine(
120             String PropertyName,
121             com.sun.star.inspection.XPropertyControlFactory ControlFactory)
122             throws com.sun.star.beans.UnknownPropertyException,
123             com.sun.star.lang.NullPointerException {
124         return null;
125     }
126 
127     /**
128      * This method currently do nothig
129      */
130     public void dispose() {
131     }
132 
133     /**
134      * This method currently do nothig
135      * @return null
136      */
137     public String[] getActuatingProperties() {
138         return null;
139     }
140 
141     /**
142      * This method currently do nothig
143      * @param PropertyName the name of the property whose state is to be retrieved
144      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
145      * @return null
146      */
147     public com.sun.star.beans.PropertyState getPropertyState(String PropertyName)
148     throws com.sun.star.beans.UnknownPropertyException {
149         return null;
150     }
151 
152     /**
153      * This method currently do nothig
154      * @param PropertyName the name of the property whose value is to be retrieved
155      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
156      * @return null
157      */
158     public Object getPropertyValue(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
159         return null;
160     }
161 
162     /**
163      * This method currently do nothig
164      * @return null
165      */
166     public String[] getSupersededProperties() {
167         return null;
168     }
169 
170     /**
171      * This method currently do nothig
172      * @return null
173      */
174     public com.sun.star.beans.Property[] getSupportedProperties() {
175         return null;
176     }
177 
178     /**
179      * This method currently do nothig
180      * @param Component the component to inspect. Must not be NULL
181      * @throws com.sun.star.lang.NullPointerException com::sun::star::lang::NullPointerException if the component is NULL
182      */
183     public void inspect(Object Component) throws com.sun.star.lang.NullPointerException {
184     }
185 
186     /**
187      * This method currently do nothig
188      * @param PropertyName the name of the property whose composability is to be determined
189      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
190      *
191      *
192      * @return null
193      */
194     public boolean isComposable(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
195         return false;
196     }
197 
198     /**
199      * This method currently do nothig
200      * @param PropertyName The name of the property whose browse button has been clicked
201      * @param Primary true if and only if the primary button has been clicked, false otherwise
202      * @param out_Data If the method returns InteractiveSelectionResult::ObtainedValue , then _rData contains the value which has been interactively obtained from the user, and which still needs to be set at the inspected component.
203      * @param  InspectorUI     provides access to the object inspector UI. Implementations should use this if the property selection requires non-modal user input. In those cases, onInteractivePropertySelection should return InteractiveSelectionResult::Pending , and the UI for (at least) the property whose input is still pending should be disabled.
204      *
205      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
206      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if InspectorUI is NULL
207      * @return null
208      */
209     public com.sun.star.inspection.InteractiveSelectionResult onInteractivePropertySelection(
210             String PropertyName,
211             boolean Primary,
212             Object[] out_Data,
213             com.sun.star.inspection.XObjectInspectorUI InspectorUI)
214             throws com.sun.star.beans.UnknownPropertyException,
215             com.sun.star.lang.NullPointerException {
216         return null;
217     }
218 
219     /**
220      * This method currently do nothig
221      * @param xEventListener the listener to be revoked
222      */
223     public void removeEventListener(com.sun.star.lang.XEventListener xEventListener) {
224     }
225 
226     /**
227      * This method currently do nothig
228      * @param xPropertyChangeListener the listener to be revoke
229      */
230     public void removePropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) {
231     }
232 
233     /**
234      * This method currently do nothig
235      * @param PropertyName the name of the property whose value is to be set
236      * @param Value the property value to set
237      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
238      */
239     public void setPropertyValue(String PropertyName, Object Value) throws com.sun.star.beans.UnknownPropertyException {
240     }
241 
242     /**
243      * This method currently do nothig
244      * @param Suspend Whether the handler is to be suspended true or reactivated ( false ). The latter happens if a handler was successfully suspended, but an external instance vetoed the whole suspension process.
245      * @return false
246      */
247     public boolean suspend(boolean Suspend) {
248         return false;
249     }
250 
251     /**
252      * This method currently do nothig
253      */
254 
255     public void describePropertyLine(String string, LineDescriptor[] lineDescriptor, XPropertyControlFactory xPropertyControlFactory) throws UnknownPropertyException, com.sun.star.lang.NullPointerException {
256     }
257 
258 }
259