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

SequenceChoice Class Reference

A CorbaObjectChoice for sequence's. More...

Inheritance diagram for SequenceChoice::

CorbaObjectChoice List of all members.

Public Methods

 SequenceChoice (TypeCode tc)
void setAliasInfo (String name, String id)
 This method is called when the type is an aliased one. More...

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 sequence's.


Constructor & Destructor Documentation

SequenceChoice::SequenceChoice TypeCode    tc [inline]
 

00025 {
00026     super(tc);
00027     try {
00028         _content = ChoiceFactory.getChoice(tc.content_type());
00029         _name = null;
00030         _id = null;
00031     }catch(org.omg.CORBA.TypeCodePackage.BadKind e){
00032         //???
00033     }
00034 }


Member Function Documentation

void SequenceChoice::setAliasInfo String    name,
String    id
[inline]
 

This method is called when the type is an aliased one.

Reimplemented from CorbaObjectChoice.

00037 {
00038     _name = name;
00039     _id = id;
00040 }

String SequenceChoice::name   [inline, virtual]
 

Name of the type.

Reimplemented from CorbaObjectChoice.

00043 {
00044     return "";  //never used. sequences always in alias;
00045 }

JComponent SequenceChoice::inputRes   [inline, virtual]
 

Dialog component where the user specifies the parameter.

Reimplemented from CorbaObjectChoice.

00048 {
00049     if(_id == null) return null; //not alias
00050 
00051     if(_input == null) {
00052         StubComboBoxModel model = new StubComboBoxModel(_id);
00053         _input = new JComboBox(model);
00054 
00055         _input.setEditable(true);
00056         _input.getEditor().getEditorComponent().addFocusListener(new HxJava.Util.SelectOnFocus());
00057 
00058         _input.setSelectedIndex(-1);
00059         _input.getEditor().setItem("");
00060     }
00061 
00062     return _input;
00063 }

JComponent SequenceChoice::inputArg   [inline, virtual]
 

Dialog component where the user specifies the result.

Reimplemented from CorbaObjectChoice.

00066 {
00067     if(_input == null) {
00068         StubComboBoxModel model = new StubComboBoxModel(_id);
00069         _input = new JComboBox(model);
00070     }
00071     return _input;
00072 
00073     //return new JLabel("seq arguments unsup.");
00074 }

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

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

Reimplemented from CorbaObjectChoice.

00077 {
00078     return "seq??";//never used. sequences always in alias;
00079 }

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

Request management: add argument to Any.

Reimplemented from CorbaObjectChoice.

00082 {
00083     //never used. sequences always in alias;
00084 }

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

Converts that object to string.

Useful method to implement getResult.

Reimplemented from CorbaObjectChoice.

00087 {
00088     if(obj == null) return null;
00089 
00090     if(_id == null)
00091         return "Sequence of "+_content.name()+", length="+Array.getLength(obj);
00092 
00093     String resName = _input.getSelectedItem().toString();
00094 
00095     if(resName.length() == 0)
00096         resName = _name+"+";
00097 
00098     resName = StubRepository.instance().addStub(_id, resName, obj);
00099     return resName;
00100 }

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

Returns the object introduced as that text.

Useful method to implement setArgument.

Reimplemented from CorbaObjectChoice.

00103 {
00104     return StubRepository.instance().getStub(_id, name);
00105 }


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