Skip to content

Commit

Permalink
Allow the crash report to be viewed in a term tree by double clicking on
Browse files Browse the repository at this point in the history
it.
  • Loading branch information
Andy Till committed Sep 12, 2015
1 parent 8153b9e commit b463c10
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 22 deletions.
12 changes: 5 additions & 7 deletions src/main/java/erlyberly/DbgTraceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,11 @@ private void onTraceLogClear() {
}

private void onTraceClicked(MouseEvent me) {
if(me.getButton().equals(MouseButton.PRIMARY)) {
if(me.getClickCount() == 2) {
TraceLog selectedItem = tracesBox.getSelectionModel().getSelectedItem();

if(selectedItem != null && selectedItem != null) {
showTraceTermView(selectedItem);
}
if(me.getButton().equals(MouseButton.PRIMARY) && me.getClickCount() == 2) {
TraceLog selectedItem = tracesBox.getSelectionModel().getSelectedItem();

if(selectedItem != null && selectedItem != null) {
showTraceTermView(selectedItem);
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/erlyberly/TopBarView.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;
import javafx.scene.input.MouseButton;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
Expand Down Expand Up @@ -126,12 +127,25 @@ public void traceLogsChanged(ListChangeListener.Change<? extends OtpErlangObject
unreadCrashReportsProperty.set(unreadCrashReportsProperty.get() + size);
}
}

private void showCrashReportWindow() {
unreadCrashReportsProperty.set(0);

ListView<OtpErlangObject> crashReportListView;

crashReportListView = new ListView<OtpErlangObject>(ErlyBerly.nodeAPI().getCrashReports());
crashReportListView.setOnMouseClicked((me) -> {
if(me.getButton().equals(MouseButton.PRIMARY) && me.getClickCount() == 2) {
OtpErlangObject obj = crashReportListView.getSelectionModel().getSelectedItem();

if(obj != null && obj != null) {
CrashReportView crashReportView;
crashReportView = new CrashReportView();
crashReportView.setCrashReport(obj);
showWindow("Crash Report", crashReportView);
}
}
});
showWindow("Crash Reports", crashReportListView);
}

Expand Down
35 changes: 20 additions & 15 deletions src/main/java/erlyberly/node/NodeAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,25 +275,30 @@ public synchronized void retrieveProcessInfo(ArrayList<ProcInfo> processes) thro
}
}

private boolean ensureAlive() {
try {
receiveRPC(0);
private boolean ensureAlive() {
try {
receiveRPC(0);
if(connection.isAlive())
return true;
} catch (OtpErlangException | IOException e1) {
Platform.runLater(() -> { connectedProperty.set(false); });
while(true) {
try {
connect();
break;
}
catch(Exception e) {
int millis = 50;
mySleep(millis);

}
e1.printStackTrace();
}

Platform.runLater(() -> { connectedProperty.set(false); });

while(true) {
try {
connect();
break;
}
catch(Exception e) {
int millis = 50;
mySleep(millis);

}
}
return true;
}
}

private void mySleep(int millis) {
try {
Expand Down

0 comments on commit b463c10

Please sign in to comment.