Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2014 itemis AG ( 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 /
 package org.eclipse.xtext.ui.generator.trace;
import  org.eclipse.jface.resource.JFaceResources;
import  org.eclipse.jface.resource.LocalResourceManager;
import  org.eclipse.jface.resource.ResourceManager;
import  org.eclipse.jface.viewers.LabelProvider;
import  org.eclipse.swt.widgets.Shell;
import  org.eclipse.ui.dialogs.TwoPaneElementSelector;

Moritz Eysholdt - Initial contribution and API
public class FileOpenerSelector extends TwoPaneElementSelector {
	protected static class EditorOpenerLabelProvider extends LabelProvider {
		private ResourceManager resourceManager = new LocalResourceManager(JFaceResources.getResources());
		public Image getImage(Object element) {
			return (Image) .get(((FileOpenerelement).getImageDescriptor());
	protected static class EditorOpenerDetailLabelProvider extends EditorOpenerLabelProvider {
		public String getText(Object element) {
			return ((FileOpenerelement).getQualifiedLabel();
	protected static class EditorOpenerShortLabelProvider extends EditorOpenerLabelProvider {
		public String getText(Object element) {
			return ((FileOpenerelement).getShortLabel();
	public FileOpenerSelector(Shell parentCollection<FileOpenerstorages) {
		setTitle("Open File");
		setMessage("Select a file to open.");
		setElements(storages.toArray(new FileOpener[storages.size()]));
New to GrepCode? Check out our FAQ X