oracle.forms.jdapi
Class ObjectLibrary

java.lang.Object
  |
  +--oracle.forms.jdapi.BaseFormsObject
        |
        +--oracle.forms.jdapi.JdapiModule
              |
              +--oracle.forms.jdapi.ObjectLibrary
All Implemented Interfaces:
JdapiObject

public class ObjectLibrary
extends JdapiModule

Object to represent a Forms ObjectLibrary object. This is an encapsulation of the Forms C API d2folb.

In some cases, using methods on this class may result in a JdapiIllegalStateException being thrown. When this happens, you are using an object that refers to a Forms object that has been deleted - your reference is no longer valid. You can check if an instance of this class is valid by using the isValidFormsObject() method. If you code correctly, this should not happen. It will tend to happen if you keep references (for extended periods) to Forms objects rather than look them up dynamically. Of course you will only have this problem if you destroy Forms objects.

See Also:
BaseAPI

Fields inherited from class oracle.forms.jdapi.JdapiModule
m_clientInfo, m_pd2fob
 
Fields inherited from interface oracle.forms.jdapi.JdapiObject
PROPERTY_DEFAULT_VALUE, PROPERTY_INHERITED_VALUE, PROPERTY_OVERRIDDEN_DEFAULT_VALUE, PROPERTY_OVERRIDDEN_INHERITED_VALUE, PROPERTY_STATE_UNKNOWN
 
Constructor Summary
protected ObjectLibrary(long pd2folb)
          Protected constructor, used internally to create ObjectLibrary objects.
  ObjectLibrary(java.lang.String name)
          Constructor used to create ObjectLibrary objects.
 
Method Summary
 JdapiObject addObject(ObjectLibraryTab tab, JdapiObject obj, boolean replace)
          Add an object to the ObjectLibrary.
 ObjectLibrary clone(java.lang.String newName)
          Creates a copy of the object as a child of 'parent'.
 void compile()
          Compiles the module to the filesystem.
static ObjectLibrary find(java.lang.String name)
          Find an instance of ObjectLibrary.
 JdapiObject findObjectByPosition(int pos)
          Gets an object from the ObjectLibrary based on it's index.
 java.lang.String getDescription(JdapiObject obj)
          Gets description of object in the library.
 java.lang.String getName()
          Get text property Name (NAME_PTID).
 int getObjectCount()
          Get number property ObjectCount (OBJECT_COUNT_PTID).
 JdapiIterator getObjectLibraryObjects()
          Gets an iterator over all the objects in the library
 JdapiIterator getObjectLibraryTabs()
          Accessor for child ObjectLibraryTab objects (OBJECT_LIBRARY_TAB_PTID).
 ObjectLibraryTab getObjectTab(JdapiObject obj)
          Gets the ObjectLibraryTab for the tab a given object is on.
 java.lang.String getObjectTabName(JdapiObject obj)
          Gets the name of the tab in the library that a given object is on.
 int getPersistentClientInfoLength()
          Get number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
 TranslationTable getTranslationTable()
          Get a TranslationTable object representing the translations for this module.
 int getTypeId()
          Gets the HtmlForms object type ID.
 boolean isDirtyInfo()
          Get boolean property DirtyInfo (DIRTY_INFO_PTID).
 boolean isSmartClass(JdapiObject obj)
          Checks if an object in the library is a 'smart' object.
static ObjectLibrary open(java.io.File file)
          Loads a ObjectLibrary module from the filesystem or from the loaded modules list.
static ObjectLibrary open(java.io.File file, java.lang.String formsPath)
          Loads a ObjectLibrary module from the filesystem or from the loaded modules list.
static ObjectLibrary open(java.lang.String fileName)
          Loads a ObjectLibrary module from the filesystem or from the loaded modules list.
static ObjectLibrary open(java.lang.String fileName, java.lang.String formsPath)
          Loads a ObjectLibrary module from the filesystem or from the loaded modules list.
 void removeObject(JdapiObject obj)
          Removes an object from the ObjectLibrary.
 void save(java.lang.String fileName)
          Saves the module to the filesystem.
 void setDescription(JdapiObject obj, java.lang.String description)
          Sets the description for a object in the library.
 void setDirtyInfo(boolean value)
          Sets boolean property DirtyInfo (DIRTY_INFO_PTID).
 void setName(java.lang.String value)
          Sets text property Name (NAME_PTID).
 void setPersistentClientInfoLength(int value)
          Sets number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
 void setSmartClass(JdapiObject obj, boolean smart)
          Flag if an object is considered a 'smart' object.
 
