Author: rob.stryker(a)jboss.com
Date: 2007-09-25 15:47:05 -0400 (Tue, 25 Sep 2007)
New Revision: 3800
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/FilesetViewProvider.java
Log:
Edit File action was flaky. Is fixed
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/FilesetViewProvider.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/FilesetViewProvider.java 2007-09-25
19:29:15 UTC (rev 3799)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/FilesetViewProvider.java 2007-09-25
19:47:05 UTC (rev 3800)
@@ -52,6 +52,7 @@
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.FileStoreEditorInput;
import org.eclipse.ui.internal.util.SWTResourceUtil;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.server.core.IServer;
@@ -153,14 +154,20 @@
IWorkbench wb = PlatformUI.getWorkbench();
IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
IWorkbenchPage page = win.getActivePage();
-// IFileStore fileStore= EFS.getLocalFileSystem().fromLocalFile(file);
+ IFileStore fileStore= EFS.getLocalFileSystem().fromLocalFile(file);
if( eclipseFile != null ) {
IEditorInput input = new FileEditorInput(eclipseFile);
IEditorDescriptor desc = PlatformUI.getWorkbench().
getEditorRegistry().getDefaultEditor(file.getName());
if( desc != null )
page.openEditor(input, desc.getId());
- }
+ } else if( fileStore != null ){
+ IEditorInput input = new FileStoreEditorInput(fileStore);
+ IEditorDescriptor desc = PlatformUI.getWorkbench().
+ getEditorRegistry().getDefaultEditor(file.getName());
+ if( desc != null )
+ page.openEditor(input, desc.getId());
+ }
} catch( Exception e ) {
e.printStackTrace();
}
@@ -480,6 +487,12 @@
getEditorRegistry().getDefaultEditor(file.getName());
if( input != null && desc != null )
editable = true;
+ } else if( fileStore != null ){
+ IEditorInput input = new FileStoreEditorInput(fileStore);
+ IEditorDescriptor desc = PlatformUI.getWorkbench().
+ getEditorRegistry().getDefaultEditor(file.getName());
+ if( input != null && desc != null )
+ editable = true;
}
editFileAction.setEnabled(editable);
deleteFileAction.setEnabled(file.exists());
Show replies by date