コールスタックビュー上からメソッド実行を選択してデルタ抽出を行う際に、不要な選択ダイアログを表示しないように修正。
1 parent 1d6c9b1 commit 6968b3114e1635823ec742484f1f71d3cc7da782
r-isitani authored on 4 May 2020
Showing 1 changed file
View
26
src/org/ntlab/traceDebugger/CallStackView.java
String callerId = caller.getThisObjId();
String calleeClassName = callee.getThisClassName();
String calleeId = callee.getThisObjId();
TracePoint before = callee.getCallerTracePoint();
Variable variable = new Variable("tmp", callerClassName, callerId, calleeClassName, calleeId, before, false);
String[] texts = {"Container to Component", "This to Another"};
RadioButtonDialog dialog = new RadioButtonDialog(null, "Which patterns?", texts);
if (dialog.open() != InputDialog.OK) return;
String selectionType = dialog.getValue();
delta(variable, false, selectionType.startsWith("This"));
Variable variable = new Variable("tmp", callerClassName, callerId, calleeClassName, calleeId, before, false);
delta(variable, false);
}
};
deltaAction.setText("Extract Delta");
deltaAction.setToolTipText("Extract Delta");
callStackModels.highlight(methodExecution);
viewer.refresh();
}
private void delta(Variable variable, boolean isCollection, boolean isForThisToAnother) {
private void delta(Variable variable, boolean isCollection) {
AbstractAnalyzer analyzer = TraceDebuggerPlugin.getAnalyzer();
if (analyzer instanceof DeltaExtractionAnalyzer) {
DeltaExtractionAnalyzer deltaAnalyzer = (DeltaExtractionAnalyzer)analyzer;
IWorkbench workbench = PlatformUI.getWorkbench();
try {
// note: 同一ビューを複数開くテスト
String subIdWithNewView = deltaAnalyzer.getNextDeltaMarkerSubId();
DeltaMarkerView newDeltaMarkerView = (DeltaMarkerView)workbenchPage.showView(DeltaMarkerView.ID, subIdWithNewView, IWorkbenchPage.VIEW_ACTIVATE);
if (isForThisToAnother) {
deltaAnalyzer.extractDeltaForThisToAnother(variable, isCollection, newDeltaMarkerView, subIdWithNewView);
} else {
deltaAnalyzer.extractDelta(variable, isCollection, newDeltaMarkerView, subIdWithNewView);
}
deltaAnalyzer.extractDeltaForThisToAnother(variable, isCollection, newDeltaMarkerView, subIdWithNewView);
TracePoint coordinatorPoint = newDeltaMarkerView.getCoordinatorPoint();
TracePoint creationPoint = newDeltaMarkerView.getCreationPoint();
DebuggingController controller = DebuggingController.getInstance();
controller.jumpToTheTracePoint(creationPoint, false);