JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.higrid.beans
Class GridProperties

java.lang.Object
  |
  +--com.klg.jclass.datasource.beans.SerializedProperties
        |
        +--com.klg.jclass.higrid.beans.GridProperties
All Implemented Interfaces:
EventListener, JCHiGridListener, Serializable
Direct Known Subclasses:
ExternalGridProperties

public class GridProperties
extends SerializedProperties
implements JCHiGridListener

This class encapsulates the data and format hierarchy for a HiJCData. This is a tree of JCHiGridNode. It observes changes of each JCHiGridNode and then tell its own observers of change. This is meant for internal use only by HiGrid and is not meant to be used by applets or applications.

See Also:
JCHiGridNode, Serialized Form

Field Summary
protected  int dataSourceType
          Data source type of the higrid bean.
protected  boolean externalDS
           
 
Fields inherited from class com.klg.jclass.datasource.beans.SerializedProperties
defaultSerializationFileBase, resourceName, serializationFile
 
Constructor Summary
GridProperties()
          Default Constructor.
GridProperties(boolean externalDS)
          Constructor that is passed a flag to indicate whether an internal or external datasource is required.
GridProperties(int type, boolean externalDS)
          Constructor that is passed a dataSource type and a flag to indicate whether an internal or external datasource is required.
GridProperties(String resource_name, Class caller_class)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, ClassLoader cl)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, ClassLoader cl, String[] names, Object[] data_sources)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, ClassLoader cl, String[] names, Object[] data_sources, boolean externalDS)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, Class caller_class, String sfile)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, Class caller_class, String[] names, Object[] data_sources)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, Class caller_class, String[] names, Object[] data_sources, boolean externalDS)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, Class caller_class, String sfile, String[] names, Object[] data_sources)
          Constructs a GridProperties from a resource.
GridProperties(String resource_name, Class caller_class, String sfile, String[] names, Object[] data_sources, boolean externalDS)
          Constructs a GridProperties from a resource.
 
Method Summary
 void addJCHiGridListener(com.klg.jclass.higrid.beans.JCHiGridListener listener)
          Adds the specified listener to receive JCHiGridEvent objects.
 void fireJCHiGridEvent(com.klg.jclass.higrid.beans.JCHiGridEvent event)
          Informs registered listeners of a JCHiGridEvent.
static com.klg.jclass.datasource.beans.SerializedProperties fromResource(ClassLoader cl, String name)
          Instantiates a SerializedProperties from a resource.
protected  String getBase()
          Gets the base part of the default serialization file name.
protected  int getCounter()
          Gets the variable part of the default serialization file name.
 String getDataBinding()
          Gets the external data binding string.
 String[] getDataSourceNames()
          Returns an array of the names of IDE data source objects.
 Object[] getDataSources()
          Returns an array of IDE data source objects.
 int getDataSourceType()
          Returns the data source type.
 String getModelName()
          Gets the model name.
 com.klg.jclass.datasource.DataSourceTreeNode getRoot()
          Gets the root of the tree structure.
static String getSerializedVersion()
          Gets the serialized version of the bean component currently being de-serialized.
static String getVersion()
          Gets the current version.
 boolean isExternalDS()
          Gets the external datasource indication.
 void JCHiGridValueChanged(com.klg.jclass.higrid.beans.JCHiGridEvent e)
          When value(s) of the JCHiGridNode is changed.
 void remove(com.klg.jclass.datasource.DataSourceTreeNode node)
          Removes a node from the tree.
 void removeAll()
          Removes all nodes from the tree.
 void removeJCHiGridListener(com.klg.jclass.higrid.beans.JCHiGridListener listener)
          Removes the specified listener so it no longer receives JCHiGridEvent objects.
protected  void setChanged()
          Sets the component value changed indication.
protected  void setCounter(int counter)
          Sets the variable part of the default serialization file name.
 void setDataBinding(String s)
          Sets the external data binding string.
 void setDataSourceType(int type)
          Sets the data source type.
 void setExternalDS(boolean externalDS)
          Sets the external datasource indication.
 void setModelName(String s)
          Sets the model name.
 void setRoot(com.klg.jclass.datasource.DataSourceTreeNode root)
          Sets the root of the tree structure.
 String toString()
          Overrides the generic toString() method.
 
Methods inherited from class com.klg.jclass.datasource.beans.SerializedProperties
addJCDataListener, fireJCDataEvent, fromFile, fromResource, getDefaultSerializationFile, getDefaultSerializationFileToOpen, getResourceName, getSerializationFile, isResourceNameSpecified, isSameString, isSerializationRequired, removeJCDataListener, setDefaultSerializationFileBase, setResourceName, setSerializationFile, toFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataSourceType

protected int dataSourceType
Data source type of the higrid bean.


externalDS

protected boolean externalDS
Constructor Detail

GridProperties

public GridProperties()
Default Constructor.


GridProperties

public GridProperties(boolean externalDS)
Constructor that is passed a flag to indicate whether an internal or external datasource is required.

Parameters:
externalDS - indicates internal or external datasource

GridProperties

public GridProperties(int type,
                      boolean externalDS)
Constructor that is passed a dataSource type and a flag to indicate whether an internal or external datasource is required.

Parameters:
type - the dataSource type
externalDS - indicates internal or external datasource

GridProperties

public GridProperties(String resource_name,
                      ClassLoader cl)
               throws DataModelException
Constructs a GridProperties from a resource.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
cl - class loader to use.
Throws:
DataModelException - If the class can't be loaded.

GridProperties

public GridProperties(String resource_name,
                      Class caller_class,
                      String sfile)
               throws DataModelException
