Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions

:
#)CashBatchGridScreen. Copyright © 2012 tourapp.com. All rights reserved. GPL3 Open Source Software License.
  
  package com.tourapp.tour.acctrec.screen.cash;
  
  import java.util.*;
  
CashBatchGridScreen - Cash Receipts.
 
 public class CashBatchGridScreen extends GridScreen
 {
    
Default constructor.
 
     public CashBatchGridScreen()
     {
         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?.
 
     public CashBatchGridScreen(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);
     }
    
Get the screen display title.
 
     public String getTitle()
     {
         return "Cash Receipts";
     }
    
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 CashBatch(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 CashBatchScreenRecord(this);
     }
    
Add all the screen listeners.
 
     public void addListeners()
     {
         super.addListeners();
         
         
         this.getMainRecord().setKeyArea(.);
         this.getMainRecord().addListener(new SubFileFilter(this.getScreenRecord().getField(.), .nullnullnullnull));
     }
    
Override this to open the other files in the query.
 
    public void openOtherRecords()
    {
        super.openOtherRecords();
        new ArControl(this);
    }
    
Add button(s) to the toolbar.
    public void addToolbarButtons(ToolScreen toolScreen)
    {
        
    }
    
Add the navigation button(s) to the left of the grid row.
    public void addNavButtons()
    {
        super.addNavButtons();  // Next buttons will be "First!"
    }
    
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(.))
        { // This is special logic to write the current empty record (with the default account id) first
            if (this.getMainRecord().getEditMode() == .)
            {
                if (this.getMainRecord().getField(.).isNull())
                    return false;
                if (this.getScreenFieldView().getSelectedRow() == -1)
                    return false;
                try {
                    this.getMainRecord().getField(.).setModified(true);
                    this.getMainRecord().writeAndRefresh();
                } catch (DBException e) {
                    e.printStackTrace();
                }
            }
        }
        else if (strCommand.equalsIgnoreCase(.))
        {
            if (this.getMainRecord().getEditMode() == .)
                return false;   // No entry or new entry;
        }
        return super.doCommand(strCommandsourceSFieldiCommandOptions);
    }
New to GrepCode? Check out our FAQ X