/** * The constructor. * * @param section The property section */ public DumpHprofAction(AbstractJvmPropertySection section) { setText(Messages.dumpHprofLabel); setImageDescriptor(Activator.getImageDescriptor(ISharedImages.TAKE_HPROF_DUMP_IMG_PATH)); setDisabledImageDescriptor( Activator.getImageDescriptor(ISharedImages.DISABLED_TAKE_HPROF_DUMP_IMG_PATH)); setId(getClass().getName()); this.section = section; }
/* * @see Dialog#okPressed() */ @Override protected void okPressed() { Activator.getDefault() .getDialogSettings(getClass().getName()) .put(TRANSFER_KEY, isFileTransfered); super.okPressed(); }
/** * The constructor. * * @param shell The parent shell for dialog * @param initialFileName The initial file name * @param isAgentLoaded */ public FileNameInputDialog(Shell shell, String initialFileName, boolean isAgentLoaded) { super(shell); this.fileName = initialFileName; this.isAgentLoaded = isAgentLoaded; isFileTransfered = Activator.getDefault().getDialogSettings(getClass().getName()).getBoolean(TRANSFER_KEY); }
/* * @see Action#run() */ @Override public void run() { IActiveJvm jvm = section.getJvm(); if (jvm == null) { return; } // get file name for remote host final String fileName[] = new String[1]; final boolean transfer[] = new boolean[] {false}; try { if (jvm.isRemote()) { final FileNameInputDialog dialog = new FileNameInputDialog( section.getPart().getSite().getShell(), getInitialFileName(jvm), isAgentLoaded(jvm)); Display.getDefault() .syncExec( new Runnable() { @Override public void run() { if (dialog.open() == Window.OK) { fileName[0] = dialog.getFileName(); transfer[0] = dialog.isFileTransfered(); } } }); if (fileName[0] == null) { return; } } } catch (JvmCoreException e) { Activator.log(Messages.dumpHeapDataFailedMsg, e); return; } dumpHprof(fileName[0], transfer[0]); }
/** The constructor. */ public AbstractClearAction() { setImageDescriptor(Activator.getImageDescriptor(ISharedImages.CLEAR_IMG_PATH)); setDisabledImageDescriptor(Activator.getImageDescriptor(ISharedImages.DISABLED_CLEAR_IMG_PATH)); setId(getClass().getName()); }