1 /*
2  * This file is part of the LibreOffice project.
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  *
8  * This file incorporates work covered by the following license notice:
9  *
10  *   Licensed to the Apache Software Foundation (ASF) under one or more
11  *   contributor license agreements. See the NOTICE file distributed
12  *   with this work for additional information regarding copyright
13  *   ownership. The ASF licenses this file to you under the Apache
14  *   License, Version 2.0 (the "License"); you may not use this file
15  *   except in compliance with the License. You may obtain a copy of
16  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
17  */
18 package helper;
19 
20 import com.sun.star.inspection.LineDescriptor;
21 import com.sun.star.inspection.XPropertyHandler;
22 
23 /**
24  * This implementation of <CODE>PropertyHandler</CODE> does currently nothing.
25  * All methods are implemented, but not filled with content.
26  * @see com.sun.star.inspection.XPropertyHandler
27  */
28 public class PropertyHandlerImpl implements XPropertyHandler{
29 
30     /**
31      * This method currently does nothing
32      * @param ActuatingPropertyName the id of the actuating property.
33      * @param NewValue the new value of the property
34      * @param OldValue the old value of the property
35      * @param InspectorUI a callback for updating the object inspector UI
36      * @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.
37      * If false , there was a real ::com::sun::star::beans::XPropertyChangeListener::propertyChange event which triggered the call.
38      *
39      * 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 definitely not do this when FirstTimeInit is true .
40      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if InspectorUI is NULL
41      */
actuatingPropertyChanged( String ActuatingPropertyName, Object NewValue, Object OldValue, com.sun.star.inspection.XObjectInspectorUI InspectorUI, boolean FirstTimeInit)42     public void actuatingPropertyChanged(
43             String ActuatingPropertyName,
44             Object NewValue,
45             Object OldValue,
46             com.sun.star.inspection.XObjectInspectorUI InspectorUI,
47             boolean FirstTimeInit)
48             throws com.sun.star.lang.NullPointerException {
49     }
50 
51     /**
52      * This method currently does nothing
53      * @param xEventListener the listener to notify about changes
54      */
addEventListener(com.sun.star.lang.XEventListener xEventListener)55     public void addEventListener(com.sun.star.lang.XEventListener xEventListener) {
56     }
57 
58     /**
59      * This method currently does nothing
60      * @param xPropertyChangeListener the listener to notify about property changes
61      * @throws com.sun.star.lang.NullPointerException com::sun::star::lang::NullPointerException if the listener is NULL
62      */
addPropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener)63     public void addPropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) throws com.sun.star.lang.NullPointerException {
64     }
65 
66     /**
67      * This method currently does nothing
68      * @param PropertyName The name of the property whose value is to be converted.
69      * @param PropertyValue The to-be-converted property value.
70      * @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 .
71      *    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 .
72      *
73      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
74      * @return null
75      */
convertToControlValue( String PropertyName, Object PropertyValue, com.sun.star.uno.Type ControlValueType)76     public Object convertToControlValue(
77             String PropertyName,
78             Object PropertyValue,
79             com.sun.star.uno.Type ControlValueType)
80             throws com.sun.star.beans.UnknownPropertyException {
81         return null;
82     }
83 
84     /**
85      * This method currently does nothing
86      * @param PropertyName The name of the conversion's target property.
87      * @param ControlValue The to-be-converted control value. This value has been obtained from an XPropertyControl , using its Value attribute.
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      */
convertToPropertyValue(String PropertyName, Object ControlValue)91     public Object convertToPropertyValue(String PropertyName, Object ControlValue) throws com.sun.star.beans.UnknownPropertyException {
92         return null;
93     }
94 
95     /**
96      * This method currently does nothing
97      * @param PropertyName the name of the property whose user interface is to be described
98      * @param ControlFactory a factory for creating XPropertyControl instances. Must not be NULL .
99      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by this handler
100      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if ControlFactory is NULL .
101      */
describePropertyLine( String PropertyName, com.sun.star.inspection.XPropertyControlFactory ControlFactory)102     public LineDescriptor describePropertyLine(
103             String PropertyName,
104             com.sun.star.inspection.XPropertyControlFactory ControlFactory)
105             throws com.sun.star.beans.UnknownPropertyException,
106             com.sun.star.lang.NullPointerException {
107         return null;
108     }
109 
110     /**
111      * This method currently does nothing
112      */
dispose()113     public void dispose() {
114     }
115 
116     /**
117      * This method currently does nothing
118      * @return null
119      */
getActuatingProperties()120     public String[] getActuatingProperties() {
121         return null;
122     }
123 
124     /**
125      * This method currently does nothing
126      * @param PropertyName the name of the property whose state is to be retrieved
127      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
128      * @return null
129      */
getPropertyState(String PropertyName)130     public com.sun.star.beans.PropertyState getPropertyState(String PropertyName)
131     throws com.sun.star.beans.UnknownPropertyException {
132         return null;
133     }
134 
135     /**
136      * This method currently does nothing
137      * @param PropertyName the name of the property whose value is to be retrieved
138      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
139      * @return null
140      */
getPropertyValue(String PropertyName)141     public Object getPropertyValue(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
142         return null;
143     }
144 
145     /**
146      * This method currently does nothing
147      * @return null
148      */
getSupersededProperties()149     public String[] getSupersededProperties() {
150         return null;
151     }
152 
153     /**
154      * This method currently does nothing
155      * @return null
156      */
getSupportedProperties()157     public com.sun.star.beans.Property[] getSupportedProperties() {
158         return null;
159     }
160 
161     /**
162      * This method currently does nothing
163      * @param Component the component to inspect. Must not be NULL
164      * @throws com.sun.star.lang.NullPointerException com::sun::star::lang::NullPointerException if the component is NULL
165      */
inspect(Object Component)166     public void inspect(Object Component) throws com.sun.star.lang.NullPointerException {
167     }
168 
169     /**
170      * This method currently does nothing
171      * @param PropertyName the name of the property whose composability is to be determined
172      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
173      *
174      *
175      * @return null
176      */
isComposable(String PropertyName)177     public boolean isComposable(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
178         return false;
179     }
180 
181     /**
182      * This method currently does nothing
183      * @param PropertyName The name of the property whose browse button has been clicked
184      * @param Primary true if and only if the primary button has been clicked, false otherwise
185      * @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.
186      * @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.
187      *
188      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
189      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if InspectorUI is NULL
190      * @return null
191      */
onInteractivePropertySelection( String PropertyName, boolean Primary, Object[] out_Data, com.sun.star.inspection.XObjectInspectorUI InspectorUI)192     public com.sun.star.inspection.InteractiveSelectionResult onInteractivePropertySelection(
193             String PropertyName,
194             boolean Primary,
195             Object[] out_Data,
196             com.sun.star.inspection.XObjectInspectorUI InspectorUI)
197             throws com.sun.star.beans.UnknownPropertyException,
198             com.sun.star.lang.NullPointerException {
199         return null;
200     }
201 
202     /**
203      * This method currently does nothing
204      * @param xEventListener the listener to be revoked
205      */
removeEventListener(com.sun.star.lang.XEventListener xEventListener)206     public void removeEventListener(com.sun.star.lang.XEventListener xEventListener) {
207     }
208 
209     /**
210      * This method currently does nothing
211      * @param xPropertyChangeListener the listener to be revoke
212      */
removePropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener)213     public void removePropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) {
214     }
215 
216     /**
217      * This method currently does nothing
218      * @param PropertyName the name of the property whose value is to be set
219      * @param Value the property value to set
220      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
221      */
setPropertyValue(String PropertyName, Object Value)222     public void setPropertyValue(String PropertyName, Object Value) throws com.sun.star.beans.UnknownPropertyException {
223     }
224 
225     /**
226      * This method currently does nothing
227      * @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.
228      * @return false
229      */
suspend(boolean Suspend)230     public boolean suspend(boolean Suspend) {
231         return false;
232     }
233 
234 }
235