Skip to main content
summaryrefslogtreecommitdiffstats
blob: c99606b5152ab0a4f4ca694b996de6e8bf23e157 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package org.eclipse.e4.tools.emf.editor3x;

import org.eclipse.e4.core.contexts.ContextFunction;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;

public class EditorProjectFunction extends ContextFunction {

	@Override
	public Object compute(IEclipseContext context) {
		final IEditorInput input = context.get(IEditorInput.class);
		if( input != null ) {
			return ((IFileEditorInput)input).getFile().getProject();	
		}
		return null;
	}

}

Back to the top