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

LongChoice Class Reference

A CorbaObjectChoice for long's. More...

Inheritance diagram for LongChoice::

CorbaObjectChoice List of all members.

Public Methods

 LongChoice (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...

void setInitialValue (Any argsAny)
 Used to show default parameters. More...

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


Detailed Description

A CorbaObjectChoice for long's.


Constructor & Destructor Documentation

LongChoice::LongChoice TypeCode    tc [inline]
 

00025 {
00026     super(tc);
00027 }


Member Function Documentation

String LongChoice::name   [inline, virtual]
 

Name of the type.

Reimplemented from CorbaObjectChoice.

00030 {
00031     return "long";
00032 }

JComponent LongChoice::inputRes   [inline, virtual]
 

Dialog component where the user specifies the parameter.

Reimplemented from CorbaObjectChoice.

00035 {
00036     return null;
00037 }

JComponent LongChoice::inputArg   [inline, virtual]
 

Dialog component where the user specifies the result.

Reimplemented from CorbaObjectChoice.

00040 {
00041     if(_input == null) {
00042         _input = new JTextField("");
00043         _input.addFocusListener(new HxJava.Util.SelectOnFocus());
00044     }
00045     return _input;
00046 }

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

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

Reimplemented from CorbaObjectChoice.

00049 {
00050     int result;
00051     result = resAny.extract_long();
00052     return ""+result;
00053 }

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

Request management: add argument to Any.

Reimplemented from CorbaObjectChoice.

00056 {
00057     Integer i = (Integer)asObject();
00058     argsAny.insert_long(i.intValue());
00059 }

void LongChoice::setInitialValue Any    argsAny [inline]
 

Used to show default parameters.

Reimplemented from CorbaObjectChoice.

00062 {
00063     int result = argsAny.extract_long();
00064     _input.setText(""+result);
00065 }

java.lang.Object LongChoice::asObject String    inText [inline, virtual]
 

Returns the object introduced as that text.

Useful method to implement setArgument.

Reimplemented from CorbaObjectChoice.

00068 {
00069     Integer val = new Integer(0);
00070     try {
00071         val = new Integer(inText);
00072     }catch(NumberFormatException e) {
00073         _input.requestFocus();
00074         throw new InvalidChoiceException("Not a number");
00075     }
00076     return val;
00077 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:23 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001