home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-18 | 2.9 KB | 108 lines |
- package symantec.itools.db.beans.binding;
-
- import symantec.itools.db.awt.ProjectionBean;
- import java.lang.reflect.*;
-
- public class OutputComponentForProj extends OutputComponent
- {
- boolean isProj=false;
-
- public OutputComponentForProj(Object component)
- {
- super(component);
-
- }
-
- public boolean setSetMethods(String[] methods)
- {
- if(methods[0].equals("setData(Value)"))
- {
- isProj=true;
- setMethFullName=methods;
- numberOfInvocationsForSet=methods.length;
- setMethodsParam=new String[numberOfInvocationsForSet][];
- setMethods=new Method[numberOfInvocationsForSet];
- return true;
- }
- else{
- isProj=false;
- return super.setSetMethods(methods);
- }
- }
-
- public boolean setGetMethods(String[] methods)
- {
- if(methods[0].equals("getData()"))
- {
- isProj=true;
- return true;
- }
- else
- {
- isProj=false;
- return super.setGetMethods(methods);
- }
- }
-
- public void setPrintOut(Object Value,int Row,int Col)
- {
- if(!isProj)
- super.setPrintOut(Value,Row,Col);
-
- else
- {
- if(Col>=0 )
- {
- if(InputClass== null && Value==null)
- {
- /* if(Component instanceof symantec.itools.db.awt.Checkbox)
- {
- InputClass=(new Object()).getClass();
- }
- else */try{
- ((ProjectionBean)Component).setData("");
-
- InputClass=((ProjectionBean)Component).getData().getClass();
- }catch(Exception e){InputClass=(new Object()).getClass();}
- }
- if(InputClass!= null && InputClass.toString().equals("class java.lang.String"))
- {
- if(Value!=null) Value=((Object)Value.toString());
- else Value="";
-
- }
- ((ProjectionBean)Component).setData(Value);
-
- }
- }
- }
-
- public Object getPrintOut(int Row,int Col)
- {
-
- if(isProj)
- {
- Object Out=new Object();
- if(Col==Name.ColumnNotFoundField)
- {
- return(ColumnNotFoundString);
- }
- Out=(Object)((ProjectionBean)Component).getData();
- 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);
- }
- }