KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > forms > widgets > ILayoutExtension


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.forms.widgets;
12 import org.eclipse.swt.widgets.Composite;
13 /**
14  * Classes that extend abstract class Layout and implement this interface can
15  * take part in layout computation of the TableWrapLayout manager. This layout
16  * uses alternative algorithm that computes columns before rows. It allows it
17  * to 'flow' wrapped text proportionally (similar to the way web browser
18  * renders tables). Custom layout managers that implement this interface will
19  * allow TableWrapLayout to properly compute width hint to pass.
20  *
21  * @see TableWrapLayout
22  * @see ColumnLayout
23  * @since 3.0
24  */

25 public interface ILayoutExtension {
26     /**
27      * Computes the minimum width of the parent. All widgets capable of word
28      * wrapping should return the width of the longest word that cannot be
29      * broken any further.
30      *
31      * @param parent the parent composite
32      * @param changed <code>true</code> if the cached information should be
33      * flushed, <code>false</code> otherwise.
34      * @return the minimum width of the parent composite
35      */

36     public int computeMinimumWidth(Composite parent, boolean changed);
37     /**
38      * Computes the maximum width of the parent. All widgets capable of word
39      * wrapping should return the length of the entire text with wrapping
40      * turned off.
41      *
42      * @param parent the parent composite
43      * @param changed <code>true</code> if the cached information
44      * should be flushed, <code>false</code> otherwise.
45      * @return the maximum width of the parent composite
46      */

47     public int computeMaximumWidth(Composite parent, boolean changed);
48 }
49
Popular Tags