Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions

:
#)CrDrGridScreen. Copyright © 2012 tourapp.com. All rights reserved. GPL3 Open Source Software License.
  
  package com.tourapp.tour.acctrec.screen.misc;
  
  import java.util.*;
  
CrDrGridScreen - Debit/Credit entry.
 
 public class CrDrGridScreen extends BookingArTrxGridScreen
 {
    
Default constructor.
 
     public CrDrGridScreen()
     {
         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 CrDrGridScreen(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 "Debit/Credit entry";
     }
    
Override this to open the other files in the query.
 
     public void openOtherRecords()
     {
         super.openOtherRecords();
         new TrxStatus(this);
         new ArControl(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 CrDrScreenRecord(this);
     }
    
Add all the screen listeners.
 
     public void addListeners()
     {
         super.addListeners();
         
         this.setEditing(false);     // Can't change current rows
         this.getMainRecord().getField(.).setEnabled(true);
         this.getMainRecord().getField(.).setEnabled(true);
         this.getMainRecord().getField(.).setEnabled(true);
        this.setAppending(true);    // CAN append
        this.getMainRecord().setOpenMode(.); // This makes it possible
        
        this.getMainRecord().getListener(UpdateArTrxAcctDetailHandler.classtrue).setEnabledListener(false);    // Since I will be doing the updating
        
    }
    
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(.)))
        {
            BasePanel parentScreen = this.getParentScreen();
            if (parentScreen != null)
            {
                parentScreen.popHistory(1, false);
                parentScreen.pushHistory(this.getScreenURL(), false);  // Push this screen onto history stack
            }
            return (this.onForm(null.trueiCommandOptionsnull) != null);
        }
        else
            return super.doCommand(strCommandsourceSFieldiCommandOptions);
    }
New to GrepCode? Check out our FAQ X