下面列出了怎么用org.eclipse.jface.text.ITextPresentationListener的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* copied from org.eclipse.jdt.internal.ui.javaeditor.JavaSourceViewer.prependTextPresentationListener(ITextPresentationListener)
*/
public void prependTextPresentationListener(ITextPresentationListener listener) {
Assert.isNotNull(listener);
if (fTextPresentationListeners == null)
fTextPresentationListeners= new ArrayList<ITextPresentationListener>();
fTextPresentationListeners.remove(listener);
fTextPresentationListeners.add(0, listener);
}
/**
* Prepends the text presentation listener at the beginning of the viewer's
* list of text presentation listeners. If the listener is already registered
* with the viewer this call moves the listener to the beginning of
* the list.
*
* @param listener the text presentation listener
* @since 3.0
*/
public void prependTextPresentationListener(ITextPresentationListener listener) {
Assert.isNotNull(listener);
if (fTextPresentationListeners == null)
fTextPresentationListeners= new ArrayList<ITextPresentationListener>();
fTextPresentationListeners.remove(listener);
fTextPresentationListeners.add(0, listener);
}
public void addTextPresentationListener(ITextPresentationListener listener) {
viewer.addTextPresentationListener(listener);
}
public void removeTextPresentationListener(ITextPresentationListener listener) {
viewer.removeTextPresentationListener(listener);
}