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