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)
      Public Constructor. Use static get methods
      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)
      Parameters:
      copy -
    • MPrintFormat

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

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

    • reloadItems

      public void reloadItems()
    • 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 Columns
      Returns:
      Array of AD_Column_IDs in Sort Order
    • 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
      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
      Parameters:
      index - index
      Returns:
      Print Format Item
    • setTranslation

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

      public void setStandardHeaderFooter(boolean standardHeaderFooter)
      Set Standard Header
      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()
      Get Translation View use
      Returns:
      true if a translation view is used
    • setTranslationViewQuery

      public void setTranslationViewQuery(MQuery query)
      Update the Query to access the Translation View. Can be called multiple times, adds only if not set 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
    • loadSpecial

      protected Object loadSpecial(ResultSet rs, int index) throws SQLException
      Load Special data (images, ..). To be extended by sub-classes
      Overrides:
      loadSpecial in class PO
      Parameters:
      rs - result set
      index - zero based index
      Returns:
      value value
      Throws:
      SQLException
    • saveNewSpecial

      protected String saveNewSpecial(Object value, int index)
      Save Special Data. To be extended by sub-classes
      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)
    • createFromTable

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

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

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

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

      public static void setUniqueName(int AD_Client_ID, MPrintFormat pf, String 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 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 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) Printformat 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 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 use Name
      Parameters:
      formatName -
      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)
      Parameters:
      AD_Table_ID -
      AD_Window_ID -
      trxName -
      makeNewWhenEmpty -
      Returns:
    • clone

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

      public static int getZoomWindowID(int AD_PrintFormat_ID)
    • markImmutable

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