KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > texteditor > rulers > RulerColumnPlacementConstraint


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.texteditor.rulers;
12
13 import org.eclipse.core.runtime.Assert;
14
15 /**
16  * Describes one placement constraint of a contribution to the
17  * <code>org.eclipse.ui.texteditor.rulerColumns</code> extension point.
18  *
19  * @since 3.3
20  */

21 public final class RulerColumnPlacementConstraint {
22     private final String JavaDoc fId;
23     private final boolean fBefore;
24
25     /**
26      * Creates a new constraint.
27      *
28      * @param id the id of the referenced contribution
29      * @param before <code>true</code> if the specifying should come <i>before</i>,
30      * <code>false</code> if it should come <i>after</i> the contribution referenced by
31      * id.
32      */

33     RulerColumnPlacementConstraint(String JavaDoc id, boolean before) {
34         Assert.isLegal(id != null);
35         fId= id;
36         fBefore= before;
37     }
38
39     /**
40      * Returns the identifier of the referenced column contribution.
41      *
42      * @return the identifier of the referenced column contribution
43      */

44     public String JavaDoc getId() {
45         return fId;
46     }
47
48     /**
49      * Returns <code>true</code> if the receiver is a <i>before</i> constraint,
50      * <code>false</code> if it is an <i>after</i> constraint.
51      *
52      * @return <code>true</code> if the receiver is a <i>before</i> constraint,
53      * <code>false</code> if it is an <i>after</i> constraint
54      */

55     public boolean isBefore() {
56         return fBefore;
57     }
58 }
59
Popular Tags