mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 01:39:21 +02:00
GP-5296 added help links for function graph layout actions
This commit is contained in:
parent
0844ff6cca
commit
a9f8fc7c26
9 changed files with 73 additions and 13 deletions
|
@ -58,7 +58,19 @@
|
|||
</BLOCKQUOTE>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
<H2><A name="Flow_Chart_Layout"></A>Flow Chart Layout</H2>
|
||||
<blockquote>
|
||||
<P>This layout organizes the code blocks into a tree structure with each parent vertex in the
|
||||
tree being centered over its children. Edges are routed orthongally with minimal edge
|
||||
crossings.</P>
|
||||
</blockquote>
|
||||
<H2><A name="Flow_Chart_Layout_Left"></A>Flow Chart Layout (Left)</H2>
|
||||
<blockquote>
|
||||
<P>This layout is the same as the Flow Chart Layout, except parent nodes are place directly
|
||||
above their left most child.</P>
|
||||
</blockquote>
|
||||
|
||||
</BLOCKQUOTE>
|
||||
|
||||
<P class="providedbyplugin">Provided by: <I>Function Graph Plugin</I></P>
|
||||
<BR>
|
||||
|
|
|
@ -911,13 +911,11 @@ class FGActionManager {
|
|||
private List<ActionState<FGLayoutProvider>> createActionStates(
|
||||
List<FGLayoutProvider> layoutProviders) {
|
||||
List<ActionState<FGLayoutProvider>> list = new ArrayList<>();
|
||||
HelpLocation layoutHelpLocation =
|
||||
new HelpLocation("FunctionGraphPlugin", "Function_Graph_Action_Layout");
|
||||
for (FGLayoutProvider layout : layoutProviders) {
|
||||
|
||||
ActionState<FGLayoutProvider> layoutState =
|
||||
new ActionState<>(layout.getLayoutName(), layout.getActionIcon(), layout);
|
||||
layoutState.setHelpLocation(layoutHelpLocation);
|
||||
layoutState.setHelpLocation(layout.getHelpLocation());
|
||||
list.add(layoutState);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
|
|||
import ghidra.app.plugin.core.functiongraph.graph.vertex.FGVertex;
|
||||
import ghidra.framework.options.Options;
|
||||
import ghidra.graph.viewer.layout.LayoutProvider;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -44,4 +45,13 @@ public abstract class FGLayoutProvider implements LayoutProvider<FGVertex, FGEdg
|
|||
public FGLayoutOptions createLayoutOptions(Options options) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the help location for this layout. Subclasses should override this method to give
|
||||
* specific help for the graph layout performed by this provider.
|
||||
* @return the help location for this layout
|
||||
*/
|
||||
public HelpLocation getHelpLocation() {
|
||||
return new HelpLocation("FunctionGraphPlugin", "Function_Graph_Action_Layout");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import generic.theme.GIcon;
|
|||
import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayout;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayoutProviderExtensionPoint;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -51,4 +52,9 @@ public class FlowChartLayoutProvider extends FGLayoutProviderExtensionPoint {
|
|||
return new FGFlowChartLayout(graph, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
return new HelpLocation("FunctionGraphPlugin", "Flow_Chart_Layout");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import generic.theme.GIcon;
|
|||
import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayout;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayoutProviderExtensionPoint;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -51,4 +52,8 @@ public class LeftAlignedFlowChartLayoutProvider extends FGLayoutProviderExtensio
|
|||
return new FGFlowChartLayout(graph, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
return new HelpLocation("FunctionGraphPlugin", "Flow_Chart_Layout_Left");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import javax.swing.Icon;
|
|||
import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayout;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.layout.FGLayoutProvider;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
|
@ -27,6 +28,9 @@ import ghidra.util.task.TaskMonitor;
|
|||
* A layout provider that allows us to specify a Jung layout by name.
|
||||
*/
|
||||
public class JgtNamedLayoutProvider extends FGLayoutProvider {
|
||||
// layout algorithm categories
|
||||
static final String MIN_CROSS = "Hierarchical MinCross";
|
||||
static final String VERT_MIN_CROSS = "Vertical Hierarchical MinCross";
|
||||
|
||||
private String layoutName;
|
||||
|
||||
|
@ -62,4 +66,17 @@ public class JgtNamedLayoutProvider extends FGLayoutProvider {
|
|||
public String toString() {
|
||||
return layoutName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
// condense hierarchical action help to the top-level help description
|
||||
String anchor = layoutName;
|
||||
if (layoutName.contains(VERT_MIN_CROSS)) {
|
||||
anchor = VERT_MIN_CROSS;
|
||||
}
|
||||
else if (layoutName.contains(MIN_CROSS)) {
|
||||
anchor = MIN_CROSS;
|
||||
}
|
||||
return new HelpLocation("GraphServices", anchor);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import ghidra.graph.VisualGraph;
|
|||
import ghidra.graph.viewer.layout.*;
|
||||
import ghidra.graph.viewer.vertex.VisualGraphVertexShapeTransformer;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
@ -374,4 +375,9 @@ public class TestFGLayoutProvider extends FGLayoutProvider {
|
|||
//@formatter:on
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import javax.swing.Icon;
|
|||
import generic.theme.GIcon;
|
||||
import ghidra.app.plugin.core.functiongraph.graph.FunctionGraph;
|
||||
import ghidra.framework.options.Options;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
public class DecompilerNestedLayoutProvider extends FGLayoutProviderExtensionPoint {
|
||||
|
@ -56,4 +57,9 @@ public class DecompilerNestedLayoutProvider extends FGLayoutProviderExtensionPoi
|
|||
return 200; // above the others
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpLocation getHelpLocation() {
|
||||
return new HelpLocation("FunctionGraphPlugin", "Nested_Code_Layout");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
<BLOCKQUOTE>
|
||||
<BLOCKQUOTE>
|
||||
<UL>
|
||||
<LI><A name="Compact Hierarchical"/>
|
||||
<LI><A name="Compact_Hierarchical"/>
|
||||
<B>Compact Hierarchical</B> is the <B>TidierTree Layout Algorithm</B>. It builds a tree
|
||||
structure and attempts to reduce horizontal space.</LI>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue