mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GP-1981 - Theming - Icon Conversions - Software Modeling, Project,
Docking
This commit is contained in:
parent
d466dbf06b
commit
79b95702ba
150 changed files with 1116 additions and 1001 deletions
|
@ -18,19 +18,20 @@ package ghidra.app.plugin.core.diff;
|
|||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.Icon;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.plugin.core.codebrowser.OtherPanelContext;
|
||||
import ghidra.app.services.CodeViewerService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
import resources.Icons;
|
||||
|
||||
/**
|
||||
* Creates the actions for the program diff plugin.
|
||||
|
@ -41,7 +42,6 @@ class DiffActionManager {
|
|||
private static final String GET_DIFF_GROUP = "GetDiff";
|
||||
private static final String DIFF_INFO_GROUP = "DiffInfo";
|
||||
private static final String DIFF_NAVIGATE_GROUP = "DiffNavigate";
|
||||
private static final String TOGGLE_VIEW_ICON_NAME = "images/table_relationship.png";
|
||||
private static final String GROUP = "Diff";
|
||||
private ProgramDiffPlugin plugin;
|
||||
private CodeViewerService codeViewerService;
|
||||
|
@ -251,7 +251,7 @@ class DiffActionManager {
|
|||
plugin.applyDiff();
|
||||
}
|
||||
};
|
||||
ImageIcon icon = ResourceManager.loadImage("images/pencil16.png");
|
||||
Icon icon = new GIcon("icon.plugin.programdiff.apply");
|
||||
applyDiffsAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_F3, 0));
|
||||
applyDiffsAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Apply Selection" }, icon, GROUP));
|
||||
|
@ -265,7 +265,7 @@ class DiffActionManager {
|
|||
plugin.applyDiffAndGoNext();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/pencil_arrow16.png");
|
||||
icon = new GIcon("icon.plugin.programdiff.apply.next");
|
||||
String[] applyDiffsPath = { "Apply Selection and Goto Next Difference" };
|
||||
applyDiffsNextAction.setPopupMenuData(new MenuData(applyDiffsPath, icon, GROUP));
|
||||
applyDiffsNextAction.setKeyBindingData(
|
||||
|
@ -281,7 +281,7 @@ class DiffActionManager {
|
|||
plugin.ignoreDiff();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/eraser_arrow16.png");
|
||||
icon = new GIcon("icon.plugin.programdiff.ignore");
|
||||
ignoreDiffsAction.setPopupMenuData(new MenuData(
|
||||
new String[] { "Ignore Selection and Goto Next Difference" }, icon, GROUP));
|
||||
ignoreDiffsAction.setDescription(
|
||||
|
@ -294,9 +294,9 @@ class DiffActionManager {
|
|||
plugin.nextDiff();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/down.png");
|
||||
icon = Icons.DOWN_ICON;
|
||||
nextDiffAction.setKeyBindingData(
|
||||
new KeyBindingData('N', InputEvent.CTRL_MASK | InputEvent.ALT_MASK));
|
||||
new KeyBindingData('N', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK));
|
||||
nextDiffAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Next Difference" }, icon, DIFF_NAVIGATE_GROUP));
|
||||
nextDiffAction.setToolBarData(new ToolBarData(icon, DIFF_NAVIGATE_GROUP));
|
||||
|
@ -308,9 +308,9 @@ class DiffActionManager {
|
|||
plugin.previousDiff();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/up.png");
|
||||
icon = Icons.UP_ICON;
|
||||
previousDiffAction.setKeyBindingData(
|
||||
new KeyBindingData('P', InputEvent.CTRL_MASK | InputEvent.ALT_MASK));
|
||||
new KeyBindingData('P', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK));
|
||||
previousDiffAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Previous Difference" }, icon, DIFF_NAVIGATE_GROUP));
|
||||
previousDiffAction.setToolBarData(new ToolBarData(icon, DIFF_NAVIGATE_GROUP));
|
||||
|
@ -322,7 +322,7 @@ class DiffActionManager {
|
|||
plugin.showDiffDetails();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/xmag.png");
|
||||
icon = new GIcon("icon.search");
|
||||
diffDetailsAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_F5, 0));
|
||||
diffDetailsAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Location Details..." }, icon, DIFF_INFO_GROUP));
|
||||
|
@ -349,7 +349,7 @@ class DiffActionManager {
|
|||
plugin.diff();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/Diff16.png");
|
||||
icon = new GIcon("icon.plugin.programdiff.get.diffs");
|
||||
getDiffsAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Get Differences..." }, icon, GET_DIFF_GROUP));
|
||||
getDiffsAction.setToolBarData(new ToolBarData(icon, GET_DIFF_GROUP));
|
||||
|
@ -372,7 +372,7 @@ class DiffActionManager {
|
|||
plugin.setP1SelectionOnP2();
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage("images/DiffSelect16.png");
|
||||
icon = new GIcon("icon.plugin.programdiff.select.by.program");
|
||||
p1SelectToP2Action.setDescription(
|
||||
"Select Program 2 highlights using selection in Program 1.");
|
||||
p1SelectToP2Action.setToolBarData(new ToolBarData(icon, SELECT_GROUP));
|
||||
|
@ -434,10 +434,10 @@ class DiffActionManager {
|
|||
return true;
|
||||
}
|
||||
};
|
||||
icon = ResourceManager.loadImage(TOGGLE_VIEW_ICON_NAME);
|
||||
icon = new GIcon("icon.plugin.programdiff.open.close.program");
|
||||
openCloseProgram2Action.setEnabled(false);
|
||||
openCloseProgram2Action.setKeyBindingData(
|
||||
new KeyBindingData('C', InputEvent.CTRL_MASK | InputEvent.ALT_MASK));
|
||||
new KeyBindingData('C', InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK));
|
||||
openCloseProgram2Action.setToolBarData(new ToolBarData(icon, "zzz"));
|
||||
openCloseProgram2Action.setHelpLocation(
|
||||
new HelpLocation(HelpTopics.DIFF, OPEN_CLOSE_PROGRAM2_ACTION));
|
||||
|
|
|
@ -28,12 +28,12 @@ import docking.WindowPosition;
|
|||
import docking.widgets.VariableHeightPanel;
|
||||
import docking.widgets.combobox.GComboBox;
|
||||
import docking.widgets.label.GDLabel;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.plugin.core.diff.DiffApplySettingsOptionManager.*;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.framework.plugintool.Plugin;
|
||||
import ghidra.program.util.ProgramMergeFilter;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
|
||||
/**
|
||||
* The DiffSettingsDialog is used to change the types of differences currently
|
||||
|
@ -43,7 +43,7 @@ import resources.ResourceManager;
|
|||
public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
||||
|
||||
public static final String APPLY_FILTER_CHANGED_ACTION = "Apply Filter Changed";
|
||||
public static final ImageIcon ICON = ResourceManager.loadImage("images/settings16.gif");
|
||||
public static final Icon ICON = new GIcon("icon.plugin.programdiff.settings");
|
||||
public static final String TITLE = "Diff Apply Settings";
|
||||
|
||||
private ProgramDiffPlugin plugin;
|
||||
|
@ -106,8 +106,9 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
}
|
||||
|
||||
public void addActions() {
|
||||
plugin.getTool().addLocalAction(this,
|
||||
new SaveApplySettingsAction(this, plugin.applySettingsMgr));
|
||||
plugin.getTool()
|
||||
.addLocalAction(this,
|
||||
new SaveApplySettingsAction(this, plugin.applySettingsMgr));
|
||||
plugin.getTool().addLocalAction(this, new DiffIgnoreAllAction(this));
|
||||
plugin.getTool().addLocalAction(this, new DiffReplaceAllAction(this));
|
||||
plugin.getTool().addLocalAction(this, new DiffMergeAllAction(this));
|
||||
|
@ -351,10 +352,6 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
listenerList.remove(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if at least one of the checkboxes for the filter
|
||||
* has been selected.
|
||||
*/
|
||||
boolean hasApplySelection() {
|
||||
return ((applyProgramContext | applyBytes | applyCodeUnits | applyReferences |
|
||||
applyPlateComments | applyPreComments | applyEolComments | applyRepeatableComments |
|
||||
|
@ -366,8 +363,7 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
if (adjustingApplyFilter) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < listenerList.size(); i++) {
|
||||
ActionListener listener = listenerList.get(i);
|
||||
for (ActionListener listener : listenerList) {
|
||||
listener.actionPerformed(new ActionEvent(this, 0, APPLY_FILTER_CHANGED_ACTION));
|
||||
}
|
||||
}
|
||||
|
@ -383,9 +379,6 @@ public class DiffApplySettingsProvider extends ComponentProviderAdapter {
|
|||
return applyPanel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the plugin associated with this provider.
|
||||
*/
|
||||
Plugin getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import docking.WindowPosition;
|
|||
import docking.action.DockingAction;
|
||||
import docking.action.ToolBarData;
|
||||
import docking.widgets.checkbox.GCheckBox;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.framework.plugintool.Plugin;
|
||||
|
@ -40,7 +41,6 @@ import ghidra.util.HelpLocation;
|
|||
import ghidra.util.Msg;
|
||||
import ghidra.util.task.SwingUpdateManager;
|
||||
import resources.Icons;
|
||||
import resources.ResourceManager;
|
||||
|
||||
/**
|
||||
* The DiffDetailsProvider is used to view the differences for an address or
|
||||
|
@ -52,7 +52,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
|
|||
public static final String FILTER_DIFFS_CHECK_BOX = "Filter Diffs Check Box";
|
||||
public static final String DIFF_DETAILS_TEXT_AREA = "Diff Details Text Area";
|
||||
public static final String DIFF_DETAILS_PANEL = "Diff Location Details Panel";
|
||||
public static final Icon ICON = ResourceManager.loadImage("images/xmag.png");
|
||||
public static final Icon ICON = new GIcon("icon.search");
|
||||
public static final Icon REFRESH_ICON = Icons.REFRESH_ICON;
|
||||
public static final String TITLE = "Diff Details";
|
||||
|
||||
|
@ -72,9 +72,6 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
|
|||
private SwingUpdateManager updateManager;
|
||||
private ProgramLocation currentLocation;
|
||||
|
||||
/**
|
||||
* @param plugin
|
||||
*/
|
||||
public DiffDetailsProvider(ProgramDiffPlugin plugin) {
|
||||
super(plugin.getTool(), "Diff Location Details", plugin.getName());
|
||||
setTitle(TITLE);
|
||||
|
@ -91,17 +88,11 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
|
|||
setUpRefreshDetailsUpdateManager();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param selected
|
||||
*/
|
||||
public void setAutoUpdate(boolean selected) {
|
||||
autoUpdateCB.setSelected(selected);
|
||||
autoUpdate = selected;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param selected
|
||||
*/
|
||||
public void setFilterDiffs(boolean selected) {
|
||||
filterDiffsCB.setSelected(selected);
|
||||
filterDiffs = selected;
|
||||
|
@ -159,9 +150,6 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param p1Location
|
||||
*/
|
||||
protected void locationChanged(ProgramLocation p1Location) {
|
||||
if (isDisplayed && autoUpdate) {
|
||||
refreshDetails(p1Location);
|
||||
|
@ -321,8 +309,7 @@ public class DiffDetailsProvider extends ComponentProviderAdapter {
|
|||
|
||||
@Override
|
||||
public void componentHidden() {
|
||||
for (int i = 0; i < listenerList.size(); i++) {
|
||||
ActionListener listener = listenerList.get(i);
|
||||
for (ActionListener listener : listenerList) {
|
||||
listener.actionPerformed(new ActionEvent(this, 0, DIFF_DETAILS_HIDDEN_ACTION));
|
||||
}
|
||||
isDisplayed = false;
|
||||
|
|
|
@ -33,6 +33,7 @@ import docking.widgets.fieldpanel.field.Field;
|
|||
import docking.widgets.fieldpanel.listener.FieldMouseListener;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
import generic.theme.GColor;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.GhidraOptions;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.events.*;
|
||||
|
@ -63,7 +64,6 @@ import ghidra.util.exception.VersionException;
|
|||
import ghidra.util.task.*;
|
||||
import help.Help;
|
||||
import help.HelpService;
|
||||
import resources.ResourceManager;
|
||||
|
||||
/**
|
||||
* Plugin that shows the differences between two programs, and allows the user to apply differences
|
||||
|
@ -92,7 +92,8 @@ public class ProgramDiffPlugin extends ProgramPlugin
|
|||
implements ProgramLocationListener, ProgramSelectionListener, DiffControllerListener,
|
||||
DiffService, OptionsChangeListener, DomainObjectListener {
|
||||
|
||||
private ImageIcon CURSOR_LOC_ICON = ResourceManager.loadImage("images/cursor_arrow.gif");
|
||||
private static final Icon CURSOR_LOC_ICON =
|
||||
new GIcon("icon.plugin.programdiff.cursor.location");
|
||||
private static final String SELECTION_GROUP = "Selection Colors";
|
||||
private static final String DIFF_HIGHLIGHT_COLOR_NAME =
|
||||
SELECTION_GROUP + Options.DELIMITER + "Difference Color";
|
||||
|
|
|
@ -22,7 +22,7 @@ import docking.action.DockingAction;
|
|||
import docking.action.ToolBarData;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
import resources.Icons;
|
||||
|
||||
/**
|
||||
* Action to save the current Diff Apply Settings as the new defaults to be used when new Diffs are started.
|
||||
|
@ -45,7 +45,7 @@ class SaveApplySettingsAction extends DockingAction {
|
|||
super(ACTION_NAME, settingsProvider.getPlugin().getName());
|
||||
this.settingsProvider = settingsProvider;
|
||||
this.settingsOptionMgr = settingsOptionMgr;
|
||||
setToolBarData(new ToolBarData(ResourceManager.loadImage("images/disk.png"), GROUP_NAME));
|
||||
setToolBarData(new ToolBarData(Icons.SAVE_ICON, GROUP_NAME));
|
||||
setEnabled(true);
|
||||
setDescription(DESCRIPTION);
|
||||
setHelpLocation(new HelpLocation(HelpTopics.DIFF, ACTION_NAME));
|
||||
|
@ -61,8 +61,10 @@ class SaveApplySettingsAction extends DockingAction {
|
|||
@Override
|
||||
public void actionPerformed(ActionContext context) {
|
||||
settingsOptionMgr.saveDefaultApplyFilter(settingsProvider.getApplyFilter());
|
||||
settingsProvider.getPlugin().getTool().setStatusInfo(
|
||||
"Diff Apply Settings have been saved to the tool as the new defaults.");
|
||||
settingsProvider.getPlugin()
|
||||
.getTool()
|
||||
.setStatusInfo(
|
||||
"Diff Apply Settings have been saved to the tool as the new defaults.");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue