01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 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.texteditor.rulers;
11:
12: import org.eclipse.core.runtime.Assert;
13: import org.eclipse.core.runtime.IConfigurationElement;
14:
15: import org.eclipse.ui.texteditor.ITextEditor;
16:
17: /**
18: * Helper class for contributions to the
19: * <code>org.eclipse.ui.texteditor.rulerColumns</code> extension point.
20: * <p>
21: * Subclasses must have a zero-argument constructor so that they can be created by
22: * {@link IConfigurationElement#createExecutableExtension(String)}.</p>
23: *
24: * @since 3.3
25: */
26: public abstract class AbstractContributedRulerColumn implements
27: IContributedRulerColumn {
28: /** The contribution descriptor. */
29: private RulerColumnDescriptor fDescriptor;
30: /** The target editor. */
31: private ITextEditor fEditor;
32:
33: /*
34: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#getDescriptor()
35: */
36: public final RulerColumnDescriptor getDescriptor() {
37: return fDescriptor;
38: }
39:
40: /*
41: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#setDescriptor(org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor)
42: */
43: public final void setDescriptor(RulerColumnDescriptor descriptor) {
44: Assert.isLegal(descriptor != null);
45: Assert.isTrue(fDescriptor == null);
46: fDescriptor = descriptor;
47: }
48:
49: /*
50: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#setEditor(org.eclipse.ui.texteditor.ITextEditor)
51: */
52: public final void setEditor(ITextEditor editor) {
53: Assert.isLegal(editor != null);
54: Assert.isTrue(fEditor == null);
55: fEditor = editor;
56: }
57:
58: /*
59: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#getEditor()
60: */
61: public final ITextEditor getEditor() {
62: return fEditor;
63: }
64:
65: /*
66: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#columnCreated()
67: */
68: public void columnCreated() {
69: }
70:
71: /*
72: * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#columnRemoved()
73: */
74: public void columnRemoved() {
75: }
76: }
|