Java Code Examples for org.eclipse.jface.viewers.IDecoration#BOTTOM_LEFT

The following examples show how to use org.eclipse.jface.viewers.IDecoration#BOTTOM_LEFT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XtendEditorErrorTickUpdater.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void updateEditorImage(XtextEditor xtextEditor) {
	if (xtextEditor != null && !xtextEditor.isEditable()) {
		Severity severity = getSeverity(xtextEditor);
		if (severity != null && severity != Severity.INFO) {
			ImageDescriptor descriptor = severity == Severity.ERROR ? XtextPluginImages.DESC_OVR_ERROR
					: XtextPluginImages.DESC_OVR_WARNING;
			// TODO replace with new constructor that takes an ImageDescription when on Oxygen+
			DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(pluginImageHelper.getImage(images.forReadonly()), descriptor,
					IDecoration.BOTTOM_LEFT);
			scheduleUpdateEditor(decorationOverlayIcon);
		} else {
			scheduleUpdateEditor(images.forReadonly());
		}
	} else {
		super.updateEditorImage(xtextEditor);
	}
}
 
Example 2
Source File: GamlEditorTickUpdater.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void updateEditorImage(final XtextEditor editor) {
	Severity severity = getSeverity(editor);
	ImageDescriptor descriptor = null;
	if (severity == null || severity == Severity.INFO) {
		descriptor = GamaIcons.create(IGamaIcons.OVERLAY_OK).descriptor();
	} else if (severity == Severity.ERROR) {
		descriptor = GamaIcons.create("navigator/overlay.error2").descriptor();
	} else if (severity == Severity.WARNING) {
		descriptor = GamaIcons.create("navigator/overlay.warning2").descriptor();
	} else {
		super.updateEditorImage(editor);
		return;
	}
	final DecorationOverlayIcon decorationOverlayIcon =
			new DecorationOverlayIcon(editor.getDefaultImage(), descriptor, IDecoration.BOTTOM_LEFT);
	scheduleUpdateEditor(decorationOverlayIcon);
}
 
Example 3
Source File: N4JSDecoratorRow.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Do the decorators start on the left border?
 */
private boolean isDecoLeft() {
	switch (quadrant) {
	case IDecoration.TOP_LEFT:
	case IDecoration.BOTTOM_LEFT:
		return true;

	default:
		return false;
	}
}
 
Example 4
Source File: XtextEditorErrorTickUpdater.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void updateEditorImage(XtextEditor xtextEditor) {
	Severity severity = getSeverity(xtextEditor);
	if (severity != null && severity != Severity.INFO) {
		ImageDescriptor descriptor = severity == Severity.ERROR ? XtextPluginImages.DESC_OVR_ERROR
				: XtextPluginImages.DESC_OVR_WARNING;
		DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(defaultImage, descriptor,
				IDecoration.BOTTOM_LEFT);
		scheduleUpdateEditor(decorationOverlayIcon);
	} else {
		scheduleUpdateEditor(defaultImage);
	}
}
 
Example 5
Source File: CorePlugin.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
@Override
protected void initializeImageRegistry(ImageRegistry reg) {
  super.initializeImageRegistry(reg);

  reg.put(CoreImages.LIBRARY_ICON, imageDescriptorFromPath("icons/library_obj.gif"));

  reg.put(CoreImages.TERMINATE_ICON, imageDescriptorFromPath("icons/terminate_obj.gif"));

  ImageDescriptor errorOverlayDescriptor = imageDescriptorFromPath("icons/error_co.gif");
  reg.put(CoreImages.ERROR_OVERLAY, errorOverlayDescriptor);

  ImageDescriptor invalidSdkDescriptor = new DecorationOverlayIcon(
      getImage(CoreImages.LIBRARY_ICON), errorOverlayDescriptor, IDecoration.BOTTOM_LEFT);

  reg.put(CoreImages.INVALID_SDK_ICON, invalidSdkDescriptor);
}
 
Example 6
Source File: Activator.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Returns the image with the specified Java image decorated added in the lower left quadrant of the image.
 */
private static ImageDescriptor decorateImageDescriptor(Image baseImage, ImageDescriptor overlayDescriptor) {
  return new DecorationOverlayIcon(baseImage, overlayDescriptor, IDecoration.BOTTOM_LEFT);
}
 
Example 7
Source File: ImportModelLabelProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
protected DecorationOverlayIcon createStatusOverlay(final Image image, IStatus status) {
    return new DecorationOverlayIcon(image,
            statusDecorator(status),
            IDecoration.BOTTOM_LEFT);
}