com.tensegrity.skeleton.container.swt
Class SwtRepositoryUtil

java.lang.Object
  extended bycom.tensegrity.skeleton.container.swt.SwtRepositoryUtil
All Implemented Interfaces:
Disposable

public class SwtRepositoryUtil
extends java.lang.Object
implements Disposable

This utility class can be used in order to build a repository corresponding to elements xml definition files.

Instances of SwtRepositoryUtil are created using the default constructor, but one should keep in mind that SwtRepositoryUtil is implementing the Disposable interface and therefore that the dispose() method should be called in order to free internally held resources.

Refer to the dispose() method for more information.

Version:
$Id: SwtRepositoryUtil.java,v 1.29 2005/10/21 15:10:32 ArndHouben Exp $
Author:
S�bastien Guyon, ArndHouben

Constructor Summary
SwtRepositoryUtil(ApplicationFrame appFrame, SlidePanelListener spListener)
           Default constructor.
 
Method Summary
 void buildRepository(org.eclipse.swt.widgets.Composite slideRepository, java.io.File file, ActionSwtRepositoryItem.ClickActionProvider clickActionProvider)
           Builds a repository using the data contained in the elements definition file file.
 void buildSlideRepository(org.eclipse.swt.widgets.Composite parent, java.lang.String path, java.lang.Class refClass, ActionSwtRepositoryItem.ClickActionProvider clickActionProvider)
           Builds a repository using the data contained in the elements definition file which can be found at path.
 void dispose()
           Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwtRepositoryUtil

public SwtRepositoryUtil(ApplicationFrame appFrame,
                         SlidePanelListener spListener)

Default constructor. One should call the dispose() method once the created instance is no longer required.

Parameters:
appFrame - the ApplicationFrame context
spListener - the SlidePanelListener to add to newly created SlidePanels. Specifying null means that no listener is added.
Method Detail

buildRepository

public void buildRepository(org.eclipse.swt.widgets.Composite slideRepository,
                            java.io.File file,
                            ActionSwtRepositoryItem.ClickActionProvider clickActionProvider)
                     throws XMLParseException,
                            ReadException

Builds a repository using the data contained in the elements definition file file.
NOTE:the parent composite should use a GridLayout. If not it will be automatically set.

Parameters:
slideRepository - the Composite containing the repository
file - the elements definition file
clickActionProvider - the ClickActionProvider instance to add to each generated item
Throws:
XMLParseException - thrown if the elements definition file is not correctly formatted
ReadException - thrown if an error occured while reading the elements definition file

buildSlideRepository

public final void buildSlideRepository(org.eclipse.swt.widgets.Composite parent,
                                       java.lang.String path,
                                       java.lang.Class refClass,
                                       ActionSwtRepositoryItem.ClickActionProvider clickActionProvider)
                                throws ReadException

Builds a repository using the data contained in the elements definition file which can be found at path.
NOTE:the parent composite should use a GridLayout. If not it will be automatically set.

Parameters:
parent - the Composite containing the repository
path - the path to the elements definition file, relative to refClass
refClass - the class used to retrieve the elements definition file
clickActionProvider - the ClickActionProvider instance to add to each generated item
Throws:
XMLParseException - thrown if the elements definition file is not correctly formatted
ReadException - thrown if an error occured while reading the elements definition file

dispose

public void dispose()
Description copied from interface: Disposable

Use this method in order to dispose the SWT resources held by instance of classes implementing the Disposable interface.

Specified by:
dispose in interface Disposable


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.