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 */
38     public PropertyHandlerImpl() {
39     }
40 
41     /**
42      * This method currently do nothig
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      */
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 do nothig
64      * @param xEventListener the listener to notify about changes
65      */
66     public void addEventListener(com.sun.star.lang.XEventListener xEventListener) {
67     }
68 
69     /**
70      * This method currently do nothig
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      */
74     public void addPropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) throws com.sun.star.lang.NullPointerException {
75     }
76 
77     /**
78      * This method currently do nothig
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      */
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 do nothig
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      */
102     public Object convertToPropertyValue(String PropertyName, Object ControlValue) throws com.sun.star.beans.UnknownPropertyException {
103         return null;
104     }
105 
106     /**
107      * This method currently do nothig
108      * @param PropertyName the name of the property whose user interface is to be described
109      * @param  out_Descriptor the descriptor of the property line, to be filled by the XPropertyHandler implementation
110      * @param ControlFactory a factory for creating XPropertyControl instances. Must not be NULL .
111      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by this handler
112      *
113      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if ControlFactory is NULL .
114      */
115     public LineDescriptor describePropertyLine(
116             String PropertyName,
117             com.sun.star.inspection.XPropertyControlFactory ControlFactory)
118             throws com.sun.star.beans.UnknownPropertyException,
119             com.sun.star.lang.NullPointerException {
120         return null;
121     }
122 
123     /**
124      * This method currently do nothig
125      */
126     public void dispose() {
127     }
128 
129     /**
130      * This method currently do nothig
131      * @return null
132      */
133     public String[] getActuatingProperties() {
134         return null;
135     }
136 
137     /**
138      * This method currently do nothig
139      * @param PropertyName the name of the property whose state is to be retrieved
140      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
141      * @return null
142      */
143     public com.sun.star.beans.PropertyState getPropertyState(String PropertyName)
144     throws com.sun.star.beans.UnknownPropertyException {
145         return null;
146     }
147 
148     /**
149      * This method currently do nothig
150      * @param PropertyName the name of the property whose value is to be retrieved
151      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
152      * @return null
153      */
154     public Object getPropertyValue(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
155         return null;
156     }
157 
158     /**
159      * This method currently do nothig
160      * @return null
161      */
162     public String[] getSupersededProperties() {
163         return null;
164     }
165 
166     /**
167      * This method currently do nothig
168      * @return null
169      */
170     public com.sun.star.beans.Property[] getSupportedProperties() {
171         return null;
172     }
173 
174     /**
175      * This method currently do nothig
176      * @param Component the component to inspect. Must not be NULL
177      * @throws com.sun.star.lang.NullPointerException com::sun::star::lang::NullPointerException if the component is NULL
178      */
179     public void inspect(Object Component) throws com.sun.star.lang.NullPointerException {
180     }
181 
182     /**
183      * This method currently do nothig
184      * @param PropertyName the name of the property whose composability is to be determined
185      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
186      *
187      *
188      * @return null
189      */
190     public boolean isComposable(String PropertyName) throws com.sun.star.beans.UnknownPropertyException {
191         return false;
192     }
193 
194     /**
195      * This method currently do nothig
196      * @param PropertyName The name of the property whose browse button has been clicked
197      * @param Primary true if and only if the primary button has been clicked, false otherwise
198      * @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.
199      * @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.
200      *
201      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
202      * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if InspectorUI is NULL
203      * @return null
204      */
205     public com.sun.star.inspection.InteractiveSelectionResult onInteractivePropertySelection(
206             String PropertyName,
207             boolean Primary,
208             Object[] out_Data,
209             com.sun.star.inspection.XObjectInspectorUI InspectorUI)
210             throws com.sun.star.beans.UnknownPropertyException,
211             com.sun.star.lang.NullPointerException {
212         return null;
213     }
214 
215     /**
216      * This method currently do nothig
217      * @param xEventListener the listener to be revoked
218      */
219     public void removeEventListener(com.sun.star.lang.XEventListener xEventListener) {
220     }
221 
222     /**
223      * This method currently do nothig
224      * @param xPropertyChangeListener the listener to be revoke
225      */
226     public void removePropertyChangeListener(com.sun.star.beans.XPropertyChangeListener xPropertyChangeListener) {
227     }
228 
229     /**
230      * This method currently do nothig
231      * @param PropertyName the name of the property whose value is to be set
232      * @param Value the property value to set
233      * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
234      */
235     public void setPropertyValue(String PropertyName, Object Value) throws com.sun.star.beans.UnknownPropertyException {
236     }
237 
238     /**
239      * This method currently do nothig
240      * @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.
241      * @return false
242      */
243     public boolean suspend(boolean Suspend) {
244         return false;
245     }
246 
247     /**
248      * This method currently do nothig
249      */
250 
251     public void describePropertyLine(String string, LineDescriptor[] lineDescriptor, XPropertyControlFactory xPropertyControlFactory) throws UnknownPropertyException, com.sun.star.lang.NullPointerException {
252     }
253 
254 }
255