01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.texteditor.rulers;
11:
12: import org.eclipse.core.runtime.Assert;
13:
14: /**
15: * Describes one placement constraint of a contribution to the
16: * <code>org.eclipse.ui.texteditor.rulerColumns</code> extension point.
17: *
18: * @since 3.3
19: */
20: public final class RulerColumnPlacementConstraint {
21: private final String fId;
22: private final boolean fBefore;
23:
24: /**
25: * Creates a new constraint.
26: *
27: * @param id the id of the referenced contribution
28: * @param before <code>true</code> if the specifying should come <i>before</i>,
29: * <code>false</code> if it should come <i>after</i> the contribution referenced by
30: * id.
31: */
32: RulerColumnPlacementConstraint(String id, boolean before) {
33: Assert.isLegal(id != null);
34: fId = id;
35: fBefore = before;
36: }
37:
38: /**
39: * Returns the identifier of the referenced column contribution.
40: *
41: * @return the identifier of the referenced column contribution
42: */
43: public String getId() {
44: return fId;
45: }
46:
47: /**
48: * Returns <code>true</code> if the receiver is a <i>before</i> constraint,
49: * <code>false</code> if it is an <i>after</i> constraint.
50: *
51: * @return <code>true</code> if the receiver is a <i>before</i> constraint,
52: * <code>false</code> if it is an <i>after</i> constraint
53: */
54: public boolean isBefore() {
55: return fBefore;
56: }
57: }
|