1 19 20 package org.apache.jmeter.module.cookies; 21 22 import org.apache.jmeter.module.integration.JMeterIntegrationEngine; 23 import org.openide.ErrorManager; 24 import org.openide.filesystems.FileObject; 25 import org.openide.filesystems.FileUtil; 26 import org.openide.nodes.Node; 27 import org.openide.util.RequestProcessor; 28 import org.openide.windows.TopComponent; 29 30 34 public class JMeterEditable implements Node.Cookie { 35 36 public void edit(FileObject primaryFile) { 37 final TopComponent currentComponent = TopComponent.getRegistry().getActivated(); 38 try { 39 currentComponent.setCursor(org.openide.util.Utilities.createProgressCursor(currentComponent)); 40 Process prc = JMeterIntegrationEngine.getDefault().externalEdit(FileUtil.toFile(primaryFile).getCanonicalPath()); 41 } catch (Exception e) { 42 ErrorManager.getDefault().notify(ErrorManager.EXCEPTION, e); 43 } finally { 44 RequestProcessor.getDefault().post(new Runnable () { 45 public void run() { 46 currentComponent.setCursor(null); 47 } 48 }, 2000); 49 50 } 51 } 52 53 } 54 | Popular Tags |