Class MPrintFormat

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_AD_PrintFormat, I_Persistent, Evaluatee, ImmutablePOSupport

public class MPrintFormat extends X_AD_PrintFormat implements ImmutablePOSupport
AD_PrintFormat - Print Format Model. (Add missing Items with PrintFormatUtil)
Version:
$Id: MPrintFormat.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
Author:
Jorg Janke
See Also:
  • Constructor Details

    • MPrintFormat

      public MPrintFormat(Properties ctx, String AD_PrintFormat_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      AD_PrintFormat_UU - UUID key
      trxName - Transaction
    • MPrintFormat

      public MPrintFormat(Properties ctx, int AD_PrintFormat_ID, String trxName)
      Parameters:
      ctx - context
      AD_PrintFormat_ID - AD_PrintFormat_ID
      trxName - transaction
    • MPrintFormat

      public MPrintFormat(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set
      trxName - transaction
    • MPrintFormat

      public MPrintFormat(MPrintFormat copy)
      Copy constructor
      Parameters:
      copy -
    • MPrintFormat

      public MPrintFormat(Properties ctx, MPrintFormat copy)
      Copy constructor
      Parameters:
      ctx -
      copy -
    • MPrintFormat

      public MPrintFormat(Properties ctx, MPrintFormat copy, String trxName)
      Copy constructor
      Parameters:
      ctx -
      copy -
      trxName -
  • Method Details

    • reloadItems

      public void reloadItems()
      Reload print format items from DB
    • getLanguage

      public Language getLanguage()
      Get Language
      Returns:
      language
    • setLanguage

      public void setLanguage(Language language)
      Set Language
      Parameters:
      language - language
    • getOrderAD_Column_IDs

      public int[] getOrderAD_Column_IDs()
      Get AD_Column_ID of Order By Columns
      Returns:
      Array of AD_Column_IDs in Sort Columns
    • getAD_Column_IDs

      public int[] getAD_Column_IDs()
      Get AD_Column_IDs of columns in Report
      Returns:
      Array of AD_Column_ID
    • getAllItems

      public MPrintFormatItem[] getAllItems()
      Get All Items
      Returns:
      items
    • getAllItems

      public MPrintFormatItem[] getAllItems(String orderBy)
      Get All Items from DB
      Parameters:
      orderBy -
      Returns:
      items
    • getItemCount

      public int getItemCount()
      Get Item Count
      Returns:
      number of items or -1 if items not defined
    • getItem

      public MPrintFormatItem getItem(int index)
      Get Print Format Item at index
      Parameters:
      index -
      Returns:
      Print Format Item
      Throws:
      ArrayIndexOutOfBoundsException - if index is invalid
    • setTranslation

      public void setTranslation()
      Set translation of Print Format Items to original value
    • setStandardHeaderFooter

      public void setStandardHeaderFooter(boolean standardHeaderFooter)
      Set Standard Header and Footer
      Parameters:
      standardHeaderFooter - true if std header
    • setIsTableBased

      public void setIsTableBased(boolean tableBased)
      Set Table based. Reset Form.
      Specified by:
      setIsTableBased in interface I_AD_PrintFormat
      Overrides:
      setIsTableBased in class X_AD_PrintFormat
      Parameters:
      tableBased - true if table based
    • setTranslationLanguage

      public void setTranslationLanguage(Language language)
      Set Translation View Language.
      Parameters:
      language - language (checked for base language)
    • isTranslationView

      public boolean isTranslationView()
      Is use Translation View
      Returns:
      true if a translation view is used
    • setTranslationViewQuery

      public void setTranslationViewQuery(MQuery query)
      Update Query to access the Translation View (with t postfix, for e.g c_order_header_vt instead of c_order_header_v).
      Can be called multiple times, add postfix only if not added already.
      Parameters:
      query - query to be updated
    • setAD_PrintTableFormat_ID

      public void setAD_PrintTableFormat_ID(int AD_PrintTableFormat_ID)
      Get Optional TableFormat
      Specified by:
      setAD_PrintTableFormat_ID in interface I_AD_PrintFormat
      Overrides:
      setAD_PrintTableFormat_ID in class X_AD_PrintFormat
      Parameters:
      AD_PrintTableFormat_ID - table format
    • getTableFormat

      public MPrintTableFormat getTableFormat()
      Get Table Format
      Returns:
      Table Format
    • toString

      public String toString()
      String Representation
      Overrides:
      toString in class X_AD_PrintFormat
      Returns:
      info
    • saveNewSpecial

      protected String saveNewSpecial(Object value, int index)
      Save Special Data.
      Overrides:
      saveNewSpecial in class PO
      Parameters:
      value - value
      index - index
      Returns:
      SQL code for INSERT VALUES clause
    • createFromGridLayout

      public static MPrintFormat createFromGridLayout(Properties ctx, GridTab gridTab, boolean allColumns)
      Create and save new print format from GridTab
      Parameters:
      ctx -
      gridTab -
      allColumns -
      Returns:
      new print format instance
    • createFromTable

      public static MPrintFormat createFromTable(Properties ctx, int AD_Table_ID)
      Create and save new MPrintFormat instance for Table
      Parameters:
      ctx - context
      AD_Table_ID - table
      Returns:
      new print format instance
    • createFromTable

      public static MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID)
      Create and save new MPrintFormat instance for Table
      Parameters:
      ctx - context
      AD_Table_ID - table
      AD_PrintFormat_ID - 0 or existing PrintFormat
      Returns:
      new print format instance
    • createFromTable

      public static MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID, String trxName)
      Create and save new MPrintFormat instance for Table
      Parameters:
      ctx - context
      AD_Table_ID - table
      AD_PrintFormat_ID - 0 or existing PrintFormat
      trxName - the transaction
      Returns:
      new print format instance
    • createFromReportView

      public static MPrintFormat createFromReportView(Properties ctx, int AD_ReportView_ID, String ReportName)
      Create and save new MPrintFormat instance from ReportView
      Parameters:
      ctx - context
      AD_ReportView_ID - ReportView
      ReportName - - optional Report Name
      Returns:
      new print format instance
    • setUniqueName

      public static void setUniqueName(int AD_Client_ID, MPrintFormat pf, String basename)
      Set unique name for print format (starting from basename)
      Parameters:
      AD_Client_ID -
      pf -
      basename -
    • copy

      public static MPrintFormat copy(Properties ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID)
      Copy existing Definition To Client
      Parameters:
      ctx - context
      from_AD_PrintFormat_ID - format
      to_AD_PrintFormat_ID - format
      Returns:
      print format
    • copyToClient

      public static MPrintFormat copyToClient(Properties ctx, int AD_PrintFormat_ID, int to_Client_ID)
      Copy existing Definition To Client
      Parameters:
      ctx - context
      AD_PrintFormat_ID - format
      to_Client_ID - to client
      Returns:
      print format
    • copyToClient

      public static MPrintFormat copyToClient(Properties ctx, int AD_PrintFormat_ID, int to_Client_ID, String trxName)
      Copy existing Definition To Client
      Parameters:
      ctx - context
      AD_PrintFormat_ID - format
      to_Client_ID - to client
      trxName -
      Returns:
      print format
    • get

      public static MPrintFormat get(int AD_PrintFormat_ID)
      Get Print Format from cache (immutable)
      Parameters:
      AD_PrintFormat_ID - id
      Returns:
      Format
    • get

      public static MPrintFormat get(Properties ctx, int AD_PrintFormat_ID, boolean readFromDisk)
      Get Print Format from cache (immutable)
      Parameters:
      ctx - context
      AD_PrintFormat_ID - id
      readFromDisk - refresh from disk
      Returns:
      Format
    • get

      public static MPrintFormat get(Properties ctx, int AD_ReportView_ID, int AD_Table_ID)
      Get (default) Print format for Report View or Table
      Parameters:
      ctx - context
      AD_ReportView_ID - id or 0
      AD_Table_ID - id or 0
      Returns:
      first print format found or null
    • deleteFromCache

      public static void deleteFromCache(int AD_PrintFormat_ID)
      Delete Print Format from Cache
      Parameters:
      AD_PrintFormat_ID - id
    • getPrintFormat_ID

      public static int getPrintFormat_ID(String formatName, int AD_Table_ID, int AD_Client_ID)
      Get ID of Print Format via Name
      Parameters:
      formatName - print format name
      AD_Table_ID -
      AD_Client_ID -
      Returns:
      AD_PrintFormat_ID
    • getAccessiblePrintFormats

      public static List<KeyNamePair> getAccessiblePrintFormats(int AD_Table_ID, int AD_Window_ID, String trxName, boolean makeNewWhenEmpty)
      Get accessible print formats
      Parameters:
      AD_Table_ID -
      AD_Window_ID -
      trxName -
      makeNewWhenEmpty - if true, create new print format if no existing print format found for table
      Returns:
      accessible print formats
    • clone

      Deprecated.
      Overrides:
      clone in class PO
      Throws:
      CloneNotSupportedException
    • getZoomWindowID

      public static int getZoomWindowID(int AD_PrintFormat_ID)
      Get zoom window id
      Parameters:
      AD_PrintFormat_ID -
      Returns:
      zoom AD_Window_ID
    • markImmutable

      public MPrintFormat markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO