KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > presentations > r21 > widgets > ViewForm


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.presentations.r21.widgets;
12
13 import org.eclipse.swt.SWT;
14 import org.eclipse.swt.SWTException;
15 import org.eclipse.swt.events.ControlAdapter;
16 import org.eclipse.swt.events.ControlEvent;
17 import org.eclipse.swt.events.PaintEvent;
18 import org.eclipse.swt.events.PaintListener;
19 import org.eclipse.swt.graphics.Color;
20 import org.eclipse.swt.graphics.Font;
21 import org.eclipse.swt.graphics.GC;
22 import org.eclipse.swt.graphics.Point;
23 import org.eclipse.swt.graphics.RGB;
24 import org.eclipse.swt.graphics.Rectangle;
25 import org.eclipse.swt.widgets.Composite;
26 import org.eclipse.swt.widgets.Control;
27 import org.eclipse.swt.widgets.Event;
28 import org.eclipse.swt.widgets.Layout;
29 import org.eclipse.swt.widgets.Listener;
30
31 /**
32  * Instances of this class implement a Composite that lays out three
33  * children horizontally and allows programmatic control of layout and
34  * border parameters. ViewForm is used in the workbench to implement a
35  * view's label/menu/toolbar local bar.
36  * <p>
37  * Note that although this class is a subclass of <code>Composite</code>,
38  * it does not make sense to set a layout on it.
39  * </p><p>
40  * <dl>
41  * <dt><b>Styles:</b></dt>
42  * <dd>BORDER, FLAT</dd>
43  * <dt><b>Events:</b></dt>
44  * <dd>(None)</dd>
45  * </dl>
46  * <p>
47  * IMPORTANT: This class is <em>not</em> intended to be subclassed.
48  * </p>
49  */

