[Jarspy-commits] CVS: JarSpy/src/com/ociweb/jarspy/intellij/plugin JarSpyIntelliJPluginAction.java,1
Status: Beta
Brought to you by:
brown_j
From: Jeff B. <br...@us...> - 2003-04-30 02:21:37
|
Update of /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/intellij/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv10725/src/com/ociweb/jarspy/intellij/plugin Modified Files: JarSpyIntelliJPluginAction.java Log Message: fix up plugin to deal with virtual files better Index: JarSpyIntelliJPluginAction.java =================================================================== RCS file: /cvsroot/jarspy/JarSpy/src/com/ociweb/jarspy/intellij/plugin/JarSpyIntelliJPluginAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JarSpyIntelliJPluginAction.java 30 Jan 2003 23:07:49 -0000 1.4 --- JarSpyIntelliJPluginAction.java 30 Apr 2003 02:21:32 -0000 1.5 *************** *** 23,30 **** --- 23,34 ---- import com.intellij.openapi.actionSystem.Presentation; import com.intellij.openapi.actionSystem.DataConstants; + import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; + import com.intellij.openapi.vfs.VirtualFileSystem; import com.intellij.openapi.wm.ToolWindow; import com.intellij.openapi.wm.ToolWindowManager; + import com.intellij.openapi.diagnostic.Logger; + import com.intellij.openapi.fileEditor.OpenFileDescriptor; public class JarSpyIntelliJPluginAction extends AnAction { *************** *** 45,51 **** public void actionPerformed(AnActionEvent e) { final VirtualFile file ! = (VirtualFile) e.getDataContext().getData(DataConstants.VIRTUAL_FILE); ! Project p = (Project) e.getDataContext().getData(DataConstants.PROJECT); ToolWindow tw = ToolWindowManager.getInstance(p).getToolWindow("JarSpy"); if (tw != null) { --- 49,60 ---- public void actionPerformed(AnActionEvent e) { + + Logger logger = Logger.getInstance(getClass().getName()); + final DataContext dataContext = e.getDataContext(); final VirtualFile file ! = (VirtualFile) dataContext.getData(DataConstants.VIRTUAL_FILE); ! ! Project p = (Project) dataContext.getData(DataConstants.PROJECT); ! ToolWindow tw = ToolWindowManager.getInstance(p).getToolWindow("JarSpy"); if (tw != null) { *************** *** 53,57 **** JarSpyIntelliJPlugin jsip = (JarSpyIntelliJPlugin) p.getComponent(JarSpyIntelliJPlugin.class); ! jsip.updateFile(file.getPath()); } } --- 62,68 ---- JarSpyIntelliJPlugin jsip = (JarSpyIntelliJPlugin) p.getComponent(JarSpyIntelliJPlugin.class); ! final String presentableUrl = file.getPresentableUrl(); ! logger.info("updating JarSpy with file: " + presentableUrl); ! jsip.updateFile(presentableUrl); } } |