AMContainerHelper.java revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* ident "%Z%%M% %I% %E% SMI"
*
* Copyright (c) 2000 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* Copyright (C) 1996 Active Software, Inc.
* All rights reserved.
*
* @(#) AMContainerHelper.java 1.41 - last change made 06/17/97
*/
/**
* This is a helper class for shadow containers. Shadow containers are
* nodes in the shadow tree. A shadow container should implement the
* AMContainer interface.
*
* @version 1.41, 06/17/97
*/
public class AMContainerHelper {
/**
* The container that is being assisted by this helper class.
*/
private AMContainer container;
/**
* A list of any shadow children a particular shadow instance
* might have.
* This is used to describe the hierarchical relationship of
* graphical
* objects in the interface.
*/
/**
* Constructor.
*/
}
/**
* Returns the list of children this helper is keeping track
* of for the
* container.
*/
public Vector getChildren() {
return children;
}
/**
* Returns a list of the children that the caller can use
* only for reading
* and cannot alter. The list is cloned because the caller
* might use it
* for removing children from the container.
*/
public Enumeration getChildList() {
}
/**
* Returns the number of children in the container.
*/
public int getChildCount() {
}
/**
* Adds a child.
*/
// check to see that child isn't one of this container's parents
if (child instanceof AMContainer) {
"sunsoft.jws.visual.rt.base.AMContainerHelper.adding__container's__p.0"));
}
}
}
}
// Update the group tree
// Update the AWT tree
!= null) {
}
// Update the mode
if (mgr.isLayoutMode())
child.layoutMode();
else
child.previewMode();
}
}
}
/**
* AttributeManager instances are created with the "name"
* attribute set to null. This is fine when the new instances
* are being created by generated code (runtime mode) or
* are being
* loaded from a file. In both these cases the name has
* just been
* or is about to be set to something unique.
*
* The case we are watching for here is when the top-level
* root in
* the designer (build mode) tries to to create and add a new
* AtttributeManager object. In this case a unique default name
* must be created here (so that every object in a new
* application
* has a unique name.)
*/
&& ((Boolean)
}
} else if (child instanceof AMContainer) {
while (e.hasMoreElements())
}
}
/**
* Removes a child.
*/
return;
// update the the global register for unsaved changes
DesignerAccess.setChangesMade(true);
// Update the AWT tree
!= null) {
}
// Update the group tree
// Remove the child from the tree
}
}
}
} else if (child instanceof AMContainer) {
while (e.hasMoreElements())
}
}
/**
* Finds a child (by name.)
*/
/* JSTYLED */
e.hasMoreElements(); ) {
e.nextElement();
return (child);
}
}
return (null);
}
/**
* Create the container's children.
*/
public void createChildren() {
{
// Don't create the child if it isn't visible
if (v.booleanValue())
}
else
{
}
}
}
/**
* Destroy all the children of the container.
*/
public void destroyChildren() {
}
/**
* Reparent the children of the container. This is called when the
* container is being recreated.
*/
public void reparentChildren() {
{
!= null) {
}
}
}
//
// Layout and Preview mode
//
public void layoutMode() {
{
child.layoutMode();
}
}
public void previewMode() {
{
child.previewMode();
}
}
public void preValidate() {
{
child.preValidate();
}
}
}