Methods inherited from class oracle.forms.jdapi.JdapiModule
changeOwner, clearObjectPointer, clone, createSubclassedChild, destroy, equals, getAbsolutePath, getBooleanProperty, getChildObjectProperty, getClassName, getClientInfo, getIntegerProperty, getIntegerPropertyString, getJdapiMetaObject, getMetaProperties, getModule, getModulesProductVersion, getObjectPointer, getObjectProperty, getObjProp, getOwnedObjects, getOwner, getPersistentClientInfoBlob, getPersistentClientInfoObject, getPropertyState, getPropertyValueName, getQualifiedName, getStringIDProperty, getStringProperty, getSubclassParent, hasDefaultedProperty, hasInheritedProperty, hasOverriddenProperty, hasProperty, inheritProperty, isSubclassed, isValidFormsObject, move, openModule, openModule, openModule, openModule, queryType, reattach, setAbsolutePath, setBooleanProperty, setClientInfo, setIntegerProperty, setObjectProperty, setObjProp, setPersistentClientInfo, setPersistentClientInfo, setStringProperty, setSubclassParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectLibrary

public ObjectLibrary(java.lang.String name)
Constructor used to create ObjectLibrary objects.
Parameters:
name - Name of the new object

ObjectLibrary

protected ObjectLibrary(long pd2folb)
Protected constructor, used internally to create ObjectLibrary objects. This doesn't actually create a new ObjectLibrary, it just creates a Java instance for an already existing Forms object.

Do NOT use this constructor, even within the Jdapi package. If you have a pointer and need to instantiate it's Java representation, get the object via the context cache, e.g.

 myBaseObject = Jdapi.getObject(myPointer);
 
Parameters:
pd2fctx - C pointer to Forms context
pd2folb - C pointer to Forms object
Method Detail

getTypeId

public int getTypeId()
Gets the HtmlForms object type ID.
Overrides:
getTypeId in class oracle.forms.jdapi.BaseFormsObject
Returns:
X_OTID ID for this object type

open

public static ObjectLibrary open(java.lang.String fileName)
Loads a ObjectLibrary module from the filesystem or from the loaded modules list.

A runtime exception is thrown if a module the file has subclassed from cannot be found on the Forms path. This behaviour can be suppressed with the Jdapi.setFailSubclassLoad() method.

Parameters:
fileName - File name of ObjectLibrary to load
Returns:
ObjectLibrary object

open

public static ObjectLibrary open(java.io.File file)
Loads a ObjectLibrary module from the filesystem or from the loaded modules list.

A runtime exception is thrown if a module the file has subclassed from cannot be found on the Forms path. This behaviour can be suppressed with the Jdapi.setFailSubclassLoad() method.

Parameters:
fileName - File representing ObjectLibrary to load
Returns:
ObjectLibrary object

open

public static ObjectLibrary open(java.lang.String fileName,
                                 java.lang.String formsPath)
Loads a ObjectLibrary module from the filesystem or from the loaded modules list.

A runtime exception is thrown if a module the file has subclassed from cannot be found on the Forms path. This behaviour can be suppressed with the Jdapi.setFailSubclassLoad() method.

Parameters:
fileName - Filename of ObjectLibrary to load
formsPath - Path to use to look for modules that have been subclassed from. 'null' means use the default FORMS70_PATH.
Returns:
ObjectLibrary object

open

public static ObjectLibrary open(java.io.File file,
                                 java.lang.String formsPath)
Loads a ObjectLibrary module from the filesystem or from the loaded modules list.

A runtime exception is thrown if a module the file has subclassed from cannot be found on the Forms path. This behaviour can be suppressed with the Jdapi.setFailSubclassLoad() method.

Parameters:
File - File representing ObjectLibrary to load
formsPath - Path to use to look for modules that have been subclassed from. 'null' means use the default FORMS70_PATH.
Returns:
ObjectLibrary object

save

public void save(java.lang.String fileName)
Saves the module to the filesystem.
Overrides:
save in class JdapiModule
Parameters:
fileName - Filename to save as

compile

public void compile()
Compiles the module to the filesystem.

Note that this method is currently unsupported for PlsqlModule and ObjectLibrary types, and if called, a JdapiUnsupportedOperationException will be thrown.

Overrides:
compile in class JdapiModule
Parameters:
fileName - name of file to compile

clone

