// Get the package name.
String stringPackage = IDLdata.getPackage();
// Get the root node.
Node nodeFather = root;
while ( !stringPackage.equals( "" ) ) {
// Get the index of the first dot.
int intIndexDot = stringPackage.indexOf( '.' );
// Declare directory.
String stringDirectory = null;
// If the dot exists.
if ( intIndexDot != -1 ) {
// Get the directory.
stringDirectory = stringPackage.substring( 0, intIndexDot );
// Get the package without the first directory.
stringPackage = stringPackage.substring( intIndexDot + 1 );
}
// If the dot is missing.
else {
// There is only a directory.
stringDirectory = stringPackage;
// Everything is done for the package.
stringPackage = "";
}
// Create a module node.
Node node[] = new Node[] { new ModuleNode( new NameKey(
4, stringDirectory ) ) };
// Add node to tree.
nodeFather.getChildren().add( node );