KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > ir > gui > typesystem > remote > IRValueMember


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1999-2004 Gerald Brose
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  */

21 package org.jacorb.ir.gui.typesystem.remote;
22
23 /**
24  *
25  */

26  
27 import java.util.*;
28 import org.omg.CORBA.*;
29 import javax.swing.tree.*;
30  
31 public class IRValueMember
32     extends IRNodeWithType
33 {
34     /**
35      * Default constructor, called from TypeSystem.createNode(...)
36      */

37     public IRValueMember()
38     {
39         super();
40     }
41
42     /**
43      * @param irObject org.omg.CORBA.IRObject
44      */

45     public IRValueMember(IRObject irObject)
46     {
47         super(irObject);
48         ValueMemberDef valueMemberDef = ValueMemberDefHelper.narrow(irObject);
49         setAssociatedTypeSystemNode(RemoteTypeSystem.createTypeSystemNode(valueMemberDef.type_def()));
50     }
51
52     /**
53      * @return java.lang.String
54      */

55     public String JavaDoc getInstanceNodeTypeName()
56     {
57         String JavaDoc access;
58         short visibility = ValueMemberDefHelper.narrow((org.omg.CORBA.Object JavaDoc)irObject).access();
59
60         switch (visibility) {
61             case PUBLIC_MEMBER.value:
62                 access = "public ";
63                 break;
64             case PRIVATE_MEMBER.value:
65                 access = "private ";
66                 break;
67             default:
68                 access = "<unknown visibility> ";
69                 break;
70         }
71
72         return access + super.getInstanceNodeTypeName();
73     }
74
75     /**
76      * @return A string denoting the node type implemented here.
77      */

78     public static String JavaDoc nodeTypeName()
79     {
80         return "valuemember";
81     }
82 }
83
Popular Tags