本文整理汇总了Java中org.eclipse.jface.text.source.IAnnotationAccess类的典型用法代码示例。如果您正苦于以下问题:Java IAnnotationAccess类的具体用法?Java IAnnotationAccess怎么用?Java IAnnotationAccess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAnnotationAccess类属于org.eclipse.jface.text.source包,在下文中一共展示了IAnnotationAccess类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureAnnotationPreferences
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
private SourceViewerDecorationSupport configureAnnotationPreferences() {
ISharedTextColors textColors = EditorsUI.getSharedTextColors();
IAnnotationAccess annotationAccess = new DefaultMarkerAnnotationAccess();
final SourceViewerDecorationSupport support = new SourceViewerDecorationSupport(
sourceViewer, null, annotationAccess, textColors);
List annotationPreferences = new MarkerAnnotationPreferences()
.getAnnotationPreferences();
Iterator e = annotationPreferences.iterator();
while (e.hasNext())
support.setAnnotationPreference((AnnotationPreference) e.next());
support.install(EditorsUI.getPreferenceStore());
return support;
}
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:16,代码来源:SpellcheckableMessageArea.java
示例2: createAnnotationAccess
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
@Override
protected IAnnotationAccess createAnnotationAccess() {
return new DefaultMarkerAnnotationAccess() {
@Override
public int getLayer(Annotation annotation) {
if (annotation.isMarkedDeleted()) {
return IAnnotationAccessExtension.DEFAULT_LAYER;
}
return super.getLayer(annotation);
}
};
}
开发者ID:cplutte,项目名称:bts,代码行数:13,代码来源:XtextEditor.java
示例3: MinimapOverviewRuler
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
public MinimapOverviewRuler(IAnnotationAccess annotationAccess, ISharedTextColors sharedColors,
IOutlineModel outlineModel) {
super(annotationAccess, MinimapOverviewRulerPreferencesPage.getMinimapWidth(), sharedColors);
this.fOutlineModel = outlineModel;
propertyListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (MinimapOverviewRulerPreferencesPage.MINIMAP_WIDTH.equals(event.getProperty())) {
updateWidth();
}
}
};
if (outlineModel != null) {
modelListener = new ICallbackListener<IOutlineModel>() {
@Override
public Object call(IOutlineModel obj) {
lastModelChange = System.currentTimeMillis();
update();
return null;
}
};
ICallbackWithListeners<IOutlineModel> onModelChangedListener = outlineModel.getOnModelChangedCallback();
onModelChangedListener.registerListener(modelListener);
}
}
开发者ID:fabioz,项目名称:Pydev,代码行数:29,代码来源:MinimapOverviewRuler.java
示例4: SourceViewer
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
public SourceViewer(Composite parent, IVerticalRuler verticalRuler, IOverviewRuler overviewRuler,
boolean showAnnotationsOverview, int styles, IAnnotationAccess annotationAccess, ISharedTextColors sharedColors,
IDocument document)
{
super(parent, verticalRuler, overviewRuler, showAnnotationsOverview, SWT.BOLD);
int id = currentId++;
filename = VIEWER_CLASS_NAME + id++ + ".java";
this.sharedColors=sharedColors;
this.annotationAccess=annotationAccess;
this.fOverviewRuler=overviewRuler;
oldAnnotations= new HashMap<ProjectionAnnotation, Position>();
IJavaProject javaProject = JavaCore.create(BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject());
try
{
IPackageFragmentRoot[] ipackageFragmentRootList=javaProject.getPackageFragmentRoots();
IPackageFragmentRoot ipackageFragmentRoot=null;
for(IPackageFragmentRoot tempIpackageFragmentRoot:ipackageFragmentRootList)
{
if(tempIpackageFragmentRoot.getKind()==IPackageFragmentRoot.K_SOURCE
&& StringUtils.equals(PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER,tempIpackageFragmentRoot.getPath().removeFirstSegments(1).toString()))
{
ipackageFragmentRoot=tempIpackageFragmentRoot;
break;
}
}
IPackageFragment compilationUnitPackage= ipackageFragmentRoot.createPackageFragment(HYDROGRAPH_COMPILATIONUNIT_PACKAGE, true, new NullProgressMonitor());
compilatioUnit= compilationUnitPackage.createCompilationUnit(filename,document.get(),true, new NullProgressMonitor());
}
catch (Exception exception) {
LOGGER.warn("Exception occurred while initializing source viewer", exception);
} finally {
if (javaProject != null) {
try {
javaProject.close();
} catch (JavaModelException javaModelException) {
LOGGER.warn("Exception occurred while closing java-project", javaModelException);
}
}
}
initializeViewer(document);
updateContents();
}
开发者ID:capitalone,项目名称:Hydrograph,代码行数:45,代码来源:SourceViewer.java
示例5: AnnotationExpansionControl
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
/**
* Creates a new control.
*
* @param parent parent shell
* @param shellStyle additional style flags
* @param access the annotation access
*/
public AnnotationExpansionControl(Shell parent, int shellStyle, IAnnotationAccess access) {
fPaintListener= new MyPaintListener();
fMouseTrackListener= new MyMouseTrackListener();
fMouseListener= new MyMouseListener();
fMenuDetectListener= new MyMenuDetectListener();
fDisposeListener= new MyDisposeListener();
fViewportListener= new IViewportListener() {
public void viewportChanged(int verticalOffset) {
dispose();
}
};
fLayouter= new LinearLayouter();
if (access instanceof IAnnotationAccessExtension)
fAnnotationAccessExtension= (IAnnotationAccessExtension) access;
fShell= new Shell(parent, shellStyle | SWT.NO_FOCUS | SWT.ON_TOP);
Display display= fShell.getDisplay();
fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM);
// fComposite= new Composite(fShell, SWT.NO_FOCUS | SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.V_SCROLL);
GridLayout layout= new GridLayout(1, true);
layout.marginHeight= 0;
layout.marginWidth= 0;
fShell.setLayout(layout);
GridData data= new GridData(GridData.FILL_BOTH);
data.heightHint= fLayouter.getAnnotationSize() + 2 * fLayouter.getBorderWidth() + 4;
fComposite.setLayoutData(data);
fComposite.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseExit(MouseEvent e) {
if (fComposite == null)
return;
Control[] children= fComposite.getChildren();
Rectangle bounds= null;
for (int i= 0; i < children.length; i++) {
if (bounds == null)
bounds= children[i].getBounds();
else
bounds.add(children[i].getBounds());
if (bounds.contains(e.x, e.y))
return;
}
// if none of the children contains the event, we leave the popup
dispose();
}
});
// fComposite.getVerticalBar().addListener(SWT.Selection, new Listener() {
//
// public void handleEvent(Event event) {
// Rectangle bounds= fShell.getBounds();
// int x= bounds.x - fLayouter.getAnnotationSize() - fLayouter.getBorderWidth();
// int y= bounds.y;
// fShell.setBounds(x, y, bounds.width, bounds.height);
// }
//
// });
Cursor handCursor= getHandCursor(display);
fShell.setCursor(handCursor);
fComposite.setCursor(handCursor);
setInfoSystemColor();
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:80,代码来源:AnnotationExpansionControl.java
示例6: JavaExpandHover
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
public JavaExpandHover(CompositeRuler ruler, IAnnotationAccess access, IDoubleClickListener doubleClickListener) {
super(ruler, access, doubleClickListener);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:JavaExpandHover.java
示例7: CopiedOverviewRuler
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
/**
* Constructs a overview ruler of the given width using the given annotation
* access and the given color manager.
*
* @param annotationAccess the annotation access
* @param width the width of the vertical ruler
* @param sharedColors the color manager
* @param discolorTemporaryAnnotation <code>true</code> if temporary annotations should be discolored
* @since 3.4
*/
public CopiedOverviewRuler(IAnnotationAccess annotationAccess, int width, ISharedTextColors sharedColors,
boolean discolorTemporaryAnnotation) {
fAnnotationAccess = annotationAccess;
fWidth = width;
fSharedTextColors = sharedColors;
fIsTemporaryAnnotationDiscolored = discolorTemporaryAnnotation;
}
开发者ID:fabioz,项目名称:Pydev,代码行数:18,代码来源:CopiedOverviewRuler.java
示例8: AnnotationExpandHover
import org.eclipse.jface.text.source.IAnnotationAccess; //导入依赖的package包/类
/**
* Creates a new hover instance.
*
* @param ruler
* @param access
* @param doubleClickListener
*/
public AnnotationExpandHover(CompositeRuler ruler, IAnnotationAccess access, IDoubleClickListener doubleClickListener) {
fCompositeRuler= ruler;
fAnnotationAccess= access;
fDblClickListener= doubleClickListener;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:AnnotationExpandHover.java
注:本文中的org.eclipse.jface.text.source.IAnnotationAccess类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论