mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-1981 - Theming - Base Module
This commit is contained in:
parent
dd31ff47a2
commit
0971c0088c
228 changed files with 1848 additions and 1694 deletions
|
@ -29,18 +29,18 @@ import docking.action.*;
|
|||
import docking.actions.KeyEntryDialog;
|
||||
import docking.actions.ToolActions;
|
||||
import docking.tool.util.DockingToolConstants;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.framework.options.ToolOptions;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||
import ghidra.test.TestEnv;
|
||||
import ghidra.util.*;
|
||||
import resources.Icons;
|
||||
import resources.ResourceManager;
|
||||
|
||||
public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
|
||||
// note: this has to happen after the test framework is initialized, so it cannot be static
|
||||
private final Icon ICON = ResourceManager.loadImage("images/refresh.png");
|
||||
private final Icon ICON = Icons.REFRESH_ICON;
|
||||
private static final String PROVIDER_NAME = "Test Action Provider";
|
||||
private static final KeyStroke CONTROL_T =
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_T, DockingUtils.CONTROL_KEY_MODIFIER_MASK);
|
||||
|
@ -498,8 +498,19 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
|
||||
private void assertWindowMenuActionHasIcon(Icon expected) {
|
||||
DockingActionIf action = getWindowMenuShowProviderAction();
|
||||
Icon menuIcon = action.getMenuBarData().getMenuIcon();
|
||||
assertEquals("Windows menu icons for provider does not match the value set on the provider",
|
||||
expected, action.getMenuBarData().getMenuIcon());
|
||||
getDescription(expected), getDescription(menuIcon));
|
||||
}
|
||||
|
||||
private String getDescription(Icon icon) {
|
||||
if (icon instanceof GIcon) {
|
||||
return ((GIcon) icon).getUrl().toString();
|
||||
}
|
||||
if (icon instanceof ImageIcon) {
|
||||
return ((ImageIcon) icon).getDescription();
|
||||
}
|
||||
return icon.toString();
|
||||
}
|
||||
|
||||
private void assertToolbarActionHasIcon(Icon expected) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue