ilog.views.appframe.docview.project
Class IlvProjectDataContainer

java.lang.Object
  extended by ilog.views.appframe.docview.project.IlvDefaultDataContainer
      extended by ilog.views.appframe.docview.project.IlvProjectDataContainer
All Implemented Interfaces:
IlvDataContainer
Direct Known Subclasses:
IlvWorkspaceDataContainer

public class IlvProjectDataContainer
extends IlvDefaultDataContainer

Defines a data container that manages file references and folders.


Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.appframe.docview.project.IlvDefaultDataContainer
IlvDefaultDataContainer.AbstractNode, IlvDefaultDataContainer.Node
 
Field Summary
static String FILE_CATEGORY
          Constant for the category of file reference nodes.
static String FOLDER_CATEGORY
          Constant for the category of folder nodes.
static String PROJECT_FILE_CATEGORY
          Constant for the category of project file reference nodes.
 
Fields inherited from interface ilog.views.appframe.docview.project.IlvDataContainer
NODE_TITLE_PROPERTY
 
Constructor Summary
IlvProjectDataContainer()
          Constructs an empty IlvProjectDataContainer.
 
Method Summary
 boolean canRemove(Object parent, Object node)
          Determines whether the specified node can be removed from this project data container.
 IlvApplication getApplication()
          Returns the application of the project data container.
 String getFileReference(Object node)
          Returns the pathname of the file referenced by the specified file reference node.
 URL getFileReferenceURL(Object node)
          Returns the URL of the file referenced by the specified file reference node.
 String getFolderName(Object node)
          Returns the title of the specified folder node.
 Object insertFileReference(Object parent, String filename, int index)
          Inserts a file reference node for the specified filename.
 Object insertFileReference(Object parent, URL url, int index)
          Inserts a file reference node for the specified url.
 Object insertFolder(Object parent, String name, int index)
          Inserts a new folder node.
 boolean isFileReference(Object node)
          Determines whether the specified data container node is a file reference.
 void setApplication(IlvApplication application)
          Sets the application of the project data container.
 
Methods inherited from class ilog.views.appframe.docview.project.IlvDefaultDataContainer
acceptChild, addDataContainerListener, fireNodeAdditionEvent, fireNodeRemovalEvent, firePropertyChangeEvent, getCategory, getChildAt, getChildCount, getIndexOfChild, getNodeProperty, getParent, getTitle, insertNode, removeDataContainerListener, removeNode, setNodeProperty, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILE_CATEGORY

public static String FILE_CATEGORY
Constant for the category of file reference nodes.


FOLDER_CATEGORY

public static String FOLDER_CATEGORY
Constant for the category of folder nodes.


PROJECT_FILE_CATEGORY

public static String PROJECT_FILE_CATEGORY
Constant for the category of project file reference nodes.

Constructor Detail

IlvProjectDataContainer

public IlvProjectDataContainer()
Constructs an empty IlvProjectDataContainer.

Method Detail

setApplication

public void setApplication(IlvApplication application)
Sets the application of the project data container. The application is used for resolving URLs.

Parameters:
application - The new application of the project data container.
See Also:
getApplication()

getApplication

public IlvApplication getApplication()
Returns the application of the project data container.


insertFileReference

public Object insertFileReference(Object parent,
                                  String filename,
                                  int index)
Inserts a file reference node for the specified filename.

Parameters:
parent - The parent node of the newly created file reference.
filename - The filename of the file to create a reference node from.
index - The insertion index of the newly created file reference node in the child array of the parent node. If equal to -1, the file node will be added at the end of the child array of the parent node.
Returns:
The newly created file reference node.
See Also:
getFileReference(java.lang.Object)

insertFileReference

public Object insertFileReference(Object parent,
                                  URL url,
                                  int index)
Inserts a file reference node for the specified url.

Parameters:
parent - The parent node of the newly created file reference.
url - The URL of the file to create a reference node from.
index - The insertion index of the newly created file reference node in the child array of the parent node. If equal to -1, the file node will be added at the end of the child array of the parent node.
Returns:
The newly created file reference node.
See Also:
getFileReference(java.lang.Object)

getFileReference

public String getFileReference(Object node)
Returns the pathname of the file referenced by the specified file reference node.

See Also:
insertFileReference(Object, String, int), insertFileReference(Object, java.net.URL, int), isFileReference(java.lang.Object)

getFileReferenceURL

public URL getFileReferenceURL(Object node)
Returns the URL of the file referenced by the specified file reference node.

Since:
JViews6.0
See Also:
insertFileReference(Object, String, int), insertFileReference(Object, java.net.URL, int), isFileReference(java.lang.Object)

isFileReference

public boolean isFileReference(Object node)
Determines whether the specified data container node is a file reference.

Returns:
true if the specified node is a file reference; false otherwise.

insertFolder

public Object insertFolder(Object parent,
                           String name,
                           int index)
Inserts a new folder node.

Parameters:
parent - The parent node of the newly created folder node.
name - The name of the new folder - can be a key to a string resource.
index - The insertion index of the newly created folder node in the child array of the parent node. If equal to -1, the folder will be added at the end of the child array of the parent node.
Returns:
The newly created folder node.

getFolderName

public String getFolderName(Object node)
Returns the title of the specified folder node.

Returns:
The folder title or null if the specified node is null or is not a folder node.

canRemove

public boolean canRemove(Object parent,
                         Object node)
Determines whether the specified node can be removed from this project data container.

Specified by:
canRemove in interface IlvDataContainer
Overrides:
canRemove in class IlvDefaultDataContainer
Parameters:
parent - The parent node of the specified node or null.
node - The node to remove.
Returns:
true if the node can be removed; false otherwise.
See Also:
IlvDefaultDataContainer.removeNode(java.lang.Object, java.lang.Object)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.