|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.module.YPackage
public class YPackage
Represents a collection of YModule
objects.
Additionally a YPackage can contain YPackage objects itself.
Field Summary | |
---|---|
protected YList |
moduleNames
The name of the modules in the order as they was inserted, important for menu creation |
protected java.util.Hashtable |
modules
mapping of module-names to modules |
protected java.lang.String |
name
name of the package |
protected YList |
packages
The sub packages of this package |
protected java.beans.PropertyChangeSupport |
propertyChangeSupport
the support which is used to notify listeners about changes in the module list and sub package list |
Constructor Summary | |
---|---|
YPackage(java.io.InputStream is)
Read Package description from an InputStream. |
|
YPackage(java.lang.String name)
Creates a new Package |
|
YPackage(java.net.URL url)
Initializes a YPackage from a resource located at the given url. |
Method Summary | |
---|---|
void |
addModule(java.lang.String className)
Adds a module by its class name. |
void |
addModule(java.lang.String moduleName,
java.lang.String className)
Adds a module by its class name. |
void |
addModule(java.lang.String modName,
YModule module)
Adds a module to this package. |
void |
addModule(YModule module)
Adds a module to this package. |
void |
addPackage(YPackage pack)
Adds a sub package to the package This only affects menu handling This method will fire a PropertyChangeEvent for "packageList" |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Registers PropertyChangeListener to receive events. |
void |
addToMenu(javax.swing.JMenu menu,
YPackageMenuListener listener)
Deprecated. yEd does not use this method any longer, just add and remove modules and sub packages, yEd will take care of the menus. |
javax.swing.JMenu |
createMenu(YPackageMenuListener listener)
Deprecated. yEd does not use this method any longer, just add and remove modules and sub packages, yEd will take care of the menus. |
static YPackage |
createPackage(java.lang.String resourcePath)
|
YModule |
getModule(java.lang.String name)
Get a registered module by name. |
YCursor |
getModuleNames()
Get all module names |
java.util.Hashtable |
getModules()
Get all Modules |
java.lang.String |
getName()
Get the name of the package |
YCursor |
getPackages()
Get all sub packages |
void |
initPackage(java.io.InputStream is)
Initializes a YPackage from a Input stream |
void |
listModules()
Convenience method to print out the names of all modules in the package |
void |
removeModule(java.lang.String moduleName)
Removes a module by its name. |
void |
removePackage(YPackage pack)
Removes a sub package from the package This method will fire a PropertyChangeEvent for "packageList" |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes PropertyChangeListener from the list of listeners. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.util.Hashtable modules
protected YList moduleNames
protected YList packages
protected java.beans.PropertyChangeSupport propertyChangeSupport
Constructor Detail |
---|
public YPackage(java.lang.String name)
name
- The name of the packagepublic YPackage(java.io.InputStream is)
<PACKAGE ..>
tag is found.
public YPackage(java.net.URL url)
Method Detail |
---|
public void initPackage(java.io.InputStream is)
public static YPackage createPackage(java.lang.String resourcePath)
public java.lang.String getName()
public YModule getModule(java.lang.String name)
public YCursor getModuleNames()
public YCursor getPackages()
public java.util.Hashtable getModules()
public void addModule(YModule module)
public void addModule(java.lang.String modName, YModule module)
public void addModule(java.lang.String className)
className
- The complete name of the class of the modulepublic void addModule(java.lang.String moduleName, java.lang.String className)
className
- The complete name of the class of the modulemoduleName
- The name of the modulepublic void removeModule(java.lang.String moduleName)
moduleName
- The name of the modulepublic void addPackage(YPackage pack)
pack
- A YPackagepublic void removePackage(YPackage pack)
pack
- A YPackagepublic javax.swing.JMenu createMenu(YPackageMenuListener listener)
listener
- Specifies what to do is a module is selected
public void addToMenu(javax.swing.JMenu menu, YPackageMenuListener listener)
listener
- Specifies what to do is a module is selectedpublic void listModules()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to register.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to remove.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |