Horus Doc || Java GUI Reference || Doxygen's quick Index  

AliasChoice Class Reference

A CorbaObjectChoice for alias's. More...

Inheritance diagram for AliasChoice::

CorbaObjectChoice List of all members.

Public Methods

 AliasChoice (TypeCode tc)
String name ()
 Name of the type. More...

JComponent inputRes ()
 Dialog component where the user specifies the parameter. More...

JComponent inputArg ()
 Dialog component where the user specifies the result. More...

String getResult (Any resAny)
 Request management: extract result from Any (and convert it to String). More...

void setArgument (Any argsAny) throws InvalidChoiceException
 Request management: add argument to Any. More...

String toString (java.lang.Object obj)
 Converts that object to string. More...

java.lang.Object asObject (String name) throws InvalidChoiceException
 Returns the object introduced as that text. More...


Detailed Description

A CorbaObjectChoice for alias's.


Constructor & Destructor Documentation

AliasChoice::AliasChoice TypeCode    tc [inline]
 

00027 {
00028     super(tc);
00029     try {
00030         _name = tc.name();
00031         _content = ChoiceFactory.getChoice(tc.content_type());
00032         _content.setAliasInfo(tc.name(), tc.id());
00033 
00034     }catch(org.omg.CORBA.TypeCodePackage.BadKind e){
00035         //this is not suposed to happen
00036     }
00037 }


Member Function Documentation

String AliasChoice::name   [inline, virtual]
 

Name of the type.

Reimplemented from CorbaObjectChoice.

00040 {
00041     return _name;
00042 }

JComponent AliasChoice::inputRes   [inline, virtual]
 

Dialog component where the user specifies the parameter.

Reimplemented from CorbaObjectChoice.

00045 {
00046     return _content.inputRes();
00047 }

JComponent AliasChoice::inputArg   [inline, virtual]
 

Dialog component where the user specifies the result.

Reimplemented from CorbaObjectChoice.

00050 {
00051     return _content.inputArg();
00052 }

String AliasChoice::getResult Any    resAny [inline, virtual]
 

Request management: extract result from Any (and convert it to String).

Reimplemented from CorbaObjectChoice.

00055 {
00056     String result = null;
00057 
00058     try {
00059         //result = HxCorba."name"Helper.extract(resAny);
00060 
00061         Class helper = Class.forName("HxCorba."+_name+"Helper");
00062         Class[] argTypes = { Any.class };
00063         Method methExt = helper.getMethod("extract", argTypes);
00064         java.lang.Object[] args = { resAny };
00065         java.lang.Object obj = methExt.invoke(null, args);
00066 
00067         result = toString(obj);
00068 
00069     }catch(Exception e) {
00070         ErrorStreamArea.println(e+": Cannot find helper class for "+_name);
00071     }
00072 
00073     return result;
00074 }

void AliasChoice::setArgument Any    argsAny [inline, virtual]
 

Request management: add argument to Any.

Reimplemented from CorbaObjectChoice.

00077 {
00078     java.lang.Object obj = asObject();
00079 
00080     try {
00081         //HxCorba."name"Helper.insert(argsAny, _content);
00082 
00083         Class helper = Class.forName("HxCorba."+_name+"Helper");
00084         Class[] argTypes = { Any.class, obj.getClass() };
00085         Method methIns = helper.getMethod("insert", argTypes);
00086         java.lang.Object[] args = { argsAny, obj };
00087         methIns.invoke(null, args);
00088 
00089     }catch(Exception e) {
00090         ErrorStreamArea.println(e+": Cannot find helper class for "+_name);
00091     }
00092 }

String AliasChoice::toString java.lang.Object    obj [inline]
 

Converts that object to string.

Useful method to implement getResult.

Reimplemented from CorbaObjectChoice.

00095 {
00096     return _content.toString(obj);
00097 }

java.lang.Object AliasChoice::asObject String    name [inline, virtual]
 

Returns the object introduced as that text.

Useful method to implement setArgument.

Reimplemented from CorbaObjectChoice.

00100 {
00101     return _content.asObject(name);
00102 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:36 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001