Search in sources :

Example 1 with ThreadDumpTextArea

use of com.kyj.fx.voeditor.visual.component.text.ThreadDumpTextArea in project Gargoyle by callakrsos.

the class JavaProcessMonitor method menuThreadDumpOnAction.

/**
	 * Thread Dump
	 * @작성자 : KYJ
	 * @작성일 : 2017. 1. 23.
	 * @param e
	 * @throws Exception
	 */
public void menuThreadDumpOnAction(ActionEvent e) {
    ApplicationModel selectedItem = getSelectedItem(item -> item);
    if (selectedItem == null) {
        Window window = FxUtil.getWindow(this.getParent(), () -> {
            return SharedMemory.getPrimaryStage();
        });
        DialogUtil.showMessageDialog(window, "덤프를 출력할 프로세스를 선택.");
        return;
    }
    Integer selectedProcessId = selectedItem.getProcessId();
    String applicationName = selectedItem.getApplicationName();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    Monitors.runStackTool(selectedProcessId, out);
    ThreadDumpTextArea parent = new ThreadDumpTextArea();
    parent.setContent(out.toString());
    FxUtil.createStageAndShow(parent, stage -> {
        stage.initOwner(getParent().getScene().getWindow());
        stage.setWidth(1200d);
        stage.setHeight(800d);
        stage.setTitle("App - " + applicationName);
    });
//		FxUtil.createSimpleTextAreaAndShow(out.toString(), stage -> {
//
//
//		});
}
Also used : Window(javafx.stage.Window) ThreadDumpTextArea(com.kyj.fx.voeditor.visual.component.text.ThreadDumpTextArea) ApplicationModel(com.kyj.bci.monitor.ApplicationModel) ByteArrayOutputStream(org.apache.commons.io.output.ByteArrayOutputStream)

Aggregations

ApplicationModel (com.kyj.bci.monitor.ApplicationModel)1 ThreadDumpTextArea (com.kyj.fx.voeditor.visual.component.text.ThreadDumpTextArea)1 Window (javafx.stage.Window)1 ByteArrayOutputStream (org.apache.commons.io.output.ByteArrayOutputStream)1