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 import com.sun.star.beans.Property;
24 import com.sun.star.beans.PropertyValue;
25 
26 public class SwingUnoPropertyNode extends SwingUnoNode implements XUnoPropertyNode{
27 
28     private UnoPropertyNode m_oUnoPropertyNode = null;
29 
30 
SwingUnoPropertyNode(Property _aProperty, Object _oUnoObject, Object _oUnoReturnObject)31     public SwingUnoPropertyNode(Property _aProperty, Object _oUnoObject, Object _oUnoReturnObject) {
32         super(_oUnoObject);
33         m_oUnoPropertyNode = new UnoPropertyNode(_aProperty, _oUnoObject, _oUnoReturnObject);
34         super.setUserObject(m_oUnoPropertyNode.getLabel());
35         setFoldable(m_oUnoPropertyNode.isFoldable());
36     }
37 
38 
SwingUnoPropertyNode(Property _aProperty)39     public SwingUnoPropertyNode(Property _aProperty){
40         super(null);
41         m_oUnoPropertyNode = new UnoPropertyNode(_aProperty);
42     }
43 
44 
SwingUnoPropertyNode(PropertyValue _aPropertyValue, Object _oUnoObject, Object _oUnoReturnObject)45     public SwingUnoPropertyNode(PropertyValue _aPropertyValue, Object _oUnoObject, Object _oUnoReturnObject) {
46         super(_oUnoObject);
47         m_oUnoPropertyNode = new UnoPropertyNode(_aPropertyValue, _oUnoObject, _oUnoReturnObject);
48     }
49 
getName()50     public String getName(){
51         return m_oUnoPropertyNode.getName();
52     }
53 
54 
getUnoReturnObject()55     public Object getUnoReturnObject(){
56         return m_oUnoPropertyNode.getUnoReturnObject();
57     }
58 
59 
getClassName()60     public String getClassName(){
61         String sClassName = m_oUnoPropertyNode.getClassName();
62         if (sClassName.equals("")){
63             sClassName = super.getClassName();
64         }
65         return sClassName;
66     }
67 
getAnchor()68     public String getAnchor(){
69         return m_oUnoPropertyNode.getAnchor();
70     }
71 
getPropertyNodeType()72     public int getPropertyNodeType(){
73         return m_oUnoPropertyNode.getPropertyNodeType();
74     }
75 
76 
setPropertyNodeType(int _nPropertyType)77     public void setPropertyNodeType(int _nPropertyType){
78         m_oUnoPropertyNode.setPropertyNodeType(_nPropertyType);
79     }
80 
getProperty()81     public Property getProperty(){
82         return m_oUnoPropertyNode.getProperty();
83     }
84 
85 }
86