public class ObjectLibrary extends JdapiModule
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.
BaseAPI
m_clientInfo, m_pd2fob
PROPERTY_DEFAULT_VALUE, PROPERTY_INHERITED_VALUE, PROPERTY_OVERRIDDEN_DEFAULT_VALUE, PROPERTY_OVERRIDDEN_INHERITED_VALUE, PROPERTY_STATE_UNKNOWN
Modifier | Constructor and Description |
---|---|
protected |
ObjectLibrary(long pd2folb)
Protected constructor, used internally to create ObjectLibrary
objects.
|
|
ObjectLibrary(java.lang.String name)
Constructor used to create ObjectLibrary objects.
|
Modifier and Type | Method and Description |
---|---|
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 |
getComment()
Get text property Comment (COMMENT_PTID).
|
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 |
setComment(java.lang.String value)
Sets text property Comment (COMMENT_PTID).
|
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.
|
compile_all, destroy, getAbsolutePath, getModulesProductVersion, openModule, openModule, openModule, openModule, setAbsolutePath
changeOwner, clearObjectPointer, clone, createSubclassedChild, equals, getBooleanProperty, getChildObjectProperty, getClassName, getClientInfo, getIntegerProperty, getIntegerPropertyString, getJdapiMetaObject, getMetaProperties, getModule, getObjectPointer, getObjectProperty, getObjProp, getOwnedObjects, getOwner, getPersistentClientInfoBlob, getPersistentClientInfoObject, getPropertyState, getPropertyValueName, getQualifiedName, getStringIDProperty, getStringProperty, getSubclassParent, hasDefaultedProperty, hasInheritedProperty, hasOverriddenProperty, hasProperty, inheritProperty, isSubclassed, isValidFormsObject, move, queryType, reattach, setBooleanProperty, setClientInfo, setIntegerProperty, setObjectProperty, setObjProp, setPersistentClientInfo, setPersistentClientInfo, setStringProperty, setSubclassParent, toString, unsetSubclassParent
public ObjectLibrary(java.lang.String name)
name
- Name of the new objectprotected ObjectLibrary(long pd2folb)
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);
pd2folb
- C pointer to Forms objectpublic int getTypeId()
getTypeId
in interface JdapiObject
getTypeId
in class BaseFormsObject
queryType
public static ObjectLibrary open(java.lang.String fileName)
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.
fileName
- File name of ObjectLibrary to loadpublic static ObjectLibrary open(java.io.File file)
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.
file
- File representing ObjectLibrary to loadpublic static ObjectLibrary open(java.lang.String fileName, java.lang.String formsPath)
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.
fileName
- Filename of ObjectLibrary to loadformsPath
- Path to use to look for modules that have been
subclassed from. 'null' means use the default
FORMS70_PATH.public static ObjectLibrary open(java.io.File file, java.lang.String formsPath)
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.
file
- File representing ObjectLibrary to loadformsPath
- Path to use to look for modules that have been
subclassed from. 'null' means use the default
FORMS70_PATH.public void save(java.lang.String fileName)
save
in class JdapiModule
fileName
- Filename to save aspublic void compile()
Note that this method is currently unsupported for ObjectLibrary types, and if called, a JdapiUnsupportedOperationException will be thrown.
compile
in class JdapiModule
public ObjectLibrary clone(java.lang.String newName)
newName
- Name of object that's being createdpublic static ObjectLibrary find(java.lang.String name)
name
- Name of object you wish to findpublic JdapiObject addObject(ObjectLibraryTab tab, JdapiObject obj, boolean replace)
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 :)
tab
- Tab to add object toobj
- Forms object to add to libraryreplace
- Replace existing object (?)public void removeObject(JdapiObject obj)
obj
- Object to removepublic JdapiIterator getObjectLibraryObjects()
public JdapiObject findObjectByPosition(int pos)
getObjectCount()
method.pos
- Position to get object at, this is 1-basedpublic void setSmartClass(JdapiObject obj, boolean smart)
obj
- Object in library to set flag forsmart
- Flag to indicate if it's a 'smart' object or notpublic boolean isSmartClass(JdapiObject obj)
obj
- Object in library to checkpublic void setDescription(JdapiObject obj, java.lang.String description)
obj
- Object in library to set description fordescription
- Description to set for objectpublic java.lang.String getDescription(JdapiObject obj)
obj
- Object in library to get description ofpublic java.lang.String getObjectTabName(JdapiObject obj)
obj
- Object in librarypublic ObjectLibraryTab getObjectTab(JdapiObject obj)
obj
- Object in librarypublic TranslationTable getTranslationTable()
public java.lang.String getComment()
public void setComment(java.lang.String value)
value
- Value to set property topublic java.lang.String getName()
getName
in interface JdapiObject
getName
in class BaseFormsObject
public void setName(java.lang.String value)
value
- Value to set property topublic int getObjectCount()
public int getPersistentClientInfoLength()
public void setPersistentClientInfoLength(int value)
value
- Value to set property topublic boolean isDirtyInfo()
public void setDirtyInfo(boolean value)
value
- Value to set property topublic JdapiIterator getObjectLibraryTabs()