Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions

:
#)RefundCheckXMLPrint. Copyright © 2012 tourapp.com. All rights reserved. GPL3 Open Source Software License.
  
  package com.tourapp.tour.acctrec.screen.refund;
  
  import java.util.*;
  
RefundCheckXMLPrint - Print refund checks.
 
 public class RefundCheckXMLPrint extends ReportScreen
 {
    
Default constructor.
 
     public RefundCheckXMLPrint()
     {
         super();
     }
    
Constructor.

Parameters:
record The main record for this screen.
itsLocation The location of this component within the parent.
parentScreen The parent screen.
fieldConverter The field this screen field is linked to.
iDisplayFieldDesc Do I display the field desc?
properties Addition properties to pass to the screen.
 
     public RefundCheckXMLPrint(Record recordScreenLocation itsLocationBasePanel parentScreenConverter fieldConverterint iDisplayFieldDescMap<String,Objectproperties)
     {
         this();
         this.init(recorditsLocationparentScreenfieldConverteriDisplayFieldDescproperties);
     }
    
Initialize class fields.
 
     public void init(Record recordScreenLocation itsLocationBasePanel parentScreenConverter fieldConverterint iDisplayFieldDescMap<String,Objectproperties)
     {
         super.init(recorditsLocationparentScreenfieldConverteriDisplayFieldDescproperties);
     }
    
Override this to open the main file.

You should pass this record owner to the new main file (ie., new MyNewTable(thisRecordOwner)).

Returns:
The new record.
 
     public Record openMainRecord()
     {
         return new ArTrx(this);
     }
    
Override this to open the other files in the query.
 
     public void openOtherRecords()
     {
         super.openOtherRecords();
         new ArControl(this);
         new TrxStatus(this);
         new BookingLine(this);
     }
    
Add the screen fields. Override this to create (and return) the screen record for this recordowner.

Returns:
The screen record.
 
     public Record addScreenRecord()
     {
         return new RefundScreenRecord(this);
     }
    
Add all the screen listeners.
 
     public void addListeners()
     {
         super.addListeners();
         
        
        TrxStatus recTrxStatus = (TrxStatus)this.getRecord(.);
        this.getMainRecord().addListener(new SubFileFilter(recTrxStatus.getField(.), .nullnullnullnull));
        
        
        Record recBooking = this.getRecord(.);
        Record recBookingLine = this.getRecord(.);
        recBookingLine.addListener(new SubFileFilter(recBooking));
        recBooking.addListener(new RecountOnValidHandler(recBookingLine));
        recBookingLine.addListener(new SubCountHandler(recBooking.getField(.), .truetrue));
        recBookingLine.addListener(new SubCountHandler(recBooking.getField(.), .truetrue));
        
        
        
        
    }
    
Add the toolbars that belong with this screen.

Returns:
The new toolbar.
    public ToolScreen addToolbars()
    {
        return new RefundCheckToolbar(nullthisnull.null);
    }
    
Add button(s) to the toolbar.
    public void addToolbarButtons(ToolScreen toolScreen)
    {
        super.addToolbarButtons(toolScreen);
    }
    
SetupSFields Method.
    public void setupSFields()
    {
    }
    
Process the command.
Step 1 - Process the command if possible and return true if processed.
Step 2 - If I can't process, pass to all children (with me as the source).
Step 3 - If children didn't process, pass to parent (with me as the source).
Note: Never pass to a parent or child that matches the source (to avoid an endless loop).

Parameters:
strCommand The command to process.
sourceSField The source screen field (to avoid echos).
iCommandOptions If this command creates a new screen, create in a new window?
Returns:
true if success.
    public boolean doCommand(String strCommandScreenField sourceSFieldint iCommandOptions)
    {
        if ((strCommand.equalsIgnoreCase(.))
            || (strCommand.equalsIgnoreCase(.))
            || (strCommand.equalsIgnoreCase(.)))
        {
            Object objBankID = this.getScreenRecord().getField(.).getData();
            Object objCheckNo = this.getScreenRecord().getField(.).getData();
            Object objCheckDate = this.getScreenRecord().getField(.).getData();
            Record record = this.getMainRecord();
            BasePanel parentScreen = this.getParentScreen();
        
            int iScreen = .;
            if (strCommand.equalsIgnoreCase(.))
                iScreen = .;
            if (strCommand.equalsIgnoreCase(.))
                iScreen = .;
            boolean bSuccess = (this.onForm(recordiScreentrueiCommandOptionsnull) != null);
        
            if (bSuccess)
            {
                for (int i = 0; i < parentScreen.getSFieldCount(); i++)
                {
                    BasePanel screen = (BasePanel)parentScreen.getSField(i);
                    if (screen instanceof BaseScreen)
                        if (screen.getScreenRecord() instanceof RefundScreenRecord)
                    {
                        screen.getScreenRecord().getField(.).setData(objBankID);
                        screen.getScreenRecord().getField(.).setData(objCheckNo);
                        screen.getScreenRecord().getField(.).setData(objCheckDate);
                    }
                }
            }
        
            return bSuccess;
        }
        else
            return super.doCommand(strCommandsourceSFieldiCommandOptions);
    }
New to GrepCode? Check out our FAQ X