1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
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
;
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
39 public class PropertyHandlerImpl
implements XPropertyHandler
{
41 /** Creates a new instance of PropertyHandlerImpl */
42 public PropertyHandlerImpl() {
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.
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
57 public void actuatingPropertyChanged(
58 String ActuatingPropertyName
,
61 com
.sun
.star
.inspection
.XObjectInspectorUI InspectorUI
,
62 boolean FirstTimeInit
)
63 throws com
.sun
.star
.lang
.NullPointerException
{
67 * This method currently do nothig
68 * @param xEventListener the listener to notify about changes
70 public void addEventListener(com
.sun
.star
.lang
.XEventListener xEventListener
) {
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
78 public void addPropertyChangeListener(com
.sun
.star
.beans
.XPropertyChangeListener xPropertyChangeListener
) throws com
.sun
.star
.lang
.NullPointerException
{
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 .
88 * @throws com.sun.star.beans.UnknownPropertyException ::com::sun::star::beans::UnknownPropertyException if the given property is not supported by the property handler
91 public Object
convertToControlValue(
94 com
.sun
.star
.uno
.Type ControlValueType
)
95 throws com
.sun
.star
.beans
.UnknownPropertyException
{
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
106 public Object
convertToPropertyValue(String PropertyName
, Object ControlValue
) throws com
.sun
.star
.beans
.UnknownPropertyException
{
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
117 * @throws com.sun.star.lang.NullPointerException ::com::sun::star::lang::NullPointerException if ControlFactory is NULL .
119 public LineDescriptor
describePropertyLine(
121 com
.sun
.star
.inspection
.XPropertyControlFactory ControlFactory
)
122 throws com
.sun
.star
.beans
.UnknownPropertyException
,
123 com
.sun
.star
.lang
.NullPointerException
{
128 * This method currently do nothig
130 public void dispose() {
134 * This method currently do nothig
137 public String
[] getActuatingProperties() {
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
147 public com
.sun
.star
.beans
.PropertyState
getPropertyState(String PropertyName
)
148 throws com
.sun
.star
.beans
.UnknownPropertyException
{
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
158 public Object
getPropertyValue(String PropertyName
) throws com
.sun
.star
.beans
.UnknownPropertyException
{
163 * This method currently do nothig
166 public String
[] getSupersededProperties() {
171 * This method currently do nothig
174 public com
.sun
.star
.beans
.Property
[] getSupportedProperties() {
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
183 public void inspect(Object Component
) throws com
.sun
.star
.lang
.NullPointerException
{
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
194 public boolean isComposable(String PropertyName
) throws com
.sun
.star
.beans
.UnknownPropertyException
{
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.
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
209 public com
.sun
.star
.inspection
.InteractiveSelectionResult
onInteractivePropertySelection(
213 com
.sun
.star
.inspection
.XObjectInspectorUI InspectorUI
)
214 throws com
.sun
.star
.beans
.UnknownPropertyException
,
215 com
.sun
.star
.lang
.NullPointerException
{
220 * This method currently do nothig
221 * @param xEventListener the listener to be revoked
223 public void removeEventListener(com
.sun
.star
.lang
.XEventListener xEventListener
) {
227 * This method currently do nothig
228 * @param xPropertyChangeListener the listener to be revoke
230 public void removePropertyChangeListener(com
.sun
.star
.beans
.XPropertyChangeListener xPropertyChangeListener
) {
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
239 public void setPropertyValue(String PropertyName
, Object Value
) throws com
.sun
.star
.beans
.UnknownPropertyException
{
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.
247 public boolean suspend(boolean Suspend
) {
252 * This method currently do nothig
255 public void describePropertyLine(String string
, LineDescriptor
[] lineDescriptor
, XPropertyControlFactory xPropertyControlFactory
) throws UnknownPropertyException
, com
.sun
.star
.lang
.NullPointerException
{