Constructs a GridProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
sfile - serialization file that is used at design-time in JBuilder to load a GridProperties.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

GridProperties

public GridProperties(String resource_name,
                      Class caller_class,
                      String sfile,
                      String[] names,
                      Object[] data_sources)
               throws DataModelException
Constructs a GridProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
sfile - serialization file that is used at design-time in JBuilder to load a GridProperties.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

GridProperties

public GridProperties(String resource_name,
                      Class caller_class,
                      String sfile,
                      String[] names,
                      Object[] data_sources,
                      boolean externalDS)
               throws DataModelException
Constructs a GridProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
sfile - serialization file that is used at design-time in JBuilder to load a GridProperties.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

GridProperties

public GridProperties(String resource_name,
                      Class caller_class)
               throws DataModelException
Constructs a GridProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

GridProperties

public GridProperties(String resource_name,
                      Class caller_class,
                      String[] names,
                      Object[] data_sources)
               throws DataModelException
Constructs a GridProperties from a resource. First, the package name of the caller class is prepended to the resource name to locate the resource. If no resource is found, the passed-in resource name is used.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
caller_class - class that uses the serialized bean component.
Throws:
DataModelException - If the class can't be loaded.
See Also:
ClassLoader

GridProperties

public GridProperties(String resource_name,
                      Class caller_class,
                      String[] names,
                      Object[] data_sources,
                      boolean externalDS)
               throws DataModelException
Constructs a GridProperties from a resource.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
Throws:
DataModelException - If the class can't be loaded.

GridProperties

public GridProperties(String resource_name,
                      ClassLoader cl,
                      String[] names,
                      Object[] data_sources)
               throws DataModelException
Constructs a GridProperties from a resource.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
Throws:
DataModelException - If the class can't be loaded.

GridProperties

public GridProperties(String resource_name,
                      ClassLoader cl,
                      String[] names,
                      Object[] data_sources,
                      boolean externalDS)
               throws DataModelException
Constructs a GridProperties from a resource.

Parameters:
resource_name - resource name relative to a class loader to the bean component. It must have the right extension.
Throws:
DataModelException - If the class can't be loaded.
Method Detail

getBase

protected String getBase()
Gets the base part of the default serialization file name.


getCounter

protected int getCounter()
Gets the variable part of the default serialization file name.


setCounter

protected void setCounter(int counter)
Sets the variable part of the default serialization file name.


setDataSourceType

public void setDataSourceType(int type)
Sets the data source type.


getDataSourceType

public int getDataSourceType()
Returns the data source type.


getDataSourceNames

public String[] getDataSourceNames()
Returns an array of the names of IDE data source objects.


getDataSources

public Object[] getDataSources()
Returns an array of IDE data source objects.


setModelName

public void setModelName(String s)
Sets the model name.


getModelName

public String getModelName()
Gets the model name.


setExternalDS

public void setExternalDS(boolean externalDS)
Sets the external datasource indication.


isExternalDS

public boolean isExternalDS()
Gets the external datasource indication.


setDataBinding

public void setDataBinding(String s)
Sets the external data binding string.


getDataBinding

public String getDataBinding()
Gets the external data binding string.


fromResource

public static com.klg.jclass.datasource.beans.SerializedProperties fromResource(ClassLoader cl,
                                                                                String name)
                                                                         throws ClassNotFoundException,
                                                                                IOException
Instantiates a SerializedProperties from a resource.

Parameters:
cl - class loader used to get the resource.
name - resource name relative to a class loader to the bean component. It must have the right extension.
Throws:
ClassNotFoundException - If the class can't be found.
IOException - If an IO exception occurs.
See Also:
Beans.instantiate(java.lang.ClassLoader, java.lang.String)

getVersion

public static String getVersion()
Gets the current version.


getSerializedVersion

public static String getSerializedVersion()
Gets the serialized version of the bean component currently being de-serialized.


getRoot

public com.klg.jclass.datasource.DataSourceTreeNode getRoot()
Gets the root of the tree structure.


setRoot

public void setRoot(com.klg.jclass.datasource.DataSourceTreeNode root)
Sets the root of the tree structure.


removeAll

public void removeAll()
Removes all nodes from the tree.


remove

public void remove(com.klg.jclass.datasource.DataSourceTreeNode node)
Removes a node from the tree.


setChanged

protected void setChanged()
Sets the component value changed indication.

Overrides:
setChanged in class SerializedProperties

addJCHiGridListener

public void addJCHiGridListener(com.klg.jclass.higrid.beans.JCHiGridListener listener)
Adds the specified listener to receive JCHiGridEvent objects.

Parameters:
listener - A listener.

removeJCHiGridListener

public void removeJCHiGridListener(com.klg.jclass.higrid.beans.JCHiGridListener listener)
Removes the specified listener so it no longer receives JCHiGridEvent objects.

Parameters:
listener - A listener.

fireJCHiGridEvent

public void fireJCHiGridEvent(com.klg.jclass.higrid.beans.JCHiGridEvent event)
Informs registered listeners of a JCHiGridEvent.

Parameters:
event - The JCHiGridEvent.

toString

public String toString()
Overrides the generic toString() method.

Overrides:
toString in class Object

JCHiGridValueChanged

public void JCHiGridValueChanged(com.klg.jclass.higrid.beans.JCHiGridEvent e)
When value(s) of the JCHiGridNode is changed.

Specified by:
JCHiGridValueChanged in interface JCHiGridListener
See Also:
JCHiGridNode

Copyright © 2004 Quest Software Inc..
All rights reserved.