mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 11:50:45 +00:00
Debug tooltips on hover
When in Debug mode and stopped at a breakpoint, hovering over dientifiers will show up their name and value in a tooltip. All matching locals will be shown, one on each line.
This commit is contained in:
@@ -46,6 +46,7 @@ import com.jpexs.decompiler.flash.tags.ABCContainerTag;
|
||||
import com.jpexs.decompiler.graph.DottedChain;
|
||||
import com.jpexs.helpers.CancellableWorker;
|
||||
import java.awt.Point;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
@@ -789,4 +790,24 @@ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretL
|
||||
super.setText(t);
|
||||
setCaretPosition(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolTipText(MouseEvent e) {
|
||||
// not debugging: so return existing text
|
||||
if (abcPanel.getDebugPanel().localsTable == null)
|
||||
return super.getToolTipText();
|
||||
|
||||
final Point point = new Point(e.getX(), e.getY());
|
||||
final int pos = abcPanel.decompiledTextArea.viewToModel(point);
|
||||
final String identifier = abcPanel.getMainPanel().getActionPanel().getStringUnderPosition(pos, abcPanel.decompiledTextArea);
|
||||
|
||||
if (identifier != null && !identifier.isEmpty())
|
||||
{
|
||||
String tooltipText = abcPanel.getDebugPanel().localsTable.TryGetDebugHoverToolTipText(identifier);
|
||||
return (tooltipText == null ? super.getToolTipText() : tooltipText);
|
||||
}
|
||||
|
||||
// not found: so return existing text
|
||||
return super.getToolTipText();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user