Source Code Cross Referenced for Window.java in  » Ajax » gwtext-2.01 » com » gwtext » client » widgets » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » gwtext 2.01 » com.gwtext.client.widgets 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.gwtext.client.widgets;
002:
003:        import com.google.gwt.core.client.JavaScriptObject;
004:        import com.google.gwt.user.client.Element;
005:        import com.gwtext.client.util.JavaScriptObjectHelper;
006:        import com.gwtext.client.widgets.event.WindowListener;
007:
008:        /**
009:         * A specialized panel intended for use as an application window. Windows are floated and draggable by default, and also provide specific
010:         * behavior like the ability to maximize and restore (with an event for  * minimizing, since the minimize behavior is application-specific).
011:         * Windows can also be linked to a WindowGroup or managed by the WindowManager to provide grouping, activation,
012:         * to front/back and other application-specific behavior.
013:         */
014:        public class Window extends Panel {
015:
016:            private static JavaScriptObject configPrototype;
017:
018:            public static CloseAction CLOSE = new CloseAction("close");
019:            public static CloseAction HIDE = new CloseAction("hide");
020:
021:            static {
022:                init();
023:            }
024:
025:            private static native void init()/*-{
026:                    var c = new $wnd.Ext.Window();
027:                    @com.gwtext.client.widgets.Window::configPrototype = c.initialConfig;
028:                }-*/;
029:
030:            protected JavaScriptObject getConfigPrototype() {
031:                return configPrototype;
032:            }
033:
034:            public String getXType() {
035:                return "window";
036:            }
037:
038:            /**
039:             * Create a new Window.
040:             */
041:            public Window() {
042:            }
043:
044:            /**
045:             * Create a new Window.
046:             *
047:             * @param title the title
048:             */
049:            public Window(String title) {
050:                setTitle(title);
051:            }
052:
053:            /**
054:             * Create a new Window.
055:             *
056:             * @param title     the title
057:             * @param minWidth  the min width
058:             * @param minHeight the min height
059:             */
060:            public Window(String title, int minWidth, int minHeight) {
061:                setTitle(title);
062:                setWidth(minWidth);
063:                setHeight(minHeight);
064:            }
065:
066:            /**
067:             * Create a new Window.
068:             *
069:             * @param title     the title
070:             * @param modal     true for modal
071:             * @param resizable true for resizable
072:             */
073:            public Window(String title, boolean modal, boolean resizable) {
074:                setTitle(title);
075:                setModal(modal);
076:                setResizable(resizable);
077:            }
078:
079:            /**
080:             * Create a new Window.
081:             *
082:             * @param title     the title
083:             * @param minWidth  the min width
084:             * @param minHeight the min height
085:             * @param modal     true for modal
086:             * @param resizable true for resizable
087:             */
088:            public Window(String title, int minWidth, int minHeight,
089:                    boolean modal, boolean resizable) {
090:                setTitle(title);
091:                setWidth(minWidth);
092:                setHeight(minHeight);
093:                setModal(modal);
094:                setResizable(resizable);
095:            }
096:
097:            public Window(JavaScriptObject jsObj) {
098:                super (jsObj);
099:            }
100:
101:            private static Window instance(JavaScriptObject jsObj) {
102:                return new Window(jsObj);
103:            }
104:
105:            protected native JavaScriptObject create(JavaScriptObject config) /*-{
106:                   return new $wnd.Ext.Window(config);
107:               }-*/;
108:
109:            /**
110:             * Aligns the window to the specified element.
111:             *
112:             * @param element  the element to align to
113:             * @param position the position to align to
114:             * @param offsetXY offset the positioning by [x, y]
115:             */
116:            public native void alignTo(Element element, String position,
117:                    int[] offsetXY) /*-{
118:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
119:                   var offsetJS = @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaScriptArray([I)(offsetXY);
120:                   w.alignTo(element, position, offsetXY);
121:               }-*/;
122:
123:            /**
124:             * Anchors this window to another element and realigns it when the window is resized or scrolled.
125:             *
126:             * @param element  the element to anchor to
127:             * @param position the position to anchor to
128:             * @param offsetXY offset the positioning by [x, y]
129:             */
130:            public native void anchorTo(Element element, String position,
131:                    int[] offsetXY) /*-{
132:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
133:                   var offsetJS = @com.gwtext.client.util.JavaScriptObjectHelper::convertToJavaScriptArray([I)(offsetXY);
134:                   w.anchorTo(element, position, offsetXY);
135:               }-*/;
136:
137:            /**
138:             * Centers this window in the viewport
139:             */
140:            public native void center() /*-{
141:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
142:                   w.center();
143:               }-*/;
144:
145:            /**
146:             * Closes the window, removes it from the DOM and destroys the window object.
147:             * The beforeclose event is fired before the close happens and will cancel the close action if it returns false.
148:             */
149:            public native void close() /*-{
150:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
151:                   w.close();
152:               }-*/;
153:
154:            /**
155:             * Focuses the window. If a defaultButton is set {@link Window#setDefaultButton(Element)}, it will receive focus,
156:             * otherwise the window itself will receive focus.
157:             */
158:            public native void focus() /*-{
159:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
160:                   w.focus();
161:               }-*/;
162:
163:            /**
164:             * Hides the window, setting it to invisible and applying negative offsets.
165:             */
166:            public native void hide() /*-{
167:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
168:                   w.hide();
169:               }-*/;
170:
171:            /**
172:             * Fits the window within its current container and automatically replaces the 'maximize' tool button with the 'restore' tool button.
173:             */
174:            public native void maximize() /*-{
175:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
176:                   w.maximize();
177:               }-*/;
178:
179:            /**
180:             * Placeholder method for minimizing the window. By default, this method simply fires the minimize event since the behavior of
181:             * minimizing a window is application-specific. To implement custom minimize behavior, either the minimize event can be handled
182:             * or this method can be overridden.
183:             */
184:            public native void minimize() /*-{
185:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
186:                   w.minimize();
187:               }-*/;
188:
189:            /**
190:             * Restores a maximized window back to its original size and position prior to being maximized and also replaces the 'restore'
191:             * tool button with the 'maximize' tool button.
192:             */
193:            public native void restore() /*-{
194:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
195:                   w.restore();
196:               }-*/;
197:
198:            /**
199:             * Makes this the active window by showing its shadow. This method also fires
200:             * the activate or deactivate event depending on which action occurred.
201:             */
202:            public native void setActive() /*-{
203:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
204:                   w.setActive(true);
205:               }-*/;
206:
207:            /**
208:             * Makes this the active window by showing its shadow, or deactivates it by hiding its shadow. This method also fires
209:             * the activate or deactivate event depending on which action occurred.
210:             *
211:             * @param active true to activate the window, false to deactivate it (defaults to false)
212:             */
213:            public native void setActive(boolean active) /*-{
214:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
215:                   w.setActive(active);
216:               }-*/;
217:
218:            /**
219:             * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden
220:             */
221:            public native void show() /*-{
222:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
223:                   w.show();
224:               }-*/;
225:
226:            /**
227:             * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden
228:             *
229:             * @param animationTargetID The target element id from which the window should animate while opening
230:             */
231:            public native void show(String animationTargetID) /*-{
232:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
233:                   w.show(animationTargetID);
234:               }-*/;
235:
236:            /**
237:             * Shows the window, rendering it first if necessary, or activates it and brings it to front if hidden
238:             *
239:             * @param animationTarget The target element from which the window should animate while opening
240:             */
241:            public native void show(Element animationTarget) /*-{
242:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
243:                   w.show(animationTarget);
244:               }-*/;
245:
246:            /**
247:             * Sends this window to the back of (lower z-index than) any other visible windows
248:             */
249:            public native void toBack() /*-{
250:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
251:                   w.toBack();
252:               }-*/;
253:
254:            /**
255:             * Brings this window to the front of any other visible windows
256:             */
257:            public native void toFront() /*-{
258:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
259:                   w.toFront();
260:               }-*/;
261:
262:            /**
263:             * A shortcut method for toggling between maximize and restore based on the current maximized state of the window.
264:             */
265:            public native void toggleMaximize() /*-{
266:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
267:                   w.toggleMaximize();
268:               }-*/;
269:
270:            public native void addListener(WindowListener listener) /*-{
271:                   this.@com.gwtext.client.widgets.Panel::addListener(Lcom/gwtext/client/widgets/event/PanelListener;)(listener);
272:                   var windowJ = this;
273:
274:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('activate',
275:                           function(source) {
276:                               listener.@com.gwtext.client.widgets.event.WindowListener::onActivate(Lcom/gwtext/client/widgets/Window;)(windowJ);
277:                           }
278:                   );
279:
280:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('deactivate',
281:                           function(source) {
282:                               listener.@com.gwtext.client.widgets.event.WindowListener::onDeactivate(Lcom/gwtext/client/widgets/Window;)(windowJ);
283:                           }
284:                   );
285:
286:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('maximize',
287:                           function(source) {
288:                               listener.@com.gwtext.client.widgets.event.WindowListener::onMaximize(Lcom/gwtext/client/widgets/Window;)(windowJ);
289:                           }
290:                   );
291:
292:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('minimize',
293:                           function(source) {
294:                               listener.@com.gwtext.client.widgets.event.WindowListener::onMinimize(Lcom/gwtext/client/widgets/Window;)(windowJ);
295:                           }
296:                   );
297:
298:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('resize',
299:                           function(source, width, height) {
300:                               if(width == null | width === undefined) width = 0;
301:                               if(height == null | height === undefined) height = 0;
302:                               listener.@com.gwtext.client.widgets.event.WindowListener::onResize(Lcom/gwtext/client/widgets/Window;II)(windowJ, width, height);
303:                           }
304:                   );
305:
306:                   this.@com.gwtext.client.widgets.Component::addListener(Ljava/lang/String;Lcom/google/gwt/core/client/JavaScriptObject;)('restore',
307:                           function(source) {
308:                               listener.@com.gwtext.client.widgets.event.WindowListener::onRestore(Lcom/gwtext/client/widgets/Window;)(windowJ);
309:                           }
310:                   );
311:               }-*/;
312:
313:            // --- config properties ---
314:
315:            /**
316:             * Id from which the window should animate while opening.
317:             *
318:             * @param animateTarget By default the id is set to null and there is no animation
319:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
320:             */
321:            public void setAnimateTarget(String animateTarget)
322:                    throws IllegalStateException {
323:                setAttribute("animateTarget", animateTarget, true);
324:            }
325:
326:            /**
327:             * Element from which the window should animate while opening.
328:             *
329:             * @param animateTarget By default the element is set to null and there is no animation.
330:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
331:             */
332:            public void setAnimateTarget(Element animateTarget)
333:                    throws IllegalStateException {
334:                if (isRendered()) {
335:                    setAnimateTargetRendered(animateTarget);
336:                } else {
337:                    setAttribute("animateTarget", animateTarget, true);
338:                }
339:            }
340:
341:            private native void setAnimateTargetRendered(Element animateTarget) /*-{
342:                   var w = this.@com.gwtext.client.widgets.Component::getOrCreateJsObj()();
343:                   w.setAnimateTarget(animateTarget);
344:               }-*/;
345:
346:            /**
347:             * The base CSS class to apply to this panel's element.
348:             *
349:             * @param baseCls Defaults to 'x-window'
350:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
351:             */
352:            public void setBaseCls(String baseCls) throws IllegalStateException {
353:                super .setBaseCls(baseCls);
354:            }
355:
356:            /**
357:             * True to display the 'close' tool button and allow the user to close the window, false to hide the button
358:             * and disallow closing the window. The default value is true.
359:             *
360:             * @param closable true for closable
361:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
362:             */
363:            public void setClosable(boolean closable)
364:                    throws IllegalStateException {
365:                setAttribute("closable", closable, true);
366:            }
367:
368:            /**
369:             * The action to take when the close button is clicked. The default action is {@link Window#CLOSE} which will actually
370:             * remove the window from the DOM and destroy it. The other valid option is {@link Window#HIDE} which will simply hide
371:             * the window by setting visibility to hidden and applying negative offsets, keeping the window available
372:             * to be redisplayed via the show method.
373:             * <p/>
374:             * <br><br>
375:             * <b>Note:</b> This property cannot be changed after the Component has been rendered.
376:             *
377:             * @param closeAction Defaults to CLOSE
378:             */
379:            public void setCloseAction(Window.CloseAction closeAction) {
380:                setAttribute("closeAction", closeAction.getCloseAction(), true);
381:            }
382:
383:            /**
384:             * True to constrain the window to the viewport, false to allow it to fall outside of the viewport. Default value is false.
385:             * Optionally the header only can be constrained using  {@link Window#setConstrainHeader(boolean)}.
386:             *
387:             *
388:             * @param constrain Defaults to false
389:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
390:             */
391:            public void setConstrain(boolean constrain)
392:                    throws IllegalStateException {
393:                setAttribute("constrain", constrain, true);
394:            }
395:
396:            /**
397:             * True to constrain the window to the viewport, false to allow it to fall outside of the viewport. Default value is false.
398:             * Optionally the header only can be constrained using  {@link Window#setConstrainHeader(boolean)}.
399:             *
400:             * @return  constrain Defaults to false
401:             */
402:            public boolean isConstrain() {
403:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
404:                        "constrain");
405:            }
406:
407:            /**
408:             * True to constrain the window header to the viewport, allowing the window body to fall outside of the viewport,
409:             * false to allow the header to fall outside the viewport. Optionally the entire window can be constrained
410:             * using constrain.
411:             *
412:             * @param constrainHeader Defaults to false
413:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
414:             */
415:            public void setConstrainHeader(boolean constrainHeader)
416:                    throws IllegalStateException {
417:                setAttribute("constrainHeader", constrainHeader, true);
418:            }
419:
420:            /**
421:             * True to constrain the window header to the viewport, allowing the window body to fall outside of the viewport,
422:             * false to allow the header to fall outside the viewport. Optionally the entire window can be constrained
423:             * using constrain.
424:             *
425:             * @return  constrainHeader Defaults to false
426:             */
427:            public boolean isConstrainHeader() {
428:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
429:                        "constrainHeader");
430:            }
431:
432:            /**
433:             * The button that should focus when the window receives focus.
434:             *
435:             * @param buttonIndex the button index
436:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
437:             */
438:            public void setDefaultButton(int buttonIndex)
439:                    throws IllegalStateException {
440:                setAttribute("defaultButton", buttonIndex, true);
441:            }
442:
443:            /**
444:             * The button that should focus when the window receives focus.
445:             *
446:             * @param defaultButton the default button
447:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
448:             */
449:            public void setDefaultButton(String defaultButton)
450:                    throws IllegalStateException {
451:                setAttribute("defaultButton", defaultButton, true);
452:            }
453:
454:            /**
455:             * The button that should focus when the window receives focus.
456:             *
457:             * @param defaultButton the default button
458:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
459:             */
460:            public void setDefaultButton(Element defaultButton)
461:                    throws IllegalStateException {
462:                setAttribute("defaultButton", defaultButton, true);
463:            }
464:
465:            /**
466:             * True to allow the window to be dragged by the header bar, false to disable dragging.
467:             * Note that by default the window will be centered in the viewport, so if dragging is disabled the window
468:             * may need to be positioned programmatically after render (e.g., myWindow.setPosition(100, 100);).
469:             *
470:             * @param draggable Defaults to true
471:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
472:             */
473:            public void setDraggable(boolean draggable)
474:                    throws IllegalStateException {
475:                setAttribute("draggable", draggable, true);
476:            }
477:
478:            /**
479:             * True to allow the window to be dragged by the header bar, false to disable dragging.
480:             * Note that by default the window will be centered in the viewport, so if dragging is disabled the window
481:             * may need to be positioned programmatically after render (e.g., myWindow.setPosition(100, 100);).
482:             *
483:             * @return  draggable Defaults to true
484:             */
485:            public boolean isDraggable() {
486:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
487:                        "draggable");
488:            }
489:
490:            /**
491:             * True to always expand the window when it is displayed, false to keep it in its current state (which may be collapsed) when displayed
492:             *
493:             * @param expandOnShow Defaults to true
494:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
495:             */
496:            public void setExpandOnShow(boolean expandOnShow)
497:                    throws IllegalStateException {
498:                setAttribute("expandOnShow", expandOnShow, true);
499:            }
500:
501:            /**
502:             * True to always expand the window when it is displayed, false to keep it in its current state (which may be collapsed) when displayed.
503:             *
504:             * @return expandOnShow Defaults to true
505:             */
506:            public int getExpandOnShow() {
507:                return JavaScriptObjectHelper.getAttributeAsInt(config,
508:                        "expandOnShow");
509:            }
510:
511:            /**
512:             * A reference to the WindowGroup that should manage this window (defaults to {@link WindowMgr}).
513:             * @param manager the window manager
514:             */
515:            public void setManager(WindowGroup manager) {
516:                setAttribute("manager", manager.getJsObj(), true);
517:            }
518:
519:            public WindowGroup getManager() {
520:                JavaScriptObject manager = getAttributeAsJavaScriptObject("manager");
521:                return new WindowGroup(manager);
522:            }
523:
524:            public boolean isMaximized() {
525:                if (!isCreated()) {
526:                    return false;
527:                } else {
528:                    return getAttributeAsBoolean("maximized");
529:                }
530:            }
531:
532:            /**
533:             * True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button
534:             * and disallow maximizing the window. Note that when a window is maximized, the tool button
535:             * will automatically change to a 'restore' button with the appropriate behavior already built-in that will restore
536:             * the window to its previous size.
537:             *
538:             * @param maximizable Defaults to false
539:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
540:             */
541:            public void setMaximizable(boolean maximizable)
542:                    throws IllegalStateException {
543:                setAttribute("maximizable", maximizable, true);
544:            }
545:
546:            /**
547:             * True to display the 'maximize' tool button and allow the user to maximize the window, false to hide the button
548:             * and disallow maximizing the window. Note that when a window is maximized, the tool button
549:             * will automatically change to a 'restore' button with the appropriate behavior already built-in that will restore
550:             * the window to its previous size.
551:             *
552:             * @return  maximizable Defaults to false
553:             */
554:            public boolean isMazimizable() {
555:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
556:                        "mazimizable");
557:            }
558:
559:            /**
560:             * The minimum height in pixels allowed for this window. Only applies when resizable = true.
561:             *
562:             * @param minHeight Defaults to 100 pixels
563:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
564:             */
565:            public void setMinHeight(int minHeight)
566:                    throws IllegalStateException {
567:                setAttribute("minHeight", minHeight, true);
568:            }
569:
570:            /**
571:             * The minimum height in pixels allowed for this window. Only applies when resizable = true.
572:             *
573:             * @return  the minHeight Defaults to 100 pixels
574:             */
575:            public int getMinHeight() {
576:                return JavaScriptObjectHelper.getAttributeAsInt(config,
577:                        "minHeight");
578:            }
579:
580:            /**
581:             * The minimum width in pixels allowed for this window. Only applies when resizable = true.
582:             *
583:             * @param minWidth Defaults to 200 pixels
584:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
585:             */
586:            public void setMinWidth(int minWidth) throws IllegalStateException {
587:                setAttribute("minWidth", minWidth, true);
588:            }
589:
590:            /**
591:             * The minimum width in pixels allowed for this window. Only applies when resizable = true.
592:             *
593:             * @return the min width (Defaults to 200 pixels)
594:             */
595:            public int getMinWidth() {
596:                return JavaScriptObjectHelper.getAttributeAsInt(config,
597:                        "minWidth");
598:            }
599:
600:            /**
601:             * True to display the 'minimize' tool button and allow the user to minimize the window, false to hide the button
602:             * and disallow minimizing the window. Note that this button provides no implementation --
603:             * the behavior of minimizing a window is implementation-specific, so the minimize event must be handled and a custom
604:             * minimize behavior implemented for this option to be useful.
605:             *
606:             * @param minimizable Defaults to false
607:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
608:             */
609:            public void setMinimizable(boolean minimizable)
610:                    throws IllegalStateException {
611:                setAttribute("minimizable", minimizable, true);
612:            }
613:
614:            /**
615:             * True to make the window modal and mask everything behind it when displayed, false to display it without
616:             * restricting access to other UI elements.
617:             *
618:             * @param modal Defaults to false
619:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
620:             */
621:            public void setModal(boolean modal) throws IllegalStateException {
622:                setAttribute("modal", modal, true);
623:            }
624:
625:            /**
626:             * True to make the window modal and mask everything behind it when displayed, false to display it without
627:             * restricting access to other UI elements.
628:             *
629:             * @return true if modal
630:             */
631:            public boolean isModal() {
632:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
633:                        "modal");
634:            }
635:
636:            /**
637:             * True to render the window body with a transparent background so that it will blend into the framing elements,
638:             * false to add a lighter background color to visually highlight the body element and separate it more distinctly
639:             * from the surrounding frame.
640:             *
641:             * @param plain Defaults to false
642:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
643:             */
644:            public void setPlain(boolean plain) throws IllegalStateException {
645:                setAttribute("plain", plain, true);
646:            }
647:
648:            /**
649:             * True to render the window body with a transparent background so that it will blend into the framing elements,
650:             * false to add a lighter background color to visually highlight the body element and separate it more distinctly
651:             * from the surrounding frame.
652:             *
653:             * @return true if plain
654:             */
655:            public boolean isPlain() {
656:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
657:                        "plain");
658:            }
659:
660:            /**
661:             * True to allow user resizing at each edge and corner of the window, false to disable resizing.
662:             *
663:             * @param resizable Defaults to true
664:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
665:             */
666:            public void setResizable(boolean resizable)
667:                    throws IllegalStateException {
668:                setAttribute("resizable", resizable, true);
669:            }
670:
671:            /**
672:             * True to allow user resizing at each edge and corner of the window, false to disable resizing.
673:             *
674:             * @return true to allow user resizing at each edge and corner of the window, false to disable resizing.
675:             */
676:            public boolean isResizable() {
677:                return JavaScriptObjectHelper.getAttributeAsBoolean(config,
678:                        "resizable");
679:            }
680:
681:            /**
682:             * A valid  {@link Resizable} handles config string. Only applies when resizable = true.
683:             *
684:             * @param resizeHandles Defaults to {@link Resizable#ALL}
685:             * @throws IllegalStateException this property cannot be changed after the Component has been rendered
686:             */
687:            public void setResizeHandles(String resizeHandles)
688:                    throws IllegalStateException {
689:                setAttribute("resizeHandles", resizeHandles, true);
690:            }
691:
692:            /**
693:             * The {@link Resizable} handles config string. Only applies when resizable = true.
694:             *
695:             * @return the resizable config string
696:             */
697:            public String getResizeHandles() {
698:                return JavaScriptObjectHelper.getAttribute(config,
699:                        "resizeHandles");
700:            }
701:
702:            public static class CloseAction {
703:                private String closeAction;
704:
705:                private CloseAction(String closeAction) {
706:                    this .closeAction = closeAction;
707:                }
708:
709:                public String getCloseAction() {
710:                    return closeAction;
711:                }
712:            }
713:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.