本文整理匯總了Java中org.eclipse.ui.editors.text.EditorsUI.getAnnotationPreferenceLookup方法的典型用法代碼示例。如果您正苦於以下問題:Java EditorsUI.getAnnotationPreferenceLookup方法的具體用法?Java EditorsUI.getAnnotationPreferenceLookup怎麽用?Java EditorsUI.getAnnotationPreferenceLookup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.editors.text.EditorsUI
的用法示例。
在下文中一共展示了EditorsUI.getAnnotationPreferenceLookup方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: JavaSelectAnnotationRulerAction
import org.eclipse.ui.editors.text.EditorsUI; //導入方法依賴的package包/類
public JavaSelectAnnotationRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler) {
super(bundle, prefix, editor, ruler);
fBundle= bundle;
fTextEditor= editor;
fAnnotationPreferenceLookup= EditorsUI.getAnnotationPreferenceLookup();
fStore= JavaPlugin.getDefault().getCombinedPreferenceStore();
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.JAVA_SELECT_MARKER_RULER_ACTION);
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:11,代碼來源:JavaSelectAnnotationRulerAction.java
示例2: SelectQuickFixRulerAction
import org.eclipse.ui.editors.text.EditorsUI; //導入方法依賴的package包/類
public SelectQuickFixRulerAction(ResourceBundle bundle, String prefix, ITextEditor editor, IVerticalRulerInfo ruler)
{
super(bundle, prefix, editor, ruler);
mTextEditor= editor;
mAnnotationPreferenceLookup= EditorsUI.getAnnotationPreferenceLookup();
mStore= InstallOptionsPlugin.getDefault().getCombinedPreferenceStore();
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, "installoptions_quickfix_context"); //$NON-NLS-1$
}
示例3: getHoverInfo2
import org.eclipse.ui.editors.text.EditorsUI; //導入方法依賴的package包/類
@Override
public Object getHoverInfo2(ITextViewer textViewer, IRegion hoverRegion) {
IAnnotationModel model = sourceViewer.getAnnotationModel();
@SuppressWarnings("unchecked")
Iterator<Annotation> i = model.getAnnotationIterator();
Annotation provideText = null;
AnnotationPreferenceLookup preferenceLookup = EditorsUI.getAnnotationPreferenceLookup();
int annotationLayer = -1;
while (i.hasNext()) {
Annotation ann = i.next();
Position p = model.getPosition(ann);
if (p == null || !p.overlapsWith(hoverRegion.getOffset(), hoverRegion.getLength())) {
continue;
}
if (UNCHANGED_QUICKDIFF_ANNOTATION.equals(ann.getType())) {
continue; //Ignore unchanged line notification
}
if (provideText == null) {
provideText = ann;
}
AnnotationPreference preference = preferenceLookup.getAnnotationPreference(ann);
if (preference != null && preference.getPresentationLayer() > annotationLayer) {
provideText = ann;
annotationLayer = preference.getPresentationLayer();
}
}
String text = null;
if (provideText != null) {
if (this.hoverContributions.containsKey(provideText.getType())) {
text = this.hoverContributions.get(provideText.getType()).getHoverText(provideText, textViewer, hoverRegion);
}
else {
text = "<b>" + provideText.getText() + "</b>";
}
}
try {
if (text == null) {
IDocument document = textViewer.getDocument();
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 ext3 = (IDocumentExtension3) document;
ITypedRegion partition = ext3.getPartition(EditorConstants.BF_PARTITIONING, hoverRegion.getOffset(), false);
if (EditorConstants.PARTITION_TYPE_BRAINFUCK_CODE.equals(partition.getType())) {
text = "Offset: [<b>" + hoverRegion.getOffset() + "</b>]";
}
}
}
}
catch (BadLocationException | BadPartitioningException ex) {
BfActivator.getDefault().logError("hoverRegion partitioning could not be evaluated", ex);
}
return text;
}