mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GP-3089 - Theme Fixes
This commit is contained in:
parent
1e8d324166
commit
7adfd1e8fb
12 changed files with 84 additions and 116 deletions
|
@ -69,7 +69,6 @@
|
|||
</TBODY>
|
||||
</TABLE><BR>
|
||||
<BR>
|
||||
|
||||
|
||||
<P>Once a graph is stale, you can press the refresh button at any time to have the graph
|
||||
re-create itself <B>without performing a relayout</B>. The green box in the image above
|
||||
|
|
|
@ -1,69 +0,0 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.app.plugin.core.functiongraph;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.JComponent;
|
||||
|
||||
import docking.*;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.plugin.core.functiongraph.mvc.FGController;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
public class FGSatelliteUndockedProvider extends ComponentProviderAdapter {
|
||||
|
||||
static final String NAME = "Function Graph Satellite";
|
||||
private static final Icon ICON = new GIcon("icon.functiongraph.action.provider.satellite");
|
||||
|
||||
private FGController controller;
|
||||
private JComponent satelliteComponent;
|
||||
|
||||
public FGSatelliteUndockedProvider(FunctionGraphPlugin plugin, FGController controller,
|
||||
JComponent satelliteComponent) {
|
||||
super(plugin.getTool(), NAME, plugin.getName());
|
||||
this.controller = controller;
|
||||
this.satelliteComponent = satelliteComponent;
|
||||
satelliteComponent.setMinimumSize(new Dimension(400, 400));
|
||||
|
||||
setHelpLocation(new HelpLocation("FunctionGraphPlugin", "Satellite_View_Dock"));
|
||||
|
||||
setIcon(ICON);
|
||||
setDefaultWindowPosition(WindowPosition.WINDOW);
|
||||
setWindowMenuGroup(FunctionGraphPlugin.FUNCTION_GRAPH_NAME);
|
||||
|
||||
addToTool();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
ComponentProvider primaryProvider = controller.getProvider();
|
||||
return primaryProvider.getActionContext(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent getComponent() {
|
||||
return satelliteComponent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown() {
|
||||
controller.satelliteProviderShown();
|
||||
}
|
||||
}
|
|
@ -79,6 +79,8 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
protected static final Transferable DUMMY_TRANSFERABLE = new DummyTransferable();
|
||||
|
||||
protected static final String SATELLITE_NAME = "Function Graph Satellite";
|
||||
|
||||
protected PluginTool tool;
|
||||
protected FunctionGraphPlugin graphPlugin;
|
||||
protected ProgramDB program;
|
||||
|
@ -170,12 +172,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
// 01002239
|
||||
|
||||
/*
|
||||
|
||||
|
||||
A
|
||||
|->B
|
||||
C
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// A
|
||||
|
@ -210,7 +212,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
private void build_ghidra(ToyProgramBuilder builder) throws MemoryAccessException {
|
||||
/*
|
||||
Originally from notepad 'ghidra'
|
||||
|
||||
|
||||
A
|
||||
|-> B
|
||||
|-> C
|
||||
|
@ -222,7 +224,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|-> G
|
||||
|
|
||||
H
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// A -
|
||||
|
@ -309,7 +311,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
private void build_sscanf(ToyProgramBuilder builder) throws MemoryAccessException {
|
||||
/*
|
||||
Originally from notepad 'sscanf'
|
||||
|
||||
|
||||
A
|
||||
|-> B
|
||||
|
|
||||
|
@ -320,7 +322,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
F
|
||||
|
|
||||
G
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// A - 9 code units
|
||||
|
@ -1448,14 +1450,14 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
//
|
||||
|
||||
/*
|
||||
|
||||
|
||||
0) Initial Graph
|
||||
|
||||
|
||||
1 -> 2 -> 3 -> 4
|
||||
|
|
||||
*
|
||||
5
|
||||
|
||||
|
||||
*/
|
||||
|
||||
create12345Graph();
|
||||
|
@ -1479,12 +1481,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
/*
|
||||
1) Create two separate group vertices (A and B), such that A has an edge to B.
|
||||
|
||||
|
||||
A (v:{1,2} e:{1->2, 2->3}) -> B (v:{3,4} e:{2->3,3->4,3->5})
|
||||
|
|
||||
*
|
||||
5
|
||||
|
||||
|
||||
*/
|
||||
|
||||
GroupedFunctionGraphVertex groupA = group("A", v1, v2);
|
||||
|
@ -1497,12 +1499,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
/*
|
||||
2) Create a third group vertex (Z) that contains a non-grouped vertex *and* one
|
||||
of the other groups (B).
|
||||
|
||||
|
||||
A (v:{1,2} e:{1->2, 2->3}) -> Z (
|
||||
v:{B (v:{3,4} e:{2->3,3->4,3->5}), 5}
|
||||
e:{2->3, 3->5}
|
||||
)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
GroupedFunctionGraphVertex groupZ = group("Z", groupB, v5);
|
||||
|
@ -1512,12 +1514,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
/*
|
||||
3) Now, ungroup the 1 remaining originally grouped vertex (A).
|
||||
|
||||
|
||||
1 -> 2 -> Z (
|
||||
v:{B (v:{3,4} e:{2->3,3->4,3->5}), 5}
|
||||
e:{2->3, 3->5}
|
||||
)
|
||||
|
||||
|
||||
*/
|
||||
|
||||
ungroup(groupA);
|
||||
|
@ -1527,14 +1529,14 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
verifyEdgeCount(2);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
4) Now, ungroup Z and go back to having one remaining group vertex (B)
|
||||
|
||||
|
||||
1 -> 2 -> -> B (v:{3,4} e:{2->3,3->4,3->5})
|
||||
|
|
||||
*
|
||||
5
|
||||
|
||||
|
||||
*/
|
||||
|
||||
ungroup(groupZ);
|
||||
|
@ -1546,12 +1548,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
/*
|
||||
5) Finally, ungroup the last group and make sure the graph is restored
|
||||
|
||||
|
||||
1 -> 2 -> 3 -> 4
|
||||
|
|
||||
*
|
||||
5
|
||||
|
||||
|
||||
*/
|
||||
|
||||
ungroup(groupB);
|
||||
|
@ -2120,12 +2122,12 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
}
|
||||
|
||||
protected void assertNoUndockedProvider() {
|
||||
ComponentProvider provider = tool.getComponentProvider(FGSatelliteUndockedProvider.NAME);
|
||||
ComponentProvider provider = tool.getComponentProvider(SATELLITE_NAME);
|
||||
assertNull("Undocked satellite provider is installed when it should not be", provider);
|
||||
}
|
||||
|
||||
protected void assertUndockedProviderNotShowing() {
|
||||
ComponentProvider provider = tool.getComponentProvider(FGSatelliteUndockedProvider.NAME);
|
||||
ComponentProvider provider = tool.getComponentProvider(SATELLITE_NAME);
|
||||
if (provider == null) {
|
||||
return; // no provider; not showing
|
||||
}
|
||||
|
@ -2133,7 +2135,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
}
|
||||
|
||||
protected void assertUndockedProviderShowing() {
|
||||
ComponentProvider provider = tool.getComponentProvider(FGSatelliteUndockedProvider.NAME);
|
||||
ComponentProvider provider = tool.getComponentProvider(SATELLITE_NAME);
|
||||
assertUndockedProviderShowing(provider);
|
||||
}
|
||||
|
||||
|
@ -2173,7 +2175,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
}
|
||||
|
||||
protected void closeUndockedProvider() {
|
||||
ComponentProvider provider = tool.getComponentProvider(FGSatelliteUndockedProvider.NAME);
|
||||
ComponentProvider provider = tool.getComponentProvider(SATELLITE_NAME);
|
||||
assertNotNull("Undocked provider is not installed when it should be", provider);
|
||||
tool.showComponentProvider(provider, false);
|
||||
waitForSwing();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue