text: CREATE OR REPLACE PACKAGE BODY STD_TAB_PAGE IS
  	
    /*
     * STDLIB for Oracle Forms 10g
     * Copyright (c) 2017, Paweł Kierzkowski
     * License: MIT
     */
  
    ------------------------------------------------------------------------------
    -- Private API declarations
    ------------------------------------------------------------------------------
  
    FUNCTION GET_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN VARCHAR2;
    
    PROCEDURE SET_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_VALUE IN VARCHAR2);
  
    FUNCTION GET_NUMBER_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN NUMBER;
    
    PROCEDURE SET_NUMBER_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_VALUE IN NUMBER);
  
    FUNCTION GET_BOOLEAN_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN BOOLEAN;
    
    PROCEDURE SET_BOOLEAN_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_STATE IN BOOLEAN);
  
    PROCEDURE GET_VALID_TAB_PAGE_HANDLE(
      P_PROC_NAME IN VARCHAR2 DEFAULT 'STD_TAB_PAGE.GET_VALID_TAB_PAGE_HANDLE',
      P_TAB_PAGE_NAME IN STD_TYPE.TAB_PAGE_NAME,
      X_HANDLE OUT STD_TYPE.TAB_PAGE_HANDLE
    );
    
  
    ------------------------------------------------------------------------------
    -- Public API
    ------------------------------------------------------------------------------
  
    FUNCTION NEW(P_TAB_PAGE_NAME IN STD_TYPE.TAB_PAGE_NAME) RETURN STD_TAB_PAGE
    IS
      L_TAB_PAGE STD_TAB_PAGE;
    BEGIN
      STD_TYPE.VALIDATE('STD_TAB_PAGE.NEW', 'P_TAB_PAGE_NAME', P_TAB_PAGE_NAME, STD_TYPE.ARG_TYPE.TAB_PAGE_NAME);
      
      IF P_TAB_PAGE_NAME IS NOT NULL THEN
        GET_VALID_TAB_PAGE_HANDLE('STD_TAB_PAGE.NEW', P_TAB_PAGE_NAME, L_TAB_PAGE.HANDLE);
  
        L_TAB_PAGE.NAME := UPPER(P_TAB_PAGE_NAME);
        L_TAB_PAGE.CANVAS := STD_CANVAS.NEW(GET_PROPERTY(L_TAB_PAGE, STD_TAB_PAGE_PROPS.CANVAS_NAME));
      END IF;
  
      RETURN L_TAB_PAGE;
    END NEW;
  
    
    FUNCTION IS_NULL(P_TAB_PAGE IN STD_TAB_PAGE) RETURN BOOLEAN
    IS
    BEGIN
      RETURN P_TAB_PAGE.NAME = '_NULL_TAB_PAGE_'
        OR ID_NULL(P_TAB_PAGE.HANDLE);
    END IS_NULL;
  
  
    FUNCTION EQUALS(P_TAB_PAGE_1 IN STD_TAB_PAGE, P_TAB_PAGE_2 IN STD_TAB_PAGE) RETURN BOOLEAN
    IS
    BEGIN
      RETURN
        -- NOT IS_NULL(P_TAB_PAGE_1)
        -- AND NOT IS_NULL(P_TAB_PAGE_2)
        -- AND 
        P_TAB_PAGE_1.NAME = P_TAB_PAGE_2.NAME;
    END EQUALS;
  
    
    FUNCTION CANVAS(P_TAB_PAGE IN STD_TAB_PAGE) RETURN STD_STRUCTURE.STD_CANVAS
    IS
    BEGIN
      RETURN GET_CANVAS(P_TAB_PAGE);
    END CANVAS;
  
  
    FUNCTION GET_CANVAS(P_TAB_PAGE IN STD_TAB_PAGE) RETURN STD_STRUCTURE.STD_CANVAS
    IS
    BEGIN
      RETURN P_TAB_PAGE.CANVAS;
    END GET_CANVAS;
    
  
    ------------------------------------------------------------------------------
    -- Private API
    ------------------------------------------------------------------------------
  
    FUNCTION GET_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN VARCHAR2
    IS
    BEGIN
      RETURN GET_TAB_PAGE_PROPERTY(P_TAB_PAGE.HANDLE, P_PROPERTY);
    END GET_PROPERTY;
    
    
    PROCEDURE SET_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_VALUE IN VARCHAR2)
    IS
    BEGIN
      SET_TAB_PAGE_PROPERTY(P_TAB_PAGE.HANDLE, P_PROPERTY, P_VALUE);
    END SET_PROPERTY;
    
  
    FUNCTION GET_NUMBER_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN NUMBER
    IS
    BEGIN
      RETURN TO_NUMBER(GET_PROPERTY(P_TAB_PAGE, P_PROPERTY));
    END GET_NUMBER_PROPERTY;
    
  
    PROCEDURE SET_NUMBER_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_VALUE IN NUMBER)
    IS
    BEGIN
      SET_TAB_PAGE_PROPERTY(P_TAB_PAGE.HANDLE, P_PROPERTY, TO_NUMBER(P_VALUE));
    END SET_NUMBER_PROPERTY;
  
  
    FUNCTION GET_BOOLEAN_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER) RETURN BOOLEAN
    IS
    BEGIN
      RETURN GET_PROPERTY(P_TAB_PAGE, P_PROPERTY) = 'TRUE';
    END GET_BOOLEAN_PROPERTY;
  
  
    PROCEDURE SET_BOOLEAN_PROPERTY(P_TAB_PAGE IN STD_TAB_PAGE, P_PROPERTY IN NUMBER, P_STATE IN BOOLEAN)
    IS
      L_STATE NUMBER;
    BEGIN
      IF P_STATE THEN
        L_STATE := PROPERTY_TRUE;
      ELSE
        L_STATE := PROPERTY_FALSE;
      END IF;
  
      SET_TAB_PAGE_PROPERTY(P_TAB_PAGE.HANDLE, P_PROPERTY, L_STATE);
    END SET_BOOLEAN_PROPERTY;
  
  
    PROCEDURE GET_VALID_TAB_PAGE_HANDLE(
      P_PROC_NAME IN VARCHAR2 DEFAULT 'STD_TAB_PAGE.GET_VALID_TAB_PAGE_HANDLE',
      P_TAB_PAGE_NAME IN STD_TYPE.TAB_PAGE_NAME,
      X_HANDLE OUT STD_TYPE.TAB_PAGE_HANDLE
    )
    IS
      L_HANDLE STD_TYPE.TAB_PAGE_HANDLE;
    BEGIN
      L_HANDLE := FIND_TAB_PAGE(P_TAB_PAGE_NAME);
      
      IF ID_NULL(L_HANDLE) THEN
        FND_MESSAGE.SET_STRING(P_PROC_NAME || ': Unable to find TAB_PAGE ''' || P_TAB_PAGE_NAME || '''');
        APP_EXCEPTION.RAISE_EXCEPTION;
      END IF;
  
      X_HANDLE := L_HANDLE;
    EXCEPTION
      WHEN OTHERS THEN
        FND_MESSAGE.SET_STRING(P_PROC_NAME || ': Unexpected error during getting handle for tab page ''' || P_TAB_PAGE_NAME || ''' (' || SQLERRM || ')');
        APP_EXCEPTION.RAISE_EXCEPTION;    
    END GET_VALID_TAB_PAGE_HANDLE;
    
  
  END STD_TAB_PAGE;