public ObjectLibrary clone(java.lang.String newName)
Creates a copy of the object as a child of 'parent'.
Parameters:
newName - Name of object that's being created
Returns:
Replicant object

find

public static ObjectLibrary find(java.lang.String name)
Find an instance of ObjectLibrary.
Parameters:
parent - Parent object of object you wish to find
name - Name of object you wish to find
Returns:
Object instance you are looking for, or null if none was found

addObject

public JdapiObject addObject(ObjectLibraryTab tab,
                             JdapiObject obj,
                             boolean replace)
Add an object to the ObjectLibrary. When adding an object, a copy of the object you want to add is made and it is this copy that is added to the library. This object is the return value.

Note: Although you can add any Forms object (JdapiObject) to the ObjectLibrary using this method, Forms does not support all objects in a library, e.g. you can't put a Form in an object library (at time of writing). Trying to do so will have unexpected results, i.e. don't :)

Parameters:
tab - Tab to add object to
obj - Forms object to add to library
replace - Replace existing object (?)
Returns:
The object as it exists in the library

removeObject

public void removeObject(JdapiObject obj)
Removes an object from the ObjectLibrary.
Parameters:
obj - Object to remove

getObjectLibraryObjects

public JdapiIterator getObjectLibraryObjects()
Gets an iterator over all the objects in the library
Returns:
Iterator over all objects in library

findObjectByPosition

public JdapiObject findObjectByPosition(int pos)
Gets an object from the ObjectLibrary based on it's index. You may query how many objects are in the library with the getObjectCount() method.
Parameters:
pos - Position to get object at, this is 1-based
Returns:
Object from library at that position

setSmartClass

public void setSmartClass(JdapiObject obj,
                          boolean smart)
Flag if an object is considered a 'smart' object.
Parameters:
obj - Object in library to set flag for
smart - Flag to indicate if it's a 'smart' object or not

isSmartClass

public boolean isSmartClass(JdapiObject obj)
Checks if an object in the library is a 'smart' object.
Parameters:
obj - Object in library to check
Returns:
If object is a 'smart' object

setDescription

public void setDescription(JdapiObject obj,
                           java.lang.String description)
Sets the description for a object in the library.
Parameters:
obj - Object in library to set description for
description - Description to set for object

getDescription

public java.lang.String getDescription(JdapiObject obj)
Gets description of object in the library. If there is no description set, an empty string will be returned.
Parameters:
obj - Object in library to get description of
Returns:
Description of object

getObjectTabName

public java.lang.String getObjectTabName(JdapiObject obj)
Gets the name of the tab in the library that a given object is on.
Parameters:
obj - Object in library
Returns:
Name of tab the object is on

getObjectTab

public ObjectLibraryTab getObjectTab(JdapiObject obj)
Gets the ObjectLibraryTab for the tab a given object is on.
Parameters:
obj - Object in library
Returns:
Tab object the object is on

getTranslationTable

public TranslationTable getTranslationTable()
Get a TranslationTable object representing the translations for this module.
Returns:
TranslationTable

getName

public java.lang.String getName()
Get text property Name (NAME_PTID).
Overrides:
getName in class oracle.forms.jdapi.BaseFormsObject
Returns:
Value of property

setName

public void setName(java.lang.String value)
Sets text property Name (NAME_PTID).
Parameters:
value - Value to set property to

getObjectCount

public int getObjectCount()
Get number property ObjectCount (OBJECT_COUNT_PTID).
Returns:
Value of property

getPersistentClientInfoLength

public int getPersistentClientInfoLength()
Get number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
Returns:
Value of property

setPersistentClientInfoLength

public void setPersistentClientInfoLength(int value)
Sets number property PersistentClientInfoLength (PERSISTENT_CLIENT_INFO_LENGTH_PTID).
Parameters:
value - Value to set property to

isDirtyInfo

public boolean isDirtyInfo()
Get boolean property DirtyInfo (DIRTY_INFO_PTID).
Returns:
Value of property

setDirtyInfo

public void setDirtyInfo(boolean value)
Sets boolean property DirtyInfo (DIRTY_INFO_PTID).
Parameters:
value - Value to set property to

getObjectLibraryTabs

public JdapiIterator getObjectLibraryTabs()
Accessor for child ObjectLibraryTab objects (OBJECT_LIBRARY_TAB_PTID). Gets list of child objects as an iterator (which implements Enumeration for simple traversal).
Returns:
Iterator of ObjectLibraryTab objects