예제 #1
0
  public void setCrashReport(CrashReport crashReport) {
    stackTraceView.populateFromCrashReport(crashReport);
    termTreeView.populateFromTerm(crashReport.getProps());

    Object[][] crashProps = {
      {"Pid", crashReport.getPid()},
      {"Reg. Name", crashReport.getRegisteredName()},
      {
        "Error",
        ErlyBerly.getTermFormatter()
            .exceptionToString(crashReport.getErrorClass(), crashReport.getErrorReason())
      },
      {
        "Initial Call",
        ErlyBerly.getTermFormatter()
            .modFuncArgsToString((OtpErlangTuple) crashReport.getProcessInitialCall())
      }
    };

    TableColumn<Object[], Object> keyColumn = new TableColumn<>("Key");
    TableColumn<Object[], Object> valueColumn = new TableColumn<>("Value");

    keyColumn.setCellValueFactory(
        new Callback<CellDataFeatures<Object[], Object>, ObservableValue<Object>>() {
          @Override
          public ObservableValue<Object> call(CellDataFeatures<Object[], Object> p) {
            return new SimpleObjectProperty<>((p.getValue()[0]));
          }
        });

    valueColumn.setCellValueFactory(
        new Callback<CellDataFeatures<Object[], Object>, ObservableValue<Object>>() {
          @Override
          public ObservableValue<Object> call(CellDataFeatures<Object[], Object> p) {
            return new SimpleObjectProperty<>((p.getValue()[1]));
          }
        });

    crashInfoTable.getColumns().add(keyColumn);
    crashInfoTable.getColumns().add(valueColumn);

    crashInfoTable.getItems().addAll(crashProps);

    crashReport
        .getCallArgs()
        .ifPresent(
            (callArgs) -> {
              argsTreeView.populateFromListContents(callArgs);
            });
  }
예제 #2
0
  @Override
  public void initialize(URL url, ResourceBundle r) {
    modFuncContextMenu = new ModFuncContextMenu(dbgController);
    modulesTree
        .getSelectionModel()
        .selectedItemProperty()
        .addListener(
            (o, old, newItem) -> {
              modFuncContextMenu.selectedTreeItemProperty().set(newItem);
              if (newItem != null)
                modFuncContextMenu.selectedItemProperty().set(newItem.getValue());
            });

    sortedTreeModules.setComparator(treeItemModFuncComparator());

    SplitPane.setResizableWithParent(modulesBox, Boolean.FALSE);

    ErlyBerly.nodeAPI().connectedProperty().addListener(this::onConnected);

    modulesTree.setCellFactory(new ModFuncTreeCellFactory(dbgController));
    /*modulesTree.setOnKeyPressed(this::onKeyPressInModuleTree);*/
    modulesTree.setContextMenu(modFuncContextMenu);

    addModulesFloatySearchControl();

    dbgController.initialize(url, r);

    dbgSplitPane.getItems().add(new DbgTraceView(dbgController));
  }
예제 #3
0
  private void onConnected(Observable o) {
    boolean connected = ErlyBerly.nodeAPI().connectedProperty().get();

    // disable buttons when not connected
    /*seqTraceMenuItem.setDisable(!connected);*/

    if (connected) {
      refreshModules();
      dbgController.reapplyTraces();
    } else {
      treeModules.clear();
    }
  }
예제 #4
0
  public static void showSourceCodeWindow(String title, String moduleSourceCode) {
    assert Platform.isFxApplicationThread();

    TextArea textArea;

    textArea = new TextArea(moduleSourceCode);
    textArea.getStyleClass().add("mod-src");
    textArea.setEditable(false);

    Scene scene = new Scene(textArea, 800, 800);
    ErlyBerly.applyCssToWIndow(scene);

    Stage primaryStage;

    primaryStage = new Stage();
    primaryStage.setTitle(title);
    primaryStage.setScene(scene);
    primaryStage.show();

    CloseWindowOnEscape.apply(scene, primaryStage);
  }