Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2010 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.editor.outline.quickoutline;
 
import  org.eclipse.core.commands.AbstractHandler;
import  org.eclipse.core.commands.ExecutionEvent;
import  org.eclipse.core.commands.ExecutionException;
import  org.eclipse.swt.widgets.Event;
import  org.eclipse.swt.widgets.Shell;

Author(s):
Peter Friese - Initial contribution and API
public class ShowQuickOutlineActionHandler extends AbstractHandler {
	private Injector injector;
	public Object execute(final ExecutionEvent eventthrows ExecutionException {
		final XtextEditor xtextEditor = EditorUtils.getActiveXtextEditor(event);
		if (xtextEditor != null) {
			final IXtextDocument document = xtextEditor.getDocument();
				public void process(XtextResource statethrows Exception {
					final QuickOutlinePopup quickOutlinePopup = createPopup(xtextEditor.getEditorSite().getShell());
					quickOutlinePopup.setEditor(xtextEditor);
					quickOutlinePopup.setInput(document);
					quickOutlinePopup.setEvent((Event) event.getTrigger());
					quickOutlinePopup.open();
				}
			});
		}
		return null;
	}

Since:
2.2
	protected QuickOutlinePopup createPopup(Shell parent) {
		QuickOutlinePopup result = new QuickOutlinePopup(parent);
		return result;
	}
New to GrepCode? Check out our FAQ X