KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > rulers > AbstractContributedRulerColumn


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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.texteditor.rulers;
12
13 import org.eclipse.core.runtime.Assert;
14 import org.eclipse.core.runtime.IConfigurationElement;
15
16 import org.eclipse.ui.texteditor.ITextEditor;
17
18
19 /**
20  * Helper class for contributions to the
21  * <code>org.eclipse.ui.texteditor.rulerColumns</code> extension point.
22  * <p>
23  * Subclasses must have a zero-argument constructor so that they can be created by
24  * {@link IConfigurationElement#createExecutableExtension(String)}.</p>
25  *
26  * @since 3.3
27  */

28 public abstract class AbstractContributedRulerColumn implements IContributedRulerColumn {
29     /** The contribution descriptor. */
30     private RulerColumnDescriptor fDescriptor;
31     /** The target editor. */
32     private ITextEditor fEditor;
33
34     
35     /*
36      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#getDescriptor()
37      */

38     public final RulerColumnDescriptor getDescriptor() {
39         return fDescriptor;
40     }
41
42     /*
43      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#setDescriptor(org.eclipse.ui.texteditor.rulers.RulerColumnDescriptor)
44      */

45     public final void setDescriptor(RulerColumnDescriptor descriptor) {
46         Assert.isLegal(descriptor != null);
47         Assert.isTrue(fDescriptor == null);
48         fDescriptor= descriptor;
49     }
50
51     /*
52      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#setEditor(org.eclipse.ui.texteditor.ITextEditor)
53      */

54     public final void setEditor(ITextEditor editor) {
55         Assert.isLegal(editor != null);
56         Assert.isTrue(fEditor == null);
57         fEditor= editor;
58     }
59
60     /*
61      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#getEditor()
62      */

63     public final ITextEditor getEditor() {
64         return fEditor;
65     }
66
67     /*
68      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#columnCreated()
69      */

70     public void columnCreated() {
71     }
72
73     /*
74      * @see org.eclipse.ui.texteditor.rulers.IContributedRulerColumn#columnRemoved()
75      */

76     public void columnRemoved() {
77     }
78 }
79
Popular Tags