1 11 package org.eclipse.pde.internal.runtime.logview; 12 13 import org.eclipse.core.filesystem.EFS; 14 import org.eclipse.core.filesystem.IFileStore; 15 import org.eclipse.core.runtime.IPath; 16 import org.eclipse.core.runtime.Path; 17 import org.eclipse.jface.action.Action; 18 import org.eclipse.pde.internal.runtime.PDERuntimePlugin; 19 import org.eclipse.ui.IWorkbenchPage; 20 import org.eclipse.ui.IWorkbenchWindow; 21 import org.eclipse.ui.PartInitException; 22 import org.eclipse.ui.ide.IDE; 23 24 30 public class OpenIDELogFileAction extends Action { 31 32 private LogView fView; 33 34 public OpenIDELogFileAction (LogView logView) { 35 fView = logView; 36 } 37 38 public void run() { 39 IPath logPath = new Path(fView.getLogFile().getAbsolutePath()); 40 IFileStore fileStore= EFS.getLocalFileSystem().getStore(logPath); 41 if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) { 42 IWorkbenchWindow ww = PDERuntimePlugin.getActiveWorkbenchWindow(); 43 IWorkbenchPage page = ww.getActivePage(); 44 try { 45 IDE.openEditorOnFileStore(page, fileStore); 46 } catch (PartInitException e) { 47 } 48 } 49 } 50 51 } 52 | Popular Tags |