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.IConfigurationElement;
13:
14: import org.eclipse.jface.text.source.IVerticalRulerColumn;
15:
16: import org.eclipse.ui.texteditor.ITextEditor;
17:
18: /**
19: * Interface that has to be implemented by contributions to the
20: * <code>org.eclipse.ui.texteditor.rulerColumns</code> extension point.
21: * <p>
22: * Implementors must have a zero-argument constructor so that they can be created
23: * by {@link IConfigurationElement#createExecutableExtension(String)}.</p>
24: *
25: * @since 3.3
26: */
27: public interface IContributedRulerColumn extends IVerticalRulerColumn {
28:
29: /**
30: * Returns the extension point descriptor of this ruler.
31: *
32: * @return descriptor the extension point descriptor of this ruler or <code>null</code> if called before {@link #columnCreated()}
33: */
34: RulerColumnDescriptor getDescriptor();
35:
36: /**
37: * Sets the extension point descriptor of this ruler.
38: * <p>
39: * <em>This method will be called by the framework and must not
40: * be called by clients.</em></p>
41: *
42: * @param descriptor the extension point descriptor
43: */
44: void setDescriptor(RulerColumnDescriptor descriptor);
45:
46: /**
47: * Sets the editor (called right after the extension was instantiated).
48: * <p>
49: * <em>This method will be called by the framework and must not
50: * be called by clients.</em></p>
51: *
52: * @param editor the editor targeted by this ruler instance
53: */
54: void setEditor(ITextEditor editor);
55:
56: /**
57: * Returns the editor targeted by this ruler instance.
58: *
59: * @return the editor targeted by this ruler instance or <code>null</code> if called before {@link #columnCreated()}
60: */
61: ITextEditor getEditor();
62:
63: /**
64: * Hook method called after a column has been instantiated, but before it is
65: * added to a {@link org.eclipse.jface.text.source.CompositeRuler} and before
66: * {@linkplain org.eclipse.jface.text.source.IVerticalRulerColumn#createControl(org.eclipse.jface.text.source.CompositeRuler, org.eclipse.swt.widgets.Composite) createControl}
67: * is called.
68: * <p>
69: * This happens when
70: * <ul>
71: * <li>the column is set visible by the user or programmatically</li>
72: * <li>the editor is created, if this ruler targets the editor and is enabled by default</li>
73: * <li>the editor input changes and the column now targets the new editor contents.</li>
74: * </ul></p>
75: */
76: void columnCreated();
77:
78: /**
79: * Hook method called after a column has been removed from the {@link org.eclipse.jface.text.source.CompositeRuler}.
80: * <p>
81: * This happens when
82: * <ul>
83: * <li>the column is hidden by the user or programmatically</li>
84: * <li>the editor is closed</li>
85: * <li>the editor input changes and the column no longer targets the editor
86: * contents.</li>
87: * </ul>
88: * </p>
89: * <p>
90: * The column will not be used after this method has been called. A new
91: * column will be instantiated if the same column type should be shown for
92: * the same editor.
93: * </p>
94: */
95: void columnRemoved();
96:
97: }
|