X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Feditor%2FSCLAnnotationAccessNew.java;fp=bundles%2Forg.simantics.scl.ui%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fui%2Feditor%2FSCLAnnotationAccessNew.java;h=d129f4c054d534481f2810f090e68260df54d167;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hp=0b2fb6ed6c78144681c0d00666a0072b1f0916a4;hpb=24e2b34260f219f0d1644ca7a138894980e25b14;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/SCLAnnotationAccessNew.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/SCLAnnotationAccessNew.java index 0b2fb6ed6..d129f4c05 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/SCLAnnotationAccessNew.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/editor/SCLAnnotationAccessNew.java @@ -1,72 +1,72 @@ -package org.simantics.scl.ui.editor; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.jface.text.source.IAnnotationAccess; -import org.eclipse.jface.text.source.IAnnotationAccessExtension; -import org.eclipse.jface.text.source.ImageUtilities; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Canvas; - -final class SCLAnnotationAccessNew implements IAnnotationAccess, IAnnotationAccessExtension { - - ImageRegistry registry; - - public SCLAnnotationAccessNew(ImageRegistry registry) { - this.registry = registry; - } - - @Override - public Object getType(Annotation annotation) { - return annotation.getType(); - } - - @Override - public boolean isMultiLine(Annotation annotation) { - return true; - } - - @Override - public boolean isTemporary(Annotation annotation) { - return !annotation.isPersistent(); - } - - @Override - public String getTypeLabel(Annotation annotation) { - return annotation.getType(); - } - - @Override - public int getLayer(Annotation annotation) { - return 0; - } - - @Override - public void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds) { - Image image = registry.get("error"); - if(image == null) { - registry.put("error", ImageDescriptor.createFromFile(getClass(), "error_tsk.gif")); - image = registry.get("error"); - } - ImageUtilities.drawImage(image, gc, canvas, bounds, SWT.CENTER, SWT.TOP); - } - - @Override - public boolean isPaintable(Annotation annotation) { - return true; - } - - @Override - public boolean isSubtype(Object annotationType, Object potentialSupertype) { - return annotationType.equals(potentialSupertype); - } - - @Override - public Object[] getSupertypes(Object annotationType) { - return new Object[0]; - } +package org.simantics.scl.ui.editor; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.jface.text.source.Annotation; +import org.eclipse.jface.text.source.IAnnotationAccess; +import org.eclipse.jface.text.source.IAnnotationAccessExtension; +import org.eclipse.jface.text.source.ImageUtilities; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Canvas; + +final class SCLAnnotationAccessNew implements IAnnotationAccess, IAnnotationAccessExtension { + + ImageRegistry registry; + + public SCLAnnotationAccessNew(ImageRegistry registry) { + this.registry = registry; + } + + @Override + public Object getType(Annotation annotation) { + return annotation.getType(); + } + + @Override + public boolean isMultiLine(Annotation annotation) { + return true; + } + + @Override + public boolean isTemporary(Annotation annotation) { + return !annotation.isPersistent(); + } + + @Override + public String getTypeLabel(Annotation annotation) { + return annotation.getType(); + } + + @Override + public int getLayer(Annotation annotation) { + return 0; + } + + @Override + public void paint(Annotation annotation, GC gc, Canvas canvas, Rectangle bounds) { + Image image = registry.get("error"); + if(image == null) { + registry.put("error", ImageDescriptor.createFromFile(getClass(), "error_tsk.gif")); + image = registry.get("error"); + } + ImageUtilities.drawImage(image, gc, canvas, bounds, SWT.CENTER, SWT.TOP); + } + + @Override + public boolean isPaintable(Annotation annotation) { + return true; + } + + @Override + public boolean isSubtype(Object annotationType, Object potentialSupertype) { + return annotationType.equals(potentialSupertype); + } + + @Override + public Object[] getSupertypes(Object annotationType) { + return new Object[0]; + } } \ No newline at end of file