50
51 public class ViewForm extends Composite {
52
53     /**
54      * marginWidth specifies the number of pixels of horizontal margin
55      * that will be placed along the left and right edges of the form.
56      *
57      * The default value is 0.
58      */

59     public int marginWidth = 0;
60
61     /**
62      * marginHeight specifies the number of pixels of vertical margin
63      * that will be placed along the top and bottom edges of the form.
64      *
65      * The default value is 0.
66      */

67     public int marginHeight = 0;
68
69     /**
70      * Color of innermost line of drop shadow border.
71      */

72     public static RGB borderInsideRGB = new RGB(132, 130, 132);
73
74     /**
75      * Color of middle line of drop shadow border.
76      */

77     public static RGB borderMiddleRGB = new RGB(143, 141, 138);
78
79     /**
80      * Color of outermost line of drop shadow border.
81      */

82     public static RGB borderOutsideRGB = new RGB(171, 168, 165);
83
84     // SWT widgets
85
private Control topLeft;
86
87     private Control topCenter;
88
89     private Control topRight;
90
91     private Control content;
92
93     // Configuration and state info
94
private boolean separateTopCenter = false;
95
96     private int drawLine1 = -1;
97
98     private int drawLine2 = -1;
99
100     private boolean showBorder = false;
101
102     private int BORDER_TOP = 0;
103
104     private int BORDER_BOTTOM = 0;
105
106     private int BORDER_LEFT = 0;
107
108     private int BORDER_RIGHT = 0;
109
110     private Color borderColor1;
111
112     private Color borderColor2;
113
114     private Color borderColor3;
115
116     private Rectangle oldArea;
117
118     private static final int OFFSCREEN = -200;
119
120     /**
121      * Constructs a new instance of this class given its parent
122      * and a style value describing its behavior and appearance.
123      * <p>
124      * The style value is either one of the style constants defined in
125      * class <code>SWT</code> which is applicable to instances of this
126      * class, or must be built by <em>bitwise OR</em>'ing together
127      * (that is, using the <code>int</code> "|" operator) two or more
128      * of those <code>SWT</code> style constants. The class description
129      * lists the style constants that are applicable to the class.
130      * Style bits are also inherited from superclasses.
131      * </p>
132      *
133      * @param parent a widget which will be the parent of the new instance (cannot be null)
134      * @param style the style of widget to construct
135      *
136      * @exception IllegalArgumentException <ul>
137      * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
138      * </ul>
139      * @exception SWTException <ul>
140      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
141      * </ul>
142      *
143      * @see SWT#BORDER
144      * @see SWT#FLAT
145      * @see #getStyle()
146      */

147     public ViewForm(Composite parent, int style) {
148         super(parent, checkStyle(style));
149
150         borderColor1 = new Color(getDisplay(), borderInsideRGB);
151         borderColor2 = new Color(getDisplay(), borderMiddleRGB);
152         borderColor3 = new Color(getDisplay(), borderOutsideRGB);
153         setBorderVisible((style & SWT.BORDER) != 0);
154
155         addPaintListener(new PaintListener() {
156             public void paintControl(PaintEvent event) {
157                 onPaint(event.gc);
158             }
159         });
160         addControlListener(new ControlAdapter() {
161             public void controlResized(ControlEvent e) {
162                 onResize();
163             }
164         });
165
166         addListener(SWT.Dispose, new Listener() {
167             public void handleEvent(Event e) {
168                 onDispose();
169             }
170         });
171     }
172
173     /**
174      * Check the style bits to ensure that no invalid styles are applied.
175      * @private
176      */

177     private static int checkStyle(int style) {
178         int mask = SWT.FLAT | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;
179         return style & mask | SWT.NO_REDRAW_RESIZE;
180     }
181
182     public Point computeSize(int wHint, int hHint, boolean changed) {
183         checkWidget();
184         // size of title bar area
185
Point leftSize = new Point(0, 0);
186         if (topLeft != null) {
187             leftSize = topLeft.computeSize(SWT.DEFAULT, SWT.DEFAULT);
188             leftSize.x += 1; // +1 for highlight line
189
}
190         Point centerSize = new Point(0, 0);
191         if (topCenter != null) {
192             centerSize = topCenter.computeSize(SWT.DEFAULT, SWT.DEFAULT);
193         }
194         Point rightSize = new Point(0, 0);
195         if (topRight != null) {
196             rightSize = topRight.computeSize(SWT.DEFAULT, SWT.DEFAULT);
197         }
198         Point size = new Point(0, 0);
199         // calculate width of title bar
200
if (separateTopCenter
201                 || (wHint != SWT.DEFAULT && leftSize.x + centerSize.x
202                         + rightSize.x > wHint)) {
203             size.x = leftSize.x + rightSize.x;
204             size.x = Math.max(centerSize.x, size.x);
205             size.y = Math.max(leftSize.y, rightSize.y) + 1; // +1 for highlight line
206
if (topCenter != null) {
207                 size.y += centerSize.y;
208             }
209         } else {
210             size.x = leftSize.x + centerSize.x + rightSize.x;
211             size.y = Math.max(leftSize.y, Math.max(centerSize.y, rightSize.y)) + 1; // +1 for highlight line
212
}
213
214         if (content != null) {
215             Point contentSize = new Point(0, 0);
216             contentSize = content.computeSize(SWT.DEFAULT, SWT.DEFAULT);
217             size.x = Math.max(size.x, contentSize.x);
218             size.y += contentSize.y + 1; // +1 for line bewteen content and header
219
}
220
221         size.x += 2 * marginWidth;
222         size.y += 2 * marginHeight;
223
224         if (wHint != SWT.DEFAULT) {
225             size.x = wHint;
226         }
227         if (hHint != SWT.DEFAULT) {
228             size.y = hHint;
229         }
230
231         Rectangle trim = computeTrim(0, 0, size.x, size.y);
232         return new Point(trim.width, trim.height);
233     }
234
235     public Rectangle computeTrim(int x, int y, int width, int height) {
236         checkWidget();
237         int trimX = x - BORDER_LEFT;
238         int trimY = y - BORDER_TOP;
239         int trimWidth = width + BORDER_LEFT + BORDER_RIGHT;
240         int trimHeight = height + BORDER_TOP + BORDER_BOTTOM;
241         return new Rectangle(trimX, trimY, trimWidth, trimHeight);
242     }
243
244     public Rectangle getClientArea() {
245         checkWidget();
246         Rectangle clientArea = super.getClientArea();
247         clientArea.x += BORDER_LEFT;
248         clientArea.y += BORDER_TOP;
249         clientArea.width -= BORDER_LEFT + BORDER_RIGHT;
250         clientArea.height -= BORDER_TOP + BORDER_BOTTOM;
251         return clientArea;
252     }
253
254     /**
255      * Returns the content area.
256      *
257      * @return the control in the content area of the pane or null
258      */

259     public Control getContent() {
260         //checkWidget();
261
return content;
262     }
263
264     /**
265      * Returns Control that appears in the top center of the pane.
266      * Typically this is a toolbar.
267      *
268      * @return the control in the top center of the pane or null
269      */

270     public Control getTopCenter() {
271         //checkWidget();
272
return topCenter;
273     }
274
275     /**
276      * Returns the Control that appears in the top left corner of the pane.
277      * Typically this is a label such as CLabel.
278      *
279      * @return the control in the top left corner of the pane or null
280      */

281     public Control getTopLeft() {
282         //checkWidget();
283
return topLeft;
284     }
285
286     /**
287      * Returns the control in the top right corner of the pane.
288      * Typically this is a Close button or a composite with a Menu and Close button.
289      *
290      * @return the control in the top right corner of the pane or null
291      */

292     public Control getTopRight() {
293         //checkWidget();
294
return topRight;
295     }
296
297     public void layout(boolean changed) {
298         checkWidget();
299         Rectangle rect = getClientArea();
300
301         drawLine1 = -1;
302         drawLine2 = -1;
303
304         Point leftSize = new Point(0, 0);
305         if (topLeft != null && !topLeft.isDisposed()) {
306             leftSize = topLeft.computeSize(SWT.DEFAULT, SWT.DEFAULT);
307         }
308         Point centerSize = new Point(0, 0);
309         if (topCenter != null && !topCenter.isDisposed()) {
310             centerSize = topCenter.computeSize(SWT.DEFAULT, SWT.DEFAULT);
311         }
312         Point rightSize = new Point(0, 0);
313         if (topRight != null && !topRight.isDisposed()) {
314             rightSize = topRight.computeSize(SWT.DEFAULT, SWT.DEFAULT);
315         }
316
317         int minTopWidth = leftSize.x + centerSize.x + rightSize.x + 2
318                 * marginWidth + 1; // +1 for highlight line
319
int height = rect.y + marginHeight;
320
321         boolean top = false;
322         if (separateTopCenter || minTopWidth > rect.width) {
323             int topHeight = Math.max(rightSize.y, leftSize.y);
324             if (topRight != null && !topRight.isDisposed()) {
325                 top = true;
326                 topRight.setBounds(rect.x + rect.width - marginWidth
327                         - rightSize.x, rect.y + 1 + marginHeight, rightSize.x,
328                         topHeight);
329                 height += 1 + topHeight; // +1 for highlight line
330
}
331             if (topLeft != null && !topLeft.isDisposed()) {
332                 top = true;
333                 leftSize = topLeft.computeSize(rect.width - 2 * marginWidth
334                         - rightSize.x - 1, SWT.DEFAULT);
335                 topLeft.setBounds(rect.x + 1 + marginWidth, rect.y + 1
336                         + marginHeight, leftSize.x, topHeight);
337                 height = Math
338                         .max(height, rect.y + marginHeight + 1 + topHeight); // +1 for highlight line
339
}
340             if (topCenter != null && !topCenter.isDisposed()) {
341                 top = true;
342                 if (height > rect.y + marginHeight) {
343                     drawLine1 = height;
344                     height += 1; // +1 for divider line
345
}
346                 centerSize = topCenter.computeSize(
347                         rect.width - 2 * marginWidth, SWT.DEFAULT);
348                 topCenter.setBounds(rect.x + rect.width - marginWidth
349                         - centerSize.x, height, centerSize.x, centerSize.y);
350                 height += centerSize.y;
351
352             }
353         } else {
354             int topHeight = Math.max(rightSize.y, Math.max(centerSize.y,
355                     leftSize.y));
356             if (topRight != null && !topRight.isDisposed()) {
357                 top = true;
358                 topRight.setBounds(rect.x + rect.width - marginWidth
359                         - rightSize.x, rect.y + marginHeight + 1, // +1 for highlight line
360
rightSize.x, topHeight);
361                 height += 1 + topHeight; // +1 for highlight line
362
}
363             if (topCenter != null && !topCenter.isDisposed()) {
364                 top = true;
365                 topCenter.setBounds(rect.x + rect.width - marginWidth
366                         - rightSize.x - centerSize.x,
367                         rect.y + marginHeight + 1, // +1 for highlight line
368
centerSize.x, topHeight);
369                 height = Math
370                         .max(height, rect.y + marginHeight + 1 + topHeight); // +1 for highlight line
371
}
372             if (topLeft != null && !topLeft.isDisposed()) {
373                 top = true;
374                 leftSize = topLeft.computeSize(rect.width - 2 * marginWidth
375                         - rightSize.x - centerSize.x - 1, topHeight);
376                 topLeft.setBounds(rect.x + marginWidth + 1, // +1 for highlight line
377
rect.y + marginHeight + 1, // +1 for highlight line
378
leftSize.x, topHeight);
379                 height = Math
380                         .max(height, rect.y + marginHeight + 1 + topHeight); // +1 for highlight line
381
}
382         }
383
384         if (content != null && !content.isDisposed()) {
385             if (top) {
386                 drawLine2 = height;
387                 height += 1; // +1 for divider line
388
}
389             content
390                     .setBounds(rect.x + marginWidth, height, rect.width - 2
391                             * marginWidth, rect.y + rect.height - height
392                             - marginHeight);
393         }
394     }
395
396     private void onDispose() {
397         if (borderColor1 != null) {
398             borderColor1.dispose();
399         }
400         borderColor1 = null;
401
402         if (borderColor2 != null) {
403             borderColor2.dispose();
404         }
405         borderColor2 = null;
406
407         if (borderColor3 != null) {
408             borderColor3.dispose();
409         }
410         borderColor3 = null;
411
412         topLeft = null;
413         topCenter = null;
414         topRight = null;
415         content = null;
416         oldArea = null;
417     }
418
419     /**
420      * Draws the focus border.
421      */

422     private void onPaint(GC gc) {
423         Rectangle d = super.getClientArea();
424
425         if (showBorder) {
426             if ((getStyle() & SWT.FLAT) != 0) {
427                 gc.setForeground(borderColor1);
428                 gc.drawRectangle(d.x, d.y, d.x + d.width - 1, d.y + d.height
429                         - 1);
430             } else {
431                 gc.setForeground(borderColor1);
432                 gc.drawRectangle(d.x, d.y, d.x + d.width - 3, d.y + d.height
433                         - 3);
434
435                 gc.setForeground(borderColor2);
436                 gc.drawLine(d.x + 1, d.y + d.height - 2, d.x + d.width - 1, d.y
437                         + d.height - 2);
438                 gc.drawLine(d.x + d.width - 2, d.y + 1, d.x + d.width - 2, d.y
439                         + d.height - 1);
440
441                 gc.setForeground(borderColor3);
442                 gc.drawLine(d.x + 2, d.y + d.height - 1, d.x + d.width - 2, d.y
443                         + d.height - 1);
444                 gc.drawLine(d.x + d.width - 1, d.y + 2, d.x + d.width - 1, d.y
445                         + d.height - 2);
446             }
447         }
448
449         if (drawLine1 != -1) {
450             // top seperator line
451
gc.setForeground(borderColor1);
452             gc.drawLine(d.x + BORDER_LEFT, drawLine1, d.x + d.width
453                     - BORDER_RIGHT, drawLine1);
454         }
455         if (drawLine2 != -1) {
456             // content separator line
457
gc.setForeground(borderColor1);
458             gc.drawLine(d.x + BORDER_LEFT, drawLine2, d.x + d.width
459                     - BORDER_RIGHT, drawLine2);
460         }
461         // highlight on top
462
int y = drawLine1;
463         if (y == -1) {
464             y = drawLine2;
465         }
466         if (y != -1) {
467             gc.setForeground(getDisplay().getSystemColor(
468                     SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
469             gc.drawLine(d.x + BORDER_LEFT + marginWidth, d.y + BORDER_TOP
470                     + marginHeight, d.x + BORDER_LEFT + marginWidth, y - 1);
471             gc.drawLine(d.x + BORDER_LEFT + marginWidth, d.y + BORDER_TOP
472                     + marginHeight, d.x + d.width - BORDER_RIGHT - marginWidth
473                     - 1, d.y + BORDER_TOP + marginHeight);
474         }
475
476         gc.setForeground(getForeground());
477     }
478
479     private void onResize() {
480         layout();
481
482         Rectangle area = super.getClientArea();
483         if (oldArea == null || oldArea.width == 0 || oldArea.height == 0) {
484             redraw();
485         } else {
486             int width = 0;
487             if (oldArea.width < area.width) {
488                 width = area.width - oldArea.width + BORDER_RIGHT;
489             } else if (oldArea.width > area.width) {
490                 width = BORDER_RIGHT;
491             }
492             redraw(area.x + area.width - width, area.y, width, area.height,
493                     false);
494
495             int height = 0;
496             if (oldArea.height < area.height) {
497                 height = area.height - oldArea.height + BORDER_BOTTOM;
498             }
499             if (oldArea.height > area.height) {
500                 height = BORDER_BOTTOM;
501             }
502             redraw(area.x, area.y + area.height - height, area.width, height,
503                     false);
504         }
505         oldArea = area;
506     }
507
508     /**
509      * Sets the content.
510      * Setting the content to null will remove it from
511      * the pane - however, the creator of the content must dispose of the content.
512      *
513      * @param content the control to be displayed in the content area or null
514      *
515      * @exception SWTException <ul>
516      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
517      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
518      * </ul>
519      */

520     public void setContent(Control content) {
521         checkWidget();
522         if (content != null && content.getParent() != this) {
523             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
524         }
525         if (this.content != null && !this.content.isDisposed()) {
526             this.content.setBounds(OFFSCREEN, OFFSCREEN, 0, 0);
527         }
528         this.content = content;
529         layout();
530     }
531
532     /**
533      * Set the widget font.
534      * This will apply the font to the topLeft, topRight and topCenter widgets.
535      */

536     public void setFont(Font f) {
537         super.setFont(f);
538         if (topLeft != null && !topLeft.isDisposed()) {
539             topLeft.setFont(f);
540         }
541         if (topCenter != null && !topCenter.isDisposed()) {
542             topCenter.setFont(f);
543         }
544         if (topRight != null && !topRight.isDisposed()) {
545             topRight.setFont(f);
546         }
547
548         layout();
549     }
550
551     /**
552      * Sets the layout which is associated with the receiver to be
553      * the argument which may be null.
554      * <p>
555      * Note : ViewForm does not use a layout class to size and position its children.
556      * </p>
557      *
558      * @param layout the receiver's new layout or null
559      *
560      * @exception SWTException <ul>
561      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
562      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
563      * </ul>
564      */

565     public void setLayout(Layout layout) {
566         checkWidget();
567         return;
568     }
569
570     /**
571      * Set the control that appears in the top center of the pane.
572      * Typically this is a toolbar.
573      * The topCenter is optional. Setting the topCenter to null will remove it from
574      * the pane - however, the creator of the topCenter must dispose of the topCenter.
575      *
576      * @param topCenter the control to be displayed in the top center or null
577      *
578      * @exception SWTException <ul>
579      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
580      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
581      * </ul>
582      */

583     public void setTopCenter(Control topCenter) {
584         checkWidget();
585         if (topCenter != null && topCenter.getParent() != this) {
586             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
587         }
588         if (this.topCenter != null && !this.topCenter.isDisposed()) {
589             this.topCenter.setBounds(OFFSCREEN, OFFSCREEN, 0, 0);
590         }
591         this.topCenter = topCenter;
592         layout();
593     }
594
595     /**
596      * Set the control that appears in the top left corner of the pane.
597      * Typically this is a label such as CLabel.
598      * The topLeft is optional. Setting the top left control to null will remove it from
599      * the pane - however, the creator of the control must dispose of the control.
600      *
601      * @param c the control to be displayed in the top left corner or null
602      *
603      * @exception SWTException <ul>
604      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
605      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
606      * </ul>
607      */

608     public void setTopLeft(Control c) {
609         checkWidget();
610         if (c != null && c.getParent() != this) {
611             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
612         }
613         if (this.topLeft != null && !this.topLeft.isDisposed()) {
614             this.topLeft.setBounds(OFFSCREEN, OFFSCREEN, 0, 0);
615         }
616         this.topLeft = c;
617         layout();
618     }
619
620     /**
621      * Set the control that appears in the top right corner of the pane.
622      * Typically this is a Close button or a composite with a Menu and Close button.
623      * The topRight is optional. Setting the top right control to null will remove it from
624      * the pane - however, the creator of the control must dispose of the control.
625      *
626      * @param c the control to be displayed in the top right corner or null
627      *
628      * @exception SWTException <ul>
629      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
630      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
631      * <li>ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm</li>
632      * </ul>
633      */

634     public void setTopRight(Control c) {
635         checkWidget();
636         if (c != null && c.getParent() != this) {
637             SWT.error(SWT.ERROR_INVALID_ARGUMENT);
638         }
639         if (this.topRight != null && !this.topRight.isDisposed()) {
640             this.topRight.setBounds(OFFSCREEN, OFFSCREEN, 0, 0);
641         }
642         this.topRight = c;
643         layout();
644     }
645
646     /**
647      * Specify whether the border should be displayed or not.
648      *
649      * @param show true if the border should be displayed
650      *
651      * @exception SWTException <ul>
652      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
653      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
654      * </ul>
655      */

656     public void setBorderVisible(boolean show) {
657         checkWidget();
658         if (showBorder == show) {
659             return;
660         }
661
662         showBorder = show;
663         if (showBorder) {
664             if ((getStyle() & SWT.FLAT) != 0) {
665                 BORDER_LEFT = BORDER_TOP = BORDER_RIGHT = BORDER_BOTTOM = 1;
666             } else {
667                 BORDER_LEFT = BORDER_TOP = 1;
668                 BORDER_RIGHT = BORDER_BOTTOM = 3;
669             }
670         } else {
671             BORDER_BOTTOM = BORDER_TOP = BORDER_LEFT = BORDER_RIGHT = 0;
672         }
673
674         layout();
675         redraw();
676     }
677
678     /**
679      * If true, the topCenter will always appear on a separate line by itself, otherwise the
680      * topCenter will appear in the top row if there is room and will be moved to the second row if
681      * required.
682      *
683      * @param show true if the topCenter will always appear on a separate line by itself
684      *
685      * @exception SWTException <ul>
686      * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
687      * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
688      * </ul>
689      */

690     public void setTopCenterSeparate(boolean show) {
691         checkWidget();
692         separateTopCenter = show;
693         layout();
694     }
695
696 }
697
Popular Tags