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 
24 import com.sun.star.reflection.XIdlMethod;
25 import com.sun.star.uno.Type;
26 import com.sun.star.uno.XComponentContext;
27 import javax.swing.tree.DefaultMutableTreeNode;
28 
29 public class UnoFacetteNode extends UnoNode{
30     String m_sFilter = "";
31 
32 
33     /** Creates a new instance of UnoMethodNode */
UnoFacetteNode(Object _oUnoObject)34     public UnoFacetteNode(Object _oUnoObject){
35         super(_oUnoObject);
36         addDummyNode();
37     }
38 
39 
getFilter()40     public String getFilter(){
41         return m_sFilter;
42     }
43 
setFilter(String _sFilter)44     public void setFilter(String _sFilter){
45         m_sFilter = _sFilter;
46     }
47 
getName()48     public String getName(){
49         return toString();
50     }
51 
52 // TODO The implementation of the following nodes is not really robust and should be changed!!!
isMethodNode()53     public boolean isMethodNode(){
54         return ((String) getUserObject()).equals(SMETHODDESCRIPTION);
55     }
56 
isPropertyNode()57     public boolean isPropertyNode(){
58         String sNodeDescription = (String) getUserObject();
59         return ((sNodeDescription.equals(SPROPERTYDESCRIPTION)) || (sNodeDescription.equals(SPROPERTYINFODESCRIPTION)) || (sNodeDescription.equals(SPROPERTYVALUEDESCRIPTION)));
60     }
61 
isContainerNode()62     public boolean isContainerNode(){
63         return ((String) getUserObject()).equals(SCONTAINERDESCRIPTION);
64     }
65 
isServiceNode()66     public boolean isServiceNode(){
67         return ((String) getUserObject()).equals(SSERVICEDESCRIPTION);
68     }
69 
isInterfaceNode()70     public boolean isInterfaceNode(){
71         return ((String) getUserObject()).equals(SINTERFACEDESCRIPTION);
72     }
73 }
74 
75