Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

work with fileinput too

  • Loading branch information...
commit 026d98048736c26c90d3e54e32b830c705f5c00b 1 parent 2a8efc4
@JPMoresmau authored
View
13 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/properties/ModuleInclusionPP.java
@@ -13,6 +13,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.dialogs.PropertyPage;
/**
@@ -27,10 +28,18 @@ public ModuleInclusionPP() {
// NOOP
}
+ protected IFile getFile(){
+ Object o=getElement();
+ if (o instanceof IFileEditorInput){
+ return ((IFileEditorInput)o).getFile();
+ }
+ return (IFile)o;
+ }
+
@Override
protected Control createContents( final Composite parent ) {
mic=new ModuleInclusionComposite( parent, SWT.NONE );
- IFile f=(IFile)getElement();
+ IFile f=getFile();
IContainer src=ResourceUtil.getSourceContainer( f );
if (src!=null){
@@ -53,7 +62,7 @@ public boolean performOk() {
if (info!=null){
mic.populateInfo( info );
ModuleCreationOperation mco=new ModuleCreationOperation( info );
- mco.setGeneratedFile( (IFile)getElement() );
+ mco.setGeneratedFile( getFile() );
try {
mco.run( new NullProgressMonitor() );
Please sign in to comment.
Something went wrong with that request. Please try again.