DialogShadow.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.
*
* @(#) @(#) DialogShadow.java 1.60 - last change made 08/11/97
*/
// This class makes the assumption that dialogClass is either null or a
// subclass of Frame. No error checking is done here to enforce this.
/**
* Wraps an AWT widget. The attributes available for this
* class are listed below. In the type column, type names beginning
* with "sunsoft.jws.visual.rt" have been abbreviated to begin with "rt".
*
* <pre>
name type default value
-----------------------------------------------------------------------
frame rt.type.AMRef null
modal java.lang.Boolean false
resizable java.lang.Boolean true
title java.lang.String "Unnamed Dialog"
* < /pre>
*
* modal: when set to true, the dialog's presence(its being visible)
* keeps the user from doing anything else in the generated application
* until the dialog is popped down.
* < p>
* Check the super class for additional attributes.
*
* @see Dialog
* @version 1.60, 08/11/97
*/
public class DialogShadow extends WindowShadow {
protected Frame dialogFrame;
public DialogShadow() {
/* NOI18N */"sunsoft.jws.visual.rt.type.AMRef",
/* JSTYLED */
NOEDITOR);
/* NOI18N */"java.lang.Boolean",
}
//
// getOnBody
//
return getOnDialogBody(key);
else
return getOnFrameBody(key);
}
if (isLive())
else
else
}
else
}
//
// setOnBody
//
else
}
return; // cannot set modal once dialog is created
else
}
return; // cannot set modal once dialog is created
else
}
public void create() {
createBody();
/* NOI18N */"java.awt.Font",
}
}
}
super.create();
}
public void createBody() {
dialogFrame = getFrame();
// Create the dialog
if (!inDesignerRoot()) {
boolean modal;
if (isLive())
/* JSTYLED */
else
modal = false;
} else {
try {
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
}
}
}
public void showComponent() {
// Call addNotify on our frame if necessary. Need to check for
// null because we might not be created yet.
super.showComponent();
}
// Determine the frame that this dialog hangs off of
scope = this;
if (frameShadow == null)
/* JSTYLED */
} else {
frame = lookupFrame();
}
/* JSTYLED */
return frame;
}
private Frame lookupFrame() {
// Try the main container
if (mgr instanceof FrameShadow)
// Try any other child of the root if we aren't the main container
if (mgr != this) {
while (e.hasMoreElements()) {
if (mgr instanceof FrameShadow) {
if (v.booleanValue())
}
}
}
// Try for a shadow parent of the root
if (frameShadow != null) {
if (v.booleanValue())
return getFrameBody(frameShadow);
}
// Try the toplevel
return getGroup().getTopLevel();
}
}
return frame;
}
return null;
if (mgr instanceof FrameShadow)
return (FrameShadow)mgr;
else
}
// Overridden AMContainer interfaces
&& getChildCount() == 1)
else
super.addChildBody(child);
}
}
}