KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.List JavaDoc;
14
15 import org.eclipse.swt.graphics.Rectangle;
16
17 /**
18  * This class represents a logical partition in the overall trim layout. The
19  * <code>TrimLayoutData</code> will specify the id of the area to be used for
20  * a particular trim element and the <code>WorkbenchLayout</code> will filter
21  * each trim control into the appropriate area based on the id.
22  * <p>
23  * This is a utility class used to support the <code>WorkbenchLayout</code> so
24  * the fields are all scoped to the package level to provide the layout full
25  * access to the structure.
26  * </p>
27  * <p>
28  * NOTE: This class is a part of a 'work in progress' and should not be used
29  * without consulting the Platform UI group. No guarantees are made as to the
30  * stability of the API (except that the javadoc will get better...;-).
31  * </p>
32  * <p>
33  *
34  * @see WorkbenchLayout
35  * @see TrimLayoutData
36  * </p>
37  *
38  * @since 3.2
39  *
40  */

41 public class TrimArea {
42
43     /**
44      * The id of this area. Trim controls whose <code>TrimLayoutData</code>
45      * specifies an id that matches this area's id are slotted into this area by
46      * the workbench layout.
47      */

48     String JavaDoc areaId;
49
50     /**
51      * This
52      */

53     int orientation;
54
55     int defaultMinor;
56
57     // 'Cache' variables
58
boolean cacheOK;
59
60     Rectangle areaBounds;
61
62     List JavaDoc trimContents;
63
64     List JavaDoc trimLines;
65
66     public TrimArea(String JavaDoc id, int orientation, int defaultMinor) {
67         this.areaId = id;
68         this.orientation = orientation;
69         this.defaultMinor = defaultMinor;
70
71         areaBounds = new Rectangle(0, 0, 0, 0);
72
73         // First use will fill the cache
74
cacheOK = false;
75     }
76 }
77
Popular Tags