本文整理汇总了Java中org.eclipse.jface.text.source.AnnotationModel类的典型用法代码示例。如果您正苦于以下问题:Java AnnotationModel类的具体用法?Java AnnotationModel怎么用?Java AnnotationModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnnotationModel类属于org.eclipse.jface.text.source包,在下文中一共展示了AnnotationModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConfiguration
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
private static SourceViewerConfiguration createConfiguration(Input<?> input, IDocument document,
EditingContext editingContext, AppMemento appMemento) {
ThreadSynchronize threadSynchronize = null;
MplPresentationReconciler reconciler = new MplPresentationReconciler();
ProposalComputer proposalComputer = new MplProposalComputer(document, editingContext);
IAnnotationModel annotationModel = new AnnotationModel();
AnnotationPresenter annotationPresenter = new MplAnnotationPresenter();
HoverInformationProvider hoverInformationProvider = new MplHoverInformationProvider();
CompletionProposalPresenter proposalPresenter = MplGraphicalCompletionProposal::new;
SearchProvider searchProvider = null;
NavigationProvider navigationProvider = null;
EditorOpener editorOpener = null;
BehaviorContributor behaviorContributor = null;
IContextInformationValidator contextInformationValidator = null;
DefaultSourceViewerConfiguration result = new DefaultSourceViewerConfiguration(
threadSynchronize, input, reconciler, appMemento, proposalComputer, annotationModel,
annotationPresenter, hoverInformationProvider, proposalPresenter, searchProvider,
navigationProvider, editorOpener, behaviorContributor, contextInformationValidator);
result.getFeatures().add(Feature.SHOW_LINE_NUMBERS);
return result;
}
示例2: setModel
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
protected void setModel(XtextDocument document, String prefix, String editablePart, String suffix) {
if (this.insertLineBreaks) {
String delimiter = document.getDefaultLineDelimiter();
prefix = prefix + delimiter;
suffix = delimiter + suffix;
}
String model = prefix + editablePart + suffix;
document.set(model);
XtextResource resource = createResource(model);
document.setInput(resource);
AnnotationModel annotationModel = new AnnotationModel();
if (document instanceof ISynchronizable) {
Object lock = ((ISynchronizable) document).getLockObject();
if (lock == null) {
lock = new Object();
((ISynchronizable) document).setLockObject(lock);
}
((ISynchronizable) annotationModel).setLockObject(lock);
}
this.viewer.setDocument(document, annotationModel, prefix.length(), editablePart.length());
}
示例3: connect
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
@Override
public void connect(Object element) throws CoreException {
super.connect(element);
if (getFileInfo(element) != null)
return;
CompilationUnitInfo info= fFakeCUMapForMissingInfo.get(element);
if (info == null) {
ICompilationUnit cu= createFakeCompiltationUnit(element, true);
if (cu == null)
return;
info= new CompilationUnitInfo();
info.fCopy= cu;
info.fElement= element;
info.fModel= new AnnotationModel();
fFakeCUMapForMissingInfo.put(element, info);
}
info.fCount++;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:CompilationUnitDocumentProvider.java
示例4: createAnnotationModel
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
@Override
protected IAnnotationModel createAnnotationModel(Object element) throws CoreException {
if (element instanceof IFileEditorInput) {
IFileEditorInput input = (IFileEditorInput) element;
return new XtextResourceMarkerAnnotationModel(input.getFile(), issueResolutionProvider, issueUtil);
} else if (element instanceof IURIEditorInput) {
return new AnnotationModel();
}
return super.createAnnotationModel(element);
}
示例5: loadTransliteration
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
private void loadTransliteration(BTSLemmaEntry lemma) {
// if (lemma == null)
// {
// if (embeddedEditor != null)
// {
// embeddedEditorModelAccess.updateModel("\r",
// "", "\r");
//// embeddedEditor.getViewer().setDocument(null);
// }
// return;
// }
modelAnnotationMap = new HashMap<String, BTSModelAnnotation>();
relatingObjectsAnnotationMap = new HashMap<EObject, List<BTSModelAnnotation>>();
Document doc = new Document();
AnnotationModel tempAnnotationModel = new AnnotationModel();
lemmaAnnotationMap = new HashMap<String, List<Object>>();
lemmaEditorController.transformToDocument(textContent, doc, tempAnnotationModel, relatingObjects, relatingObjectsMap, lemmaAnnotationMap);
String textString = doc.get();
// take care of empty input
if (textString.length() == 0)
{
textString = "§§";
}
embeddedEditorModelAccess.updateModel("\r",
textString, "\r");
annotationModel = embeddedEditor.getViewer().getAnnotationModel();
loadAnnotations2Editor(annotationModel, tempAnnotationModel);
processLemmaAnnotions(lemmaAnnotationMap);
}
示例6: createXtextSourceViewer
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
protected void createXtextSourceViewer() {
sourceviewer = new XtextSourceViewerEx(styledText, preferenceStoreAccess.getPreferenceStore());
sourceviewer.configure(configuration);
sourceviewer.setDocument(document, new AnnotationModel());
SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(sourceviewer, null,
new DefaultMarkerAnnotationAccess(), getSharedColors());
configureSourceViewerDecorationSupport(support);
}
示例7: createAnnotationModel
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public IAnnotationModel createAnnotationModel(IPath path)
{
IResource file = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (file instanceof IFile)
{
return new CommonAnnotationModel(file);
}
return new AnnotationModel();
}
示例8: NSISConsole
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public NSISConsole()
{
super(EclipseNSISPlugin.getResourceString("console.name"), TYPE, EclipseNSISPlugin.getImageManager().getImageDescriptor(EclipseNSISPlugin.getResourceString("nsis.icon")), true); //$NON-NLS-1$ //$NON-NLS-2$
getDocument().addDocumentListener(this);
mOffset = getDocument().getLength();
mPreferenceStore = EclipseNSISPlugin.getDefault().getPreferenceStore();
mConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
mAutoShowLevel = NSISPreferences.getInstance().getAutoShowConsole();
mPartitioner = new NSISConsolePartitioner(this);
mPartitioner.connect(getDocument());
mPreferenceStore.addPropertyChangeListener(this);
mErrorImage = EclipseNSISPlugin.getImageManager().getImage(EclipseNSISPlugin.getResourceString("error.icon")); //$NON-NLS-1$
mWarningImage = EclipseNSISPlugin.getImageManager().getImage(EclipseNSISPlugin.getResourceString("warning.icon")); //$NON-NLS-1$
mAnnotationModel = new AnnotationModel();
}
示例9: createCompositeRuler
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
/**
* Creates a new line number ruler column that is appropriately initialized.
*
* @return the created line number column
*/
private CompositeRuler createCompositeRuler( )
{
CompositeRuler ruler = new CompositeRuler( );
ruler.setModel( new AnnotationModel( ) );
return ruler;
}
示例10: SourceViewerConfig
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public SourceViewerConfig(AnnotationModel annotationModel,
Document document) {
strategy = new CommentSpellingReconcileStrategy(annotationModel);
strategy.setDocument(document);
}
示例11: CommentSpellingReconcileStrategy
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public CommentSpellingReconcileStrategy(AnnotationModel annotationModel) {
this.fAnnotationModel = annotationModel;
fSpellingContext = new SpellingContext();
fSpellingContext.setContentType(Platform.getContentTypeManager().getContentType(IContentTypeManager.CT_TEXT));
}
示例12: createAnnotationModel
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
protected AnnotationModel createAnnotationModel() {
return new AnnotationModel();
}
示例13: createPartControl
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public void createPartControl(Composite parent)
{
int VERTICAL_RULER_WIDTH = 12;
int styles = SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION;
ISharedTextColors sharedColors = EditorsPlugin.getDefault().getSharedTextColors();
IOverviewRuler overviewRuler = new OverviewRuler(null, VERTICAL_RULER_WIDTH, sharedColors);
CompositeRuler ruler = new CompositeRuler(VERTICAL_RULER_WIDTH);
_document = new Document();
_document.set(_docString);
_annotationModel = new AnnotationModel();
_annotationModel.connect(_document);
_sourceViewer = new SourceViewer(parent, ruler, overviewRuler, true, styles);
_sourceViewer.configure(new SourceViewerConfiguration());
_sds = new SourceViewerDecorationSupport(_sourceViewer, overviewRuler, null, sharedColors);
AnnotationPreference ap = new AnnotationPreference();
ap.setColorPreferenceKey(ANNO_KEY_COLOR);
ap.setHighlightPreferenceKey(ANNO_KEY_HIGHLIGHT);
ap.setVerticalRulerPreferenceKey(ANNO_KEY_VERTICAL);
ap.setOverviewRulerPreferenceKey(ANNO_KEY_OVERVIEW);
ap.setTextPreferenceKey(ANNO_KEY_TEXT);
ap.setAnnotationType(ANNO_TYPE);
_sds.setAnnotationPreference(ap);
// _sds.install(EditorsPlugin.getDefault().getPreferenceStore());
_sourceViewer.setDocument(_document, _annotationModel);
_sourceViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
ruler.addDecorator(0, new LineNumberRulerColumn());
Annotation annotation = new Annotation(false);
annotation.setType(ANNO_TYPE);
Position position = new Position(0, 4);
_annotationModel.addAnnotation(annotation, position);
parent.layout();
}
示例14: createXtextSourceViewer
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
protected XtextSourceViewer createXtextSourceViewer() {
final XtextSourceViewer result = new XtextSourceViewerEx(getStyledText(), getPreferenceStoreAccess().getPreferenceStore());
result.configure(getXtextSourceViewerConfiguration());
result.setDocument(getXtextDocument(), new AnnotationModel());
return result;
}
示例15: createAnnotationModel
import org.eclipse.jface.text.source.AnnotationModel; //导入依赖的package包/类
public IAnnotationModel createAnnotationModel(IPath path) {
IResource file= ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (file instanceof IFile)
return new CompilationUnitAnnotationModel(file);
return new AnnotationModel();
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:CompilationUnitDocumentProvider.java