home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.4 KB | 93 lines |
- package symantec.itools.db.beans.binding;
-
- import symantec.itools.db.awt.ProjectionBean;
- import java.lang.reflect.*;
-
- public class OutputComponentForDS extends OutputComponent
- {
- boolean isBDS=false;
-
- public OutputComponentForDS(Object component)
- {
- super(component);
- }
-
- public boolean setSetMethods(String[] methods)
- {
- if(methods[0].equals("setValue(Value,Row,Col)"))
- {
- isBDS=true;
- setMethFullName=methods;
- numberOfInvocationsForSet=methods.length;
- setMethodsParam=new String[numberOfInvocationsForSet][];
- setMethods=new Method[numberOfInvocationsForSet];
- return true;
- }
- else{
- isBDS=false;
- return super.setSetMethods(methods);
- }
- }
-
- public boolean setGetMethods(String[] methods)
- {
- if(methods[0].equals("getValue(Row,Col)"))
- {
- isBDS=true;
- return true;
- }
- else
- {
- isBDS=false;
- return super.setGetMethods(methods);
- }
- }
-
- public void setPrintOut(Object Value,int Row,int Col)
- {
- if(!isBDS)
- super.setPrintOut(Value,Row,Col);
-
- else
- {
- if(Col>=0 )
- {
- /* if(InputClass!= null && InputClass.toString().equals("class java.lang.String"))
- {
- if(Value!=null) Value=((Object)Value.toString());
- else Value="";
- }*/
- ((BasicDataSource)Component).setValue(Value,Row,Col);
- }
- }
- }
-
- public Object getPrintOut(int Row,int Col)
- {
-
- if(isBDS)
- {
- Object Out=new Object();
- if(Col==Name.ColumnNotFoundField)
- {
- return(ColumnNotFoundString);
- }
- Out=(Object)((BasicDataSource)Component).getValue(Row, Col);
- if(Out!=null && InputClass==null)
- {
- InputClass=Out.getClass();
- }
- /* if(Out==null || Out.equals(""))
- {
- if(getEmptyMeansNull()){
- Out=null;
- }
- else{
- Out=new String();
- }
- }*/
- return Out;
- }
- else return super.getPrintOut(Row,Col);
- }
- }