KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > TrimLayoutData


1 /*******************************************************************************
2  * Copyright (c) 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;
12
13 /**
14  * The layout data class used by the <code>WorkbenchLayout</code> to arrange
15  * trim around the workbench edges.
16  * <p>
17  * NOTE: This class is a part of a 'work in progress' and should not be used
18  * without consulting the Platform UI group. No guarantees are made as to the
19  * stability of the API (except that the javadoc will get better...;-).
20  * </p>
21  *
22  * @since 3.2
23  *
24  */

25 public class TrimLayoutData {
26
27     // Constants
28
/**
29      * The trim element will grow unbounded based on the amount of unused space
30      * in its TrimArea but will never be smaller than it's preferred size. Only
31      * one of <code>GROWABLE</code> or <code>SHRINKABLE</code> should be
32      * specified.
33      */

34     public static final int GROWABLE = 0x1;
35
36     /**
37      * The trim element will shrink to the <code>shrinkableSize</code> if
38      * needed to fit the element into the trim but will never grow larger than
39      */

40     public static final int SHRINKABLE = 0x2;
41
42     /**
43      * The trim element will grow in its 'minor' dimension (i.e. in Y if the
44      * trim is oriented horizontally) to match the size of the TrimArea that it
45      * is in.
46      */

47     public static final int GRAB_EXCESS_MINOR = 0x4;
48
49     // Fields
50
public String JavaDoc trimId;
51
52     public String JavaDoc areaId;
53
54     public int flags;
55
56     public ITrimAreaChangeListener listener;
57
58     public int shrinkableSize;
59
60     public TrimLayoutData(String JavaDoc trimId, String JavaDoc areaId, int flags,
61             ITrimAreaChangeListener listener) {
62         this.trimId = trimId;
63         this.areaId = areaId;
64         this.flags = flags;
65         this.listener = listener;
66     }
67
68     public TrimLayoutData(String JavaDoc trimId, String JavaDoc areaId, int flags) {
69         this(trimId, areaId, flags, null);
70     }
71
72     public TrimLayoutData(String JavaDoc trimId, String JavaDoc areaId) {
73         this(trimId, areaId, 0);
74     }
75
76     public void setAreaId(String JavaDoc newAreaId) {
77         if (listener != null) {
78             listener.areaChanged(WorkbenchLayout.getOrientation(areaId),
79                     WorkbenchLayout.getOrientation(newAreaId));
80         }
81
82         areaId = newAreaId;
83     }
84 }
85
Popular Tags