Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
  
  package org.eclipse.xtext.ui.internal;
 
 import java.net.URL;
 import java.util.Map;
 
 import  org.eclipse.core.runtime.FileLocator;
 import  org.eclipse.core.runtime.Path;
 import  org.eclipse.jface.resource.ImageDescriptor;
 import  org.eclipse.jface.resource.ImageRegistry;
 import  org.eclipse.swt.SWT;
 import  org.eclipse.swt.graphics.Image;
 import  org.eclipse.swt.widgets.Display;
 import  org.eclipse.ui.ISharedImages;
 import  org.eclipse.ui.PlatformUI;
Bundle of all images used by the Xtext UI plugin. Inspired by PDEPluginImages.

Author(s):
Peter Friese - Initial contribution and API
Dennis H´┐Żbner
 
 public class XtextPluginImages {
 
 	private static final String NAME_PREFIX = . + "."//$NON-NLS-1$
 
 	private static ImageRegistry PLUGIN_REGISTRY;
 
 	public final static String ICONS_PATH = "icons/"//$NON-NLS-1$
 
Set of predefined Image Descriptors.
 
 
 	private static final String PATH_OBJ =  + "obj16/"//$NON-NLS-1$
 	//    private static final String PATH_VIEW = ICONS_PATH + "view16/"; //$NON-NLS-1$
 	private static final String PATH_LCL =  + "elcl16/"//$NON-NLS-1$
 	private static final String PATH_LCL_DISABLED =  + "dlcl16/"//$NON-NLS-1$
 	//    private static final String PATH_TOOL = ICONS_PATH + "etool16/"; //$NON-NLS-1$
     private static final String PATH_OVR =  + "ovr16/"//$NON-NLS-1$
 	//    private static final String PATH_WIZBAN = ICONS_PATH + "wizban/"; //$NON-NLS-1$
 
Frequently used images
 
 	public static final String OBJ_DESC_SERVICE_LOADED =  + "OBJ_DESC_SERVICE_LOADED"//$NON-NLS-1$
 	public static final String OBJ_DESC_SERVICE_NOT_LOADED =  + "OBJ_DESC_SERVICE_NOT_LOADED"//$NON-NLS-1$
 	public static final String OBJ_DESC_LANGUAGE =  + "OBJ_DESC_LANGUAGE"//$NON-NLS-1$
 
 	public static final String OBJ_CORRECTION_CHANGE =  + "CORRECTION_CHANGE"//$NON-NLS-1$
 
 	public static final String OBJ_FIXABLE_ERROR =  + "OBJ_FIXABLE_ERROR"//$NON-NLS-1$
 	public static final String OBJ_FIXABLE_WARNING =  + "OBJ_FIXABLE_WARNING"//$NON-NLS-1$
 	

Since:
2.3
 
 	public static final String OBJ_FIXABLE_INFO =  + "OBJ_FIXABLE_INFO"//$NON-NLS-1$
 
OBJ16
 
 	public static final ImageDescriptor DESC_SERVICE_LOADED_OBJ = create("service_loaded.gif"); //$NON-NLS-1$
 	public static final ImageDescriptor DESC_SERVICE_NOT_LOADED_OBJ = create("service_not_loaded.gif"); //$NON-NLS-1$
 	public static final ImageDescriptor DESC_LANGUAGE_OBJ = create("font.gif"); //$NON-NLS-1$
 	
 	public static final ImageDescriptor DESC_CORRECTION_CHANGE = create("correction_change.gif"); //$NON-NLS-1$
 
 	public static final ImageDescriptor DESC_FIXABLE_ERROR = create("quickfix_error_obj.gif"); //$NON-NLS-1$
 	public static final ImageDescriptor DESC_FIXABLE_WARNING = create("quickfix_warning_obj.gif"); //$NON-NLS-1$
 	

Since:
2.3
 
 	public static final ImageDescriptor DESC_FIXABLE_INFO = create("quickfix_info_obj.gif"); //$NON-NLS-1$
 
OVR16
 
 	public static final ImageDescriptor DESC_OVR_ERROR = create("error_co.gif"); //$NON-NLS-1$
 	public static final ImageDescriptor DESC_OVR_WARNING =create("warning_co.gif"); //$NON-NLS-1$
 
TOOL16
 

LCL
 
 	public static final ImageDescriptor DESC_LINK_WITH_EDITOR = create("synced.gif"); //$NON-NLS-1$
	public static final ImageDescriptor DESC_ALPHAB_SORT_CO = create("alphab_sort_co.gif"); //$NON-NLS-1$
	public static final ImageDescriptor DESC_LINK_WITH_EDITOR_DISABLED = create("synced.gif"); //$NON-NLS-1$
	public static final ImageDescriptor DESC_ALPHAB_SORT_CO_DISABLED = create("alphab_sort_co.gif"); //$NON-NLS-1$
	public static final ImageDescriptor DESC_SEARCH_PREVIOUS = create("prev_nav.gif");
	public static final ImageDescriptor DESC_SEARCH_NEXT = create("next_nav.gif");
	public static final ImageDescriptor DESC_EXPAND_ALL = create("expandall.gif");
	public static final ImageDescriptor DESC_COLLAPSE_ALL = create("collapseall.gif");
	public static final ImageDescriptor DESC_OPEN_DECLARATION = create("goto_input.gif");
	public static final ImageDescriptor DESC_OPEN_DECLARATION_DISABLED = create("goto_input.gif");
	public static final ImageDescriptor DESC_MARK_OCCURRENCES = create("mark_occurrences.gif");
	public static final ImageDescriptor DESC_MARK_OCCURRENCES_DISABLED = create("mark_occurrences.gif");

WIZ
View
	private static ImageDescriptor create(String prefixString name) {
		return ImageDescriptor.createFromURL(makeImageURL(prefixname));
	}
	public static Image get(String key) {
		return .get(key);
	}
	private static void ensureInitialized() {
		if ( == null)
	}
	private static boolean imagesInitialized;
	private static final Map<String, Image> annotationImagesFixable = new HashMap<String, Image>();
	private static final Map<String, Image> annotationImagesNonFixable = new HashMap<String, Image>();
	private static final Map<String, Image> annotationImagesDeleted = new HashMap<String, Image>();
	private static final void initializeImageMaps() {
			return;
		ISharedImages sharedImages= PlatformUI.getWorkbench().getSharedImages();
		Image error = sharedImages.getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
		Image warning = sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
		Image info = sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
		Display display = Display.getCurrent();
		.put(.new Image(displayerror, SWT.IMAGE_GRAY));
		.put(.new Image(displaywarning, SWT.IMAGE_GRAY));
		.put(.new Image(displayinfo, SWT.IMAGE_GRAY));
	}	
	/* package */
	private static final void initialize() {
		 = new ImageRegistry();
	}
	private static URL makeImageURL(String prefixString name) {
		String path = "$nl$/" + prefix + name//$NON-NLS-1$
		return FileLocator.find(Activator.getDefault().getBundle(), new Path(path), null);
	}
	public static Image manage(String key, ImageDescriptor desc) {
		Image image = desc.createImage();
		.put(keyimage);
		return image;
	}
	public static Map<String, Image> getAnnotationImagesNonfixable() {
	}
	public static Map<String, Image> getAnnotationImagesFixable() {
	}
	public static Map<String, Image> getAnnotationImagesDeleted() {
	}
New to GrepCode? Check out our FAQ X