mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-3000 - Theme Cleanup
This commit is contained in:
parent
f022b9a4d5
commit
1fa08a6002
38 changed files with 324 additions and 177 deletions
|
@ -118,7 +118,7 @@ public class CustomToStringCellRenderer<T> extends AbstractGColumnRenderer<T> {
|
||||||
public Component getTableCellRendererComponent(GTableCellRenderingData data) {
|
public Component getTableCellRendererComponent(GTableCellRenderingData data) {
|
||||||
super.getTableCellRendererComponent(data);
|
super.getTableCellRendererComponent(data);
|
||||||
setText(toString.apply(cls.cast(data.getValue()), data.getColumnSettings()));
|
setText(toString.apply(cls.cast(data.getValue()), data.getColumnSettings()));
|
||||||
if (getHTMLRenderingEnabled()) {
|
if (isHTMLRenderingEnabled()) {
|
||||||
setVerticalAlignment(SwingConstants.TOP);
|
setVerticalAlignment(SwingConstants.TOP);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
|
|
||||||
<UL type="disc">
|
<UL type="disc">
|
||||||
<LI>From the menu-bar in tool, click <B>Help <IMG src="help/shared/arrow.gif" border="0"
|
<LI>From the menu-bar in tool, click <B>Help <IMG src="help/shared/arrow.gif" border="0"
|
||||||
alt="">Installed Processors...</B></LI>
|
alt="">Installed Processors</B></LI>
|
||||||
</UL>
|
</UL>
|
||||||
|
|
||||||
<H2 align="center"><A name="User_Agreement"/>User Agreement</H2>
|
<H2 align="center"><A name="User_Agreement"/>User Agreement</H2>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<BODY>
|
<BODY>
|
||||||
<H1 align="center"><A name="About_Program"></A>About Program</H1>
|
<H1 align="center"><A name="About_Program"></A>About Program</H1>
|
||||||
|
|
||||||
<P>The <I>About Program...</I> dialog displays summary information about a program. <BR>
|
<P>The <I>About Program</I> dialog displays summary information about a program. <BR>
|
||||||
</P>
|
</P>
|
||||||
|
|
||||||
<H2><B>To view information about the currently open (active) program</B></H2>
|
<H2><B>To view information about the currently open (active) program</B></H2>
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
<meta http-equiv="content-type"
|
<meta http-equiv="content-type"
|
||||||
content="text/html; charset=windows-1252">
|
content="text/html; charset=windows-1252">
|
||||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||||
<meta name="generator" content="Microsoft FrontPage 4.0">
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1><a name="Clear_Code_Bytes"></a>Clear</h1>
|
<h1><a name="Clear_Code_Bytes"></a>Clear</h1>
|
||||||
|
@ -183,7 +182,7 @@ with a <i>Cancel </i>button. The <i>Cancel </i>button may be
|
||||||
pressed
|
pressed
|
||||||
to terminate the action. </p>
|
to terminate the action. </p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><img src="help/shared/note.png" x-maintain-ratio="TRUE" alt="Note" border="0"> You can undo clearing of code units
|
<p><img src="help/shared/note.png" alt="Note" border="0"> You can undo clearing of code units
|
||||||
if it has an undesired effect</p>
|
if it has an undesired effect</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>The <i>Clear Flow</i> options dialog has check boxes to control
|
<p>The <i>Clear Flow</i> options dialog has check boxes to control
|
||||||
|
|
|
@ -2,13 +2,9 @@
|
||||||
|
|
||||||
<HTML>
|
<HTML>
|
||||||
<HEAD>
|
<HEAD>
|
||||||
<META name="generator" content=
|
<TITLE>Eclipse Integration</TITLE>
|
||||||
"HTML Tidy for Java (vers. 2009-12-01), see jtidy.sourceforge.net">
|
|
||||||
|
|
||||||
<TITLE>Ghidra Script Manager</TITLE>
|
|
||||||
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||||
<LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
<LINK rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||||
<META name="generator" content="Microsoft FrontPage 4.0">
|
|
||||||
</HEAD>
|
</HEAD>
|
||||||
|
|
||||||
<BODY lang="EN-US">
|
<BODY lang="EN-US">
|
||||||
|
@ -22,7 +18,8 @@
|
||||||
<P>The Eclipse installation location and communication ports can be configured in the Front End
|
<P>The Eclipse installation location and communication ports can be configured in the Front End
|
||||||
tool's <i><b>Eclipse Integration</b></i> options. If an attempt is made to launch Eclipse from
|
tool's <i><b>Eclipse Integration</b></i> options. If an attempt is made to launch Eclipse from
|
||||||
Ghidra and these things are not configured correctly, the user will be taken to Eclipse
|
Ghidra and these things are not configured correctly, the user will be taken to Eclipse
|
||||||
Integration options automatically./P>
|
Integration options automatically.
|
||||||
|
</P>
|
||||||
|
|
||||||
<H2>Eclipse Integration Tool Options</H2>
|
<H2>Eclipse Integration Tool Options</H2>
|
||||||
<CENTER>
|
<CENTER>
|
||||||
|
|
|
@ -392,7 +392,7 @@
|
||||||
|
|
||||||
<BLOCKQUOTE>
|
<BLOCKQUOTE>
|
||||||
<P>To <A href="help/topics/About/About_Program_File.htm">view information about a
|
<P>To <A href="help/topics/About/About_Program_File.htm">view information about a
|
||||||
file</A>, right mouse click on the file in the data tree and choose the <B>About...</B>
|
file</A>, right mouse click on the file in the data tree and choose the <B>About Program</B>
|
||||||
option.</P>
|
option.</P>
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
and restore options show up only in the Ghidra Project Window even though the plugins
|
and restore options show up only in the Ghidra Project Window even though the plugins
|
||||||
providing these options can be added to other tools. To bring up the <I>Configure Tool
|
providing these options can be added to other tools. To bring up the <I>Configure Tool
|
||||||
Plugins</I> dialog, select the <B>File</B><IMG src="help/shared/arrow.gif" border="0">
|
Plugins</I> dialog, select the <B>File</B><IMG src="help/shared/arrow.gif" border="0">
|
||||||
<B>Configure...</B> option.</P>
|
<B>Configure</B> option.</P>
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|
||||||
<CENTER>
|
<CENTER>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
dialog.</P>
|
dialog.</P>
|
||||||
|
|
||||||
<P>To bring up the <I>Options</I> dialog, select <B>Edit<IMG src=
|
<P>To bring up the <I>Options</I> dialog, select <B>Edit<IMG src=
|
||||||
"help/shared/arrow.gif" border="0">Options...</B></P>
|
"help/shared/arrow.gif" border="0">Tool Options</B></P>
|
||||||
|
|
||||||
<P class="relatedtopic">Related Topics: </P>
|
<P class="relatedtopic">Related Topics: </P>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<P>The <I>Configure Tool</I> dialog allows you to add/remove plugin packages or individual <A
|
<P>The <I>Configure Tool</I> dialog allows you to add/remove plugin packages or individual <A
|
||||||
href="help/topics/Tool/Ghidra_Tool_Administration.htm#Plugins">Plugins</A> from a tool. To
|
href="help/topics/Tool/Ghidra_Tool_Administration.htm#Plugins">Plugins</A> from a tool. To
|
||||||
display the <I>Configure Tool</I> dialog, select <B>File</B> <IMG alt="" src=
|
display the <I>Configure Tool</I> dialog, select <B>File</B> <IMG alt="" src=
|
||||||
"help/shared/arrow.gif"><B>Configure...</B>.This dialog is also displayed when you <A href=
|
"help/shared/arrow.gif"><B>Configure</B>.This dialog is also displayed when you <A href=
|
||||||
"help/topics/Tool/Ghidra_Tool_Administration.htm#Create_Tool">create a new
|
"help/topics/Tool/Ghidra_Tool_Administration.htm#Create_Tool">create a new
|
||||||
tool</A>. </P>
|
tool</A>. </P>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</BLOCKQUOTE>
|
</BLOCKQUOTE>
|
||||||
|
|
||||||
<P>To display the <I>Options</I> dialog, select <B>Edit<IMG alt="" border="0" src=
|
<P>To display the <I>Options</I> dialog, select <B>Edit<IMG alt="" border="0" src=
|
||||||
"help/shared/arrow.gif">Tool Options...</B> from the tool menu.</P>
|
"help/shared/arrow.gif">Tool Options</B> from the tool menu.</P>
|
||||||
|
|
||||||
<H2><B>Restoring Default Settings</B></H2>
|
<H2><B>Restoring Default Settings</B></H2>
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
||||||
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options...</B></FONT> from the main
|
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options</B></FONT> from the main
|
||||||
menu.</LI>
|
menu.</LI>
|
||||||
|
|
||||||
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
||||||
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options...</B></FONT> from the main
|
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options</B></FONT> from the main
|
||||||
menu.</LI>
|
menu.</LI>
|
||||||
|
|
||||||
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
||||||
|
@ -178,7 +178,7 @@
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
||||||
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options...</B></FONT> from the main
|
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options</B></FONT> from the main
|
||||||
menu.</LI>
|
menu.</LI>
|
||||||
|
|
||||||
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
||||||
|
@ -259,14 +259,13 @@
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
<LI>Select <FONT size="4"><B>Edit</B></FONT><IMG alt="" border="0" src=
|
||||||
"help/shared/arrow.gif"> <FONT size="4"><B>Options...</B></FONT> from the Tool
|
"help/shared/arrow.gif"> <FONT size="4"><B>Tool Options</B></FONT> from the menu bar.</LI>
|
||||||
menu.</LI>
|
|
||||||
|
|
||||||
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
<LI>Select the <I>Key Bindings</I> node in the options tree.</LI>
|
||||||
|
|
||||||
<LI>Press the <B>Export...</B> button.</LI>
|
<LI>Press the <B>Export...</B> button.</LI>
|
||||||
|
|
||||||
<LI>If you have made changes, then you will be promted to apply those changes before
|
<LI>If you have made changes, then you will be prompted to apply those changes before
|
||||||
continuing.</LI>
|
continuing.</LI>
|
||||||
|
|
||||||
<LI>On the file chooser dialog, choose a file to which to export key bindings.</LI>
|
<LI>On the file chooser dialog, choose a file to which to export key bindings.</LI>
|
||||||
|
@ -356,7 +355,7 @@
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>From the tool, select <B>Edit</B><IMG alt="" border="0" src="help/shared/arrow.gif">
|
<LI>From the tool, select <B>Edit</B><IMG alt="" border="0" src="help/shared/arrow.gif">
|
||||||
<B>Tool Options...</B></LI>
|
<B>Tool Options</B></LI>
|
||||||
|
|
||||||
<LI>Select the <I>Tool</I> node in the options tree.</LI>
|
<LI>Select the <I>Tool</I> node in the options tree.</LI>
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
|
|
||||||
<P>Once installed, the translation service plugins, like all plugins, can be
|
<P>Once installed, the translation service plugins, like all plugins, can be
|
||||||
found in the <b>File <IMG src="help/shared/arrow.gif" alt="->" border="0">
|
found in the <b>File <IMG src="help/shared/arrow.gif" alt="->" border="0">
|
||||||
Configure...</b> window and must be enabled before they will
|
Configure</b> window and must be enabled before they will
|
||||||
appear in the <b>Data <IMG src="help/shared/arrow.gif" alt="->" border="0">
|
appear in the <b>Data <IMG src="help/shared/arrow.gif" alt="->" border="0">
|
||||||
Translate</b> menu.</P>
|
Translate</b> menu.</P>
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import docking.ActionContext;
|
||||||
import docking.action.*;
|
import docking.action.*;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.context.ProgramContextAction;
|
import ghidra.app.context.ProgramContextAction;
|
||||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
|
@ -96,7 +96,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
errorStatus = new GDLabel(" ");
|
errorStatus = new GDLabel(" ");
|
||||||
errorStatus.setName("message");
|
errorStatus.setName("message");
|
||||||
errorStatus.setHorizontalAlignment(SwingConstants.CENTER);
|
errorStatus.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
errorStatus.setForeground(Colors.ERROR);
|
errorStatus.setForeground(Messages.ERROR);
|
||||||
errorStatus.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
|
errorStatus.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
|
||||||
main.add(errorStatus, BorderLayout.SOUTH);
|
main.add(errorStatus, BorderLayout.SOUTH);
|
||||||
|
|
||||||
|
@ -250,8 +250,8 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
};
|
};
|
||||||
selectionAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "On_Selection"));
|
selectionAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "On_Selection"));
|
||||||
selectionAction.setEnabled(plugin.hasSelection());
|
selectionAction.setEnabled(plugin.hasSelection());
|
||||||
selectionAction.setToolBarData(
|
selectionAction
|
||||||
new ToolBarData(new GIcon("icon.plugin.checksum.select"), null));
|
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.checksum.select"), null));
|
||||||
selectionAction.setDescription("When toggled, generates checksums on " +
|
selectionAction.setDescription("When toggled, generates checksums on " +
|
||||||
"selection. Otherwise checksums are generated over the entire program");
|
"selection. Otherwise checksums are generated over the entire program");
|
||||||
|
|
||||||
|
@ -268,8 +268,8 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
};
|
};
|
||||||
showHexAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "As_Hex"));
|
showHexAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "As_Hex"));
|
||||||
showHexAction.setEnabled(true);
|
showHexAction.setEnabled(true);
|
||||||
showHexAction.setToolBarData(
|
showHexAction
|
||||||
new ToolBarData(new GIcon("icon.plugin.checksum.show.hex"), null));
|
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.checksum.show.hex"), null));
|
||||||
showHexAction.setDescription("Toggle to show the hex values instead of decimal values.");
|
showHexAction.setDescription("Toggle to show the hex values instead of decimal values.");
|
||||||
|
|
||||||
xorAction = new ToggleDockingAction("XOR Checksum Values", plugin.getName()) {
|
xorAction = new ToggleDockingAction("XOR Checksum Values", plugin.getName()) {
|
||||||
|
@ -288,8 +288,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
};
|
};
|
||||||
xorAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "xor"));
|
xorAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "xor"));
|
||||||
xorAction.setEnabled(true);
|
xorAction.setEnabled(true);
|
||||||
xorAction.setToolBarData(
|
xorAction.setToolBarData(new ToolBarData(new GIcon("icon.plugin.checksum.xor"), null));
|
||||||
new ToolBarData(new GIcon("icon.plugin.checksum.xor"), null));
|
|
||||||
xorAction.setDescription("Toggle to recompute values with a xor operation.");
|
xorAction.setDescription("Toggle to recompute values with a xor operation.");
|
||||||
|
|
||||||
carryAction = new ToggleDockingAction("Carry Checksum Values", plugin.getName()) {
|
carryAction = new ToggleDockingAction("Carry Checksum Values", plugin.getName()) {
|
||||||
|
@ -309,8 +308,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
|
||||||
};
|
};
|
||||||
carryAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "carry"));
|
carryAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "carry"));
|
||||||
carryAction.setEnabled(true);
|
carryAction.setEnabled(true);
|
||||||
carryAction.setToolBarData(
|
carryAction.setToolBarData(new ToolBarData(new GIcon("icon.plugin.checksum.carry"), null));
|
||||||
new ToolBarData(new GIcon("icon.plugin.checksum.carry"), null));
|
|
||||||
carryAction.setDescription("Toggle to recompute values with a carry operation.");
|
carryAction.setDescription("Toggle to recompute values with a carry operation.");
|
||||||
|
|
||||||
onesCompAction = new ToggleDockingAction("Ones Complement", plugin.getName()) {
|
onesCompAction = new ToggleDockingAction("Ones Complement", plugin.getName()) {
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class ClearPlugin extends Plugin {
|
||||||
new ActionBuilder(CLEAR_WITH_OPTIONS_NAME, getName())
|
new ActionBuilder(CLEAR_WITH_OPTIONS_NAME, getName())
|
||||||
.menuPath(ToolConstants.MENU_EDIT, CLEAR_WITH_OPTIONS_NAME + "...")
|
.menuPath(ToolConstants.MENU_EDIT, CLEAR_WITH_OPTIONS_NAME + "...")
|
||||||
.menuGroup(CLEAR_CODE_BYTES_NAME, "2")
|
.menuGroup(CLEAR_CODE_BYTES_NAME, "2")
|
||||||
.popupMenuPath(CLEAR_WITH_OPTIONS_NAME)
|
.popupMenuPath(CLEAR_WITH_OPTIONS_NAME + "...")
|
||||||
.popupMenuGroup(CLEAR_CODE_BYTES_NAME, "2")
|
.popupMenuGroup(CLEAR_CODE_BYTES_NAME, "2")
|
||||||
.withContext(ListingActionContext.class)
|
.withContext(ListingActionContext.class)
|
||||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||||
|
@ -218,7 +218,7 @@ public class ClearPlugin extends Plugin {
|
||||||
new ActionBuilder(CLEAR_FLOW_AND_REPAIR, getName())
|
new ActionBuilder(CLEAR_FLOW_AND_REPAIR, getName())
|
||||||
.menuPath(ToolConstants.MENU_EDIT, CLEAR_FLOW_AND_REPAIR + "...")
|
.menuPath(ToolConstants.MENU_EDIT, CLEAR_FLOW_AND_REPAIR + "...")
|
||||||
.menuGroup(CLEAR_CODE_BYTES_NAME, "3")
|
.menuGroup(CLEAR_CODE_BYTES_NAME, "3")
|
||||||
.popupMenuPath(CLEAR_FLOW_AND_REPAIR)
|
.popupMenuPath(CLEAR_FLOW_AND_REPAIR + "...")
|
||||||
.popupMenuGroup(CLEAR_CODE_BYTES_NAME, "3")
|
.popupMenuGroup(CLEAR_CODE_BYTES_NAME, "3")
|
||||||
.withContext(ListingActionContext.class)
|
.withContext(ListingActionContext.class)
|
||||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||||
|
@ -258,6 +258,7 @@ public class ClearPlugin extends Plugin {
|
||||||
clear(opts, context);
|
clear(opts, context);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pop up the clear with options dialog.
|
* Pop up the clear with options dialog.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,7 +19,7 @@ import javax.swing.JComponent;
|
||||||
|
|
||||||
import docking.widgets.fieldpanel.field.Field;
|
import docking.widgets.fieldpanel.field.Field;
|
||||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.GhidraOptions;
|
import ghidra.GhidraOptions;
|
||||||
import ghidra.app.plugin.core.hover.AbstractConfigurableHover;
|
import ghidra.app.plugin.core.hover.AbstractConfigurableHover;
|
||||||
import ghidra.app.util.ToolTipUtils;
|
import ghidra.app.util.ToolTipUtils;
|
||||||
|
@ -111,9 +111,8 @@ public class DataTypeListingHover extends AbstractConfigurableHover implements L
|
||||||
warningMsg += "WARNING! Invalid Storage";
|
warningMsg += "WARNING! Invalid Storage";
|
||||||
}
|
}
|
||||||
if (warningMsg.length() != 0) {
|
if (warningMsg.length() != 0) {
|
||||||
String errorText =
|
String errorText = "<HTML><center><font color=\"" + Messages.ERROR.toHexString() +
|
||||||
"<HTML><center><font color=\"" + Colors.ERROR.toHexString() + "\">" +
|
"\">" + warningMsg + "!</font></center><BR>";
|
||||||
warningMsg + "!</font></center><BR>";
|
|
||||||
toolTipText = toolTipText.replace("<HTML>", errorText);
|
toolTipText = toolTipText.replace("<HTML>", errorText);
|
||||||
}
|
}
|
||||||
return createTooltipComponent(toolTipText);
|
return createTooltipComponent(toolTipText);
|
||||||
|
@ -151,8 +150,7 @@ public class DataTypeListingHover extends AbstractConfigurableHover implements L
|
||||||
result += "<br>Missing NULL terminator.";
|
result += "<br>Missing NULL terminator.";
|
||||||
}
|
}
|
||||||
if (sdi.getStringLength() > dataInstance.getLength()) {
|
if (sdi.getStringLength() > dataInstance.getLength()) {
|
||||||
result +=
|
result += "<br><font color=\"" + Messages.ERROR.toHexString() +
|
||||||
"<br><font color=\"" + Colors.ERROR.toHexString() +
|
|
||||||
"\">String exceeds data field.</font>";
|
"\">String exceeds data field.</font>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ import docking.widgets.OptionDialog;
|
||||||
import docking.widgets.button.GButton;
|
import docking.widgets.button.GButton;
|
||||||
import docking.widgets.label.GDLabel;
|
import docking.widgets.label.GDLabel;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitAttributes;
|
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitAttributes;
|
||||||
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitFieldAllocation;
|
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitFieldAllocation;
|
||||||
import ghidra.app.services.DataTypeManagerService;
|
import ghidra.app.services.DataTypeManagerService;
|
||||||
|
@ -82,7 +82,6 @@ public class BitFieldEditorPanel extends JPanel {
|
||||||
|
|
||||||
BitFieldEditorPanel(Composite composite, DataTypeManagerService dtmService,
|
BitFieldEditorPanel(Composite composite, DataTypeManagerService dtmService,
|
||||||
Predicate<DataType> dataTypeValidator) {
|
Predicate<DataType> dataTypeValidator) {
|
||||||
super();
|
|
||||||
this.composite = composite;
|
this.composite = composite;
|
||||||
|
|
||||||
if (composite.isPackingEnabled()) {
|
if (composite.isPackingEnabled()) {
|
||||||
|
@ -167,8 +166,7 @@ public class BitFieldEditorPanel extends JPanel {
|
||||||
else {
|
else {
|
||||||
allocOffsetStr = Integer.toString(allocOffset);
|
allocOffsetStr = Integer.toString(allocOffset);
|
||||||
}
|
}
|
||||||
String text =
|
String text = "Structure Offset of Allocation Unit: " + allocOffsetStr;
|
||||||
"Structure Offset of Allocation Unit: " + allocOffsetStr;
|
|
||||||
allocationOffsetLabel.setText(text);
|
allocationOffsetLabel.setText(text);
|
||||||
|
|
||||||
int offset = placementComponent.getAllocationOffset();
|
int offset = placementComponent.getAllocationOffset();
|
||||||
|
@ -183,7 +181,7 @@ public class BitFieldEditorPanel extends JPanel {
|
||||||
|
|
||||||
statusTextField = new GDLabel(" ");
|
statusTextField = new GDLabel(" ");
|
||||||
statusTextField.setHorizontalAlignment(SwingConstants.CENTER);
|
statusTextField.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
statusTextField.setForeground(Colors.ERROR);
|
statusTextField.setForeground(Messages.ERROR);
|
||||||
|
|
||||||
// use a strut panel so the size of the message area does not change if we make
|
// use a strut panel so the size of the message area does not change if we make
|
||||||
// the message label not visible
|
// the message label not visible
|
||||||
|
|
|
@ -24,7 +24,7 @@ import docking.ActionContext;
|
||||||
import docking.action.*;
|
import docking.action.*;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
import docking.widgets.tree.GTree;
|
import docking.widgets.tree.GTree;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
||||||
import ghidra.app.plugin.core.datamgr.DataTypesActionContext;
|
import ghidra.app.plugin.core.datamgr.DataTypesActionContext;
|
||||||
import ghidra.app.plugin.core.datamgr.archive.FileArchive;
|
import ghidra.app.plugin.core.datamgr.archive.FileArchive;
|
||||||
|
@ -95,9 +95,8 @@ public class DeleteArchiveAction extends DockingAction {
|
||||||
if (OptionDialog.showOptionDialogWithCancelAsDefaultButton(gTree,
|
if (OptionDialog.showOptionDialogWithCancelAsDefaultButton(gTree,
|
||||||
"Confirm Delete Operation",
|
"Confirm Delete Operation",
|
||||||
"<html><b>Are you sure you want to delete archive: " +
|
"<html><b>Are you sure you want to delete archive: " +
|
||||||
HTMLUtilities.escapeHTML(node.getName()) + "?<br><br>" +
|
HTMLUtilities.escapeHTML(node.getName()) + "?<br><br>" + "<font color=\"" +
|
||||||
"<font color=\"" + Colors.ERROR.toHexString() +
|
Messages.ERROR.toHexString() + "\">(WARNING: This action will permanently " +
|
||||||
"\">(WARNING: This action will permanently " +
|
|
||||||
"delete the file from disk.)</font></b>",
|
"delete the file from disk.)</font></b>",
|
||||||
"Yes", OptionDialog.QUESTION_MESSAGE) != OptionDialog.OPTION_ONE) {
|
"Yes", OptionDialog.QUESTION_MESSAGE) != OptionDialog.OPTION_ONE) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -23,7 +23,7 @@ import docking.action.MenuData;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
import docking.widgets.tree.GTree;
|
import docking.widgets.tree.GTree;
|
||||||
import docking.widgets.tree.GTreeNode;
|
import docking.widgets.tree.GTreeNode;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
||||||
import ghidra.app.plugin.core.datamgr.DataTypesActionContext;
|
import ghidra.app.plugin.core.datamgr.DataTypesActionContext;
|
||||||
import ghidra.app.plugin.core.datamgr.archive.*;
|
import ghidra.app.plugin.core.datamgr.archive.*;
|
||||||
|
@ -79,8 +79,7 @@ public class RemoveInvalidArchiveFromProgramAction extends DockingAction {
|
||||||
if (OptionDialog.showOptionDialog(gtree, "Confirm Remove Invalid Archive(s)",
|
if (OptionDialog.showOptionDialog(gtree, "Confirm Remove Invalid Archive(s)",
|
||||||
"<html><b>Are you sure you want to delete archive: " +
|
"<html><b>Are you sure you want to delete archive: " +
|
||||||
HTMLUtilities.escapeHTML(invalidArchiveNode.getName()) +
|
HTMLUtilities.escapeHTML(invalidArchiveNode.getName()) +
|
||||||
" from the program?<br><br>" +
|
" from the program?<br><br>" + "<font color=\"" + Messages.ERROR.toHexString() +
|
||||||
"<font color=\"" + Colors.ERROR.toHexString() +
|
|
||||||
"\">(WARNING: This action will disassociate " +
|
"\">(WARNING: This action will disassociate " +
|
||||||
"all datatypes in the program from this archive.)</font></b>",
|
"all datatypes in the program from this archive.)</font></b>",
|
||||||
"Yes", OptionDialog.QUESTION_MESSAGE) != OptionDialog.OPTION_ONE) {
|
"Yes", OptionDialog.QUESTION_MESSAGE) != OptionDialog.OPTION_ONE) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import docking.ComponentProvider;
|
||||||
import docking.action.*;
|
import docking.action.*;
|
||||||
import docking.widgets.OptionDialog;
|
import docking.widgets.OptionDialog;
|
||||||
import generic.theme.GIcon;
|
import generic.theme.GIcon;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.plugin.core.compositeeditor.EditorListener;
|
import ghidra.app.plugin.core.compositeeditor.EditorListener;
|
||||||
import ghidra.app.plugin.core.compositeeditor.EditorProvider;
|
import ghidra.app.plugin.core.compositeeditor.EditorProvider;
|
||||||
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
import ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin;
|
||||||
|
@ -399,9 +399,9 @@ public class EnumEditorProvider extends ComponentProviderAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
private int showOptionDialog(Enum editedEnoom, Set<String> oldNameFields) {
|
private int showOptionDialog(Enum editedEnoom, Set<String> oldNameFields) {
|
||||||
StringBuilder msg = new StringBuilder(
|
StringBuilder msg =
|
||||||
"<html>If you save this Enum with the <font color=\"" + Colors.ERROR.toHexString() +
|
new StringBuilder("<html>If you save this Enum with the <font color=\"" +
|
||||||
"\">new value(s)</font> listed below,<br>" +
|
Messages.ERROR.toHexString() + "\">new value(s)</font> listed below,<br>" +
|
||||||
" it will invalidate equates created with the old value(s).<br>");
|
" it will invalidate equates created with the old value(s).<br>");
|
||||||
msg.append("<ul>");
|
msg.append("<ul>");
|
||||||
for (String field : oldNameFields) {
|
for (String field : oldNameFields) {
|
||||||
|
@ -414,7 +414,7 @@ public class EnumEditorProvider extends ComponentProviderAdapter
|
||||||
newVal = "Missing";
|
newVal = "Missing";
|
||||||
}
|
}
|
||||||
msg.append(String.format(
|
msg.append(String.format(
|
||||||
"<li>%s: 0x%s \u2192 <font color=\"" + Colors.ERROR.toHexString() +
|
"<li>%s: 0x%s \u2192 <font color=\"" + Messages.ERROR.toHexString() +
|
||||||
"\">%s</font></li>",
|
"\">%s</font></li>",
|
||||||
HTMLUtilities.escapeHTML(field), Long.toHexString(originalEnum.getValue(field)),
|
HTMLUtilities.escapeHTML(field), Long.toHexString(originalEnum.getValue(field)),
|
||||||
newVal));
|
newVal));
|
||||||
|
|
|
@ -33,6 +33,7 @@ import docking.widgets.OptionDialog;
|
||||||
import generic.jar.ResourceFile;
|
import generic.jar.ResourceFile;
|
||||||
import generic.theme.*;
|
import generic.theme.*;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors;
|
||||||
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.app.script.GhidraScriptUtil;
|
import ghidra.app.script.GhidraScriptUtil;
|
||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
import ghidra.util.datastruct.FixedSizeStack;
|
import ghidra.util.datastruct.FixedSizeStack;
|
||||||
|
@ -215,8 +216,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
undoAction.setDescription("Undo");
|
undoAction.setDescription("Undo");
|
||||||
undoAction.setToolBarData(
|
undoAction.setToolBarData(new ToolBarData(new GIcon("icon.undo"), "UndoRedo"));
|
||||||
new ToolBarData(new GIcon("icon.undo"), "UndoRedo"));
|
|
||||||
undoAction.setEnabled(false);
|
undoAction.setEnabled(false);
|
||||||
undoAction.setKeyBindingData(new KeyBindingData(
|
undoAction.setKeyBindingData(new KeyBindingData(
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_Z, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
KeyStroke.getKeyStroke(KeyEvent.VK_Z, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
||||||
|
@ -236,8 +236,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
redoAction.setDescription("Redo");
|
redoAction.setDescription("Redo");
|
||||||
redoAction.setToolBarData(
|
redoAction.setToolBarData(new ToolBarData(new GIcon("icon.redo"), "UndoRedo"));
|
||||||
new ToolBarData(new GIcon("icon.redo"), "UndoRedo"));
|
|
||||||
redoAction.setKeyBindingData(new KeyBindingData(
|
redoAction.setKeyBindingData(new KeyBindingData(
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_Y, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
KeyStroke.getKeyStroke(KeyEvent.VK_Y, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
||||||
redoAction.setEnabled(false);
|
redoAction.setEnabled(false);
|
||||||
|
@ -264,8 +263,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
saveAction.setDescription("Save");
|
saveAction.setDescription("Save");
|
||||||
saveAction.setToolBarData(
|
saveAction.setToolBarData(new ToolBarData(Icons.SAVE_ICON, "Save"));
|
||||||
new ToolBarData(Icons.SAVE_ICON, "Save"));
|
|
||||||
saveAction.setKeyBindingData(new KeyBindingData(
|
saveAction.setKeyBindingData(new KeyBindingData(
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_S, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
KeyStroke.getKeyStroke(KeyEvent.VK_S, DockingUtils.CONTROL_KEY_MODIFIER_MASK)));
|
||||||
|
|
||||||
|
@ -301,8 +299,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
saveAsAction.setDescription("Save As...");
|
saveAsAction.setDescription("Save As...");
|
||||||
saveAsAction.setToolBarData(
|
saveAsAction.setToolBarData(new ToolBarData(Icons.SAVE_AS_ICON, "Save"));
|
||||||
new ToolBarData(Icons.SAVE_AS_ICON, "Save"));
|
|
||||||
saveAsAction.setEnabled(true);
|
saveAsAction.setEnabled(true);
|
||||||
plugin.getTool().addLocalAction(this, saveAsAction);
|
plugin.getTool().addLocalAction(this, saveAsAction);
|
||||||
|
|
||||||
|
@ -339,8 +336,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
doSelectFont();
|
doSelectFont();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fontAction.setToolBarData(
|
fontAction.setToolBarData(new ToolBarData(new GIcon("icon.font"), "ZZFont"));
|
||||||
new ToolBarData(new GIcon("icon.font"), "ZZFont"));
|
|
||||||
fontAction.setDescription("Select Font");
|
fontAction.setDescription("Select Font");
|
||||||
fontAction.setEnabled(true);
|
fontAction.setEnabled(true);
|
||||||
plugin.getTool().addLocalAction(this, fontAction);
|
plugin.getTool().addLocalAction(this, fontAction);
|
||||||
|
@ -433,8 +429,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
int choice = OptionDialog.showOptionDialog(scrollPane, FILE_ON_DISK_CHANGED_TITLE,
|
int choice = OptionDialog.showOptionDialog(scrollPane, FILE_ON_DISK_CHANGED_TITLE,
|
||||||
"<html>The contents of the script file have changed on disk.<br><br>Would " +
|
"<html>The contents of the script file have changed on disk.<br><br>Would " +
|
||||||
"you like to <b>keep your changes</b> in the editor or <b><font color=\"" +
|
"you like to <b>keep your changes</b> in the editor or <b><font color=\"" +
|
||||||
Colors.ERROR.toHexString() + "\">" +
|
Colors.ERROR.toHexString() + "\">" + "discard</font></b> your changes?",
|
||||||
"discard</font></b> your changes?",
|
|
||||||
KEEP_CHANGES_TEXT, DISCARD_CHANGES_TEXT, OptionDialog.QUESTION_MESSAGE);
|
KEEP_CHANGES_TEXT, DISCARD_CHANGES_TEXT, OptionDialog.QUESTION_MESSAGE);
|
||||||
|
|
||||||
if (choice == OptionDialog.CANCEL_OPTION) {
|
if (choice == OptionDialog.CANCEL_OPTION) {
|
||||||
|
@ -455,8 +450,7 @@ public class GhidraScriptEditorComponentProvider extends ComponentProvider {
|
||||||
//
|
//
|
||||||
choice = OptionDialog.showOptionDialog(scrollPane, CHANGE_DESTINATION_TITLE,
|
choice = OptionDialog.showOptionDialog(scrollPane, CHANGE_DESTINATION_TITLE,
|
||||||
"<html>You can save your current changes to <b>another file</b> or " +
|
"<html>You can save your current changes to <b>another file</b> or " +
|
||||||
"<b><font color=\"" +
|
"<b><font color=\"" + Messages.ERROR.toHexString() +
|
||||||
Colors.ERROR.toHexString() +
|
|
||||||
"\">overwrite</font></b> the contents of the file on disk.",
|
"\">overwrite</font></b> the contents of the file on disk.",
|
||||||
SAVE_CHANGES_AS_TEXT, OVERWRITE_CHANGES_TEXT, OptionDialog.QUESTION_MESSAGE);
|
SAVE_CHANGES_AS_TEXT, OVERWRITE_CHANGES_TEXT, OptionDialog.QUESTION_MESSAGE);
|
||||||
|
|
||||||
|
|
|
@ -121,9 +121,9 @@ class InfoPanel extends JPanel {
|
||||||
float w = view.getPreferredSpan(View.X_AXIS);
|
float w = view.getPreferredSpan(View.X_AXIS);
|
||||||
float h = view.getPreferredSpan(View.Y_AXIS);
|
float h = view.getPreferredSpan(View.Y_AXIS);
|
||||||
|
|
||||||
JLabel distribLabel = new GHtmlLabel(content);
|
JLabel distLabel = new GHtmlLabel(content);
|
||||||
distribLabel.setPreferredSize(new Dimension((int) Math.ceil(w), (int) Math.ceil(h + 10)));
|
distLabel.setPreferredSize(new Dimension((int) Math.ceil(w), (int) Math.ceil(h + 10)));
|
||||||
return distribLabel;
|
return distLabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Component buildMarkingLabel() {
|
private Component buildMarkingLabel() {
|
||||||
|
@ -271,17 +271,4 @@ class InfoPanel extends JPanel {
|
||||||
return SPLASH_FILENAME + " file is unreadable!";
|
return SPLASH_FILENAME + " file is unreadable!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
JFrame f = new JFrame("Ghidra");
|
|
||||||
InfoPanel p = new InfoPanel();
|
|
||||||
f.getContentPane().add(p);
|
|
||||||
f.pack();
|
|
||||||
f.setVisible(true);
|
|
||||||
|
|
||||||
JDialog d = new JDialog(f, "About Ghidra", true);
|
|
||||||
d.getContentPane().add(new InfoPanel());
|
|
||||||
d.pack();
|
|
||||||
d.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
<title>The Byte Viewer</title>
|
<title>The Byte Viewer</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||||
<meta name="generator" content="Microsoft FrontPage 4.0">
|
|
||||||
</head>
|
</head>
|
||||||
<body lang="EN-US">
|
<body lang="EN-US">
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@
|
||||||
may be added to your view. To add or remove a data format view
|
may be added to your view. To add or remove a data format view
|
||||||
from the tool, press the <img alt="" src="images/wrench.png">
|
from the tool, press the <img alt="" src="images/wrench.png">
|
||||||
icon to bring up the <span
|
icon to bring up the <span
|
||||||
style="font-style: italic;">Byte Vieweer Options </span>dialog.
|
style="font-style: italic;">Byte Viewer Options </span>dialog.
|
||||||
Select the formats that you want and press the <span
|
Select the formats that you want and press the <span
|
||||||
style="font-weight: bold;">OK </span>button.<br>
|
style="font-weight: bold;">OK </span>button.<br>
|
||||||
</p>
|
</p>
|
||||||
|
@ -65,15 +64,14 @@
|
||||||
program. For those addresses that can be formed and are in memory, the
|
program. For those addresses that can be formed and are in memory, the
|
||||||
view shows the symbol, <img src="images/addressMark.png" border="0">
|
view shows the symbol, <img src="images/addressMark.png" border="0">
|
||||||
So if you go to that address in the <a
|
So if you go to that address in the <a
|
||||||
href="help/topics/CodeBrowserPlugin/CodeBrowser.htm"> Code Browser</a>, and <font
|
href="help/topics/CodeBrowserPlugin/CodeBrowser.htm"> Code Browser</a>, and
|
||||||
color="#000000"><a href="help/topics/DataPlugin/Data.htm#Pointer">make a
|
<a href="help/topics/DataPlugin/Data.htm#Pointer">make a
|
||||||
Pointer data type</a>,</font> <font color="#0000ff"> </font><font
|
Pointer data type</a>, the address pointed to is in memory. Conversely, if
|
||||||
color="#000000">the address pointed to is in memory. Conversely, if
|
|
||||||
you go to a "tic" address in the Code Browser and make a pointer, the
|
you go to a "tic" address in the Code Browser and make a pointer, the
|
||||||
address pointed to is not in memory (the operand is
|
address pointed to is not in memory (the operand is
|
||||||
rendered in red).</font></p>
|
rendered in red).</font></p>
|
||||||
|
|
||||||
<p><font color="#000000">This view does not support <a href="#EditBytes">editing</a>.</font></p>
|
<p>This view does not support <a href="#EditBytes">editing</a>.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<h3><a name="Add_Byteviewer_Disassembled_Panel"></a><a name="Disassembled"></a>Disassembled</h3>
|
<h3><a name="Add_Byteviewer_Disassembled_Panel"></a><a name="Disassembled"></a>Disassembled</h3>
|
||||||
|
@ -225,7 +223,7 @@
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>The alignment address specifies what address should appear in
|
<p>The alignment address specifies what address should appear in
|
||||||
column 0. Any address can be specified, but the address will be
|
column 0. Any address can be specified, but the address will be
|
||||||
normalized to be near the program's miminum address. This enables you to
|
normalized to be near the program's minimum address. This enables you to
|
||||||
view bytes in an offcut manner and to identify patterns in the bytes.
|
view bytes in an offcut manner and to identify patterns in the bytes.
|
||||||
Changing the alignment address affects the <a href="#OffsetField">offset</a>,
|
Changing the alignment address affects the <a href="#OffsetField">offset</a>,
|
||||||
which is the column that would display the bytes for address 0 if it
|
which is the column that would display the bytes for address 0 if it
|
||||||
|
|
|
@ -802,7 +802,7 @@
|
||||||
<LI><B>Start Fully Zoomed Out</B> - always start fully zoomed out so that the entire
|
<LI><B>Start Fully Zoomed Out</B> - always start fully zoomed out so that the entire
|
||||||
graph can be seen.</LI>
|
graph can be seen.</LI>
|
||||||
|
|
||||||
<LI><B>Start Fully Zoomed In/B> - always start fully zoomed in on the vertex containing
|
<LI><B>Start Fully Zoomed In</B> - always start fully zoomed in on the vertex containing
|
||||||
the current location.</LI>
|
the current location.</LI>
|
||||||
|
|
||||||
<LI><B>Remember User Settings</B> - keep the zoom level where the user previously left
|
<LI><B>Remember User Settings</B> - keep the zoom level where the user previously left
|
||||||
|
|
|
@ -27,7 +27,7 @@ import docking.DockingWindowManager;
|
||||||
import docking.widgets.checkbox.GCheckBox;
|
import docking.widgets.checkbox.GCheckBox;
|
||||||
import docking.widgets.label.GHtmlLabel;
|
import docking.widgets.label.GHtmlLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import ghidra.util.table.GhidraTable;
|
import ghidra.util.table.GhidraTable;
|
||||||
import pdb.PdbPlugin;
|
import pdb.PdbPlugin;
|
||||||
|
@ -100,8 +100,7 @@ class SymbolFilePanel extends JPanel {
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolFileRow getSelectedRow() {
|
SymbolFileRow getSelectedRow() {
|
||||||
return table.getSelectedRow() != -1
|
return table.getSelectedRow() != -1 ? tableModel.getRowObject(table.getSelectedRow())
|
||||||
? tableModel.getRowObject(table.getSelectedRow())
|
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +117,8 @@ class SymbolFilePanel extends JPanel {
|
||||||
|
|
||||||
private JPanel buildWelcomePanel() {
|
private JPanel buildWelcomePanel() {
|
||||||
welcomePanel = new JPanel();
|
welcomePanel = new JPanel();
|
||||||
welcomePanel.add(new GHtmlLabel(
|
welcomePanel.add(new GHtmlLabel("<html><br><center><font color=\"" +
|
||||||
"<html><br><center><font color=\"" + Colors.ERROR.toHexString() +
|
Messages.ERROR.toHexString() + "\">Configuration must be set first!"));
|
||||||
"\">Configuration must be set first!"));
|
|
||||||
welcomePanel.setPreferredSize(tablePanel.getPreferredSize());
|
welcomePanel.setPreferredSize(tablePanel.getPreferredSize());
|
||||||
|
|
||||||
return welcomePanel;
|
return welcomePanel;
|
||||||
|
|
|
@ -37,7 +37,7 @@ import docking.widgets.label.GHtmlLabel;
|
||||||
import docking.widgets.label.GLabel;
|
import docking.widgets.label.GLabel;
|
||||||
import docking.widgets.table.GTable;
|
import docking.widgets.table.GTable;
|
||||||
import docking.widgets.textfield.HintTextField;
|
import docking.widgets.textfield.HintTextField;
|
||||||
import generic.theme.GThemeDefaults.Colors;
|
import generic.theme.GThemeDefaults.Colors.Messages;
|
||||||
import ghidra.framework.preferences.Preferences;
|
import ghidra.framework.preferences.Preferences;
|
||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
import ghidra.util.layout.PairLayout;
|
import ghidra.util.layout.PairLayout;
|
||||||
|
@ -112,7 +112,7 @@ class SymbolServerPanel extends JPanel {
|
||||||
JScrollPane tableScrollPane = buildTable();
|
JScrollPane tableScrollPane = buildTable();
|
||||||
defaultConfigNotice = new JPanel();
|
defaultConfigNotice = new JPanel();
|
||||||
GHtmlLabel label = new GHtmlLabel("<html><center><font color=\"" +
|
GHtmlLabel label = new GHtmlLabel("<html><center><font color=\"" +
|
||||||
Colors.ERROR.toHexString() + "\"><br>Missing / invalid configuration.<br><br>" +
|
Messages.ERROR.toHexString() + "\"><br>Missing / invalid configuration.<br><br>" +
|
||||||
"Using default search location:<br>Program's Import Location<br>");
|
"Using default search location:<br>Program's Import Location<br>");
|
||||||
label.setHorizontalAlignment(SwingConstants.CENTER);
|
label.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
defaultConfigNotice.add(label);
|
defaultConfigNotice.add(label);
|
||||||
|
|
|
@ -159,14 +159,14 @@ color.fg.dialog.status.error = color.fg.error
|
||||||
color.fg.dialog.status.warning = orange
|
color.fg.dialog.status.warning = orange
|
||||||
color.fg.dialog.status.normal = lightBlue
|
color.fg.dialog.status.normal = lightBlue
|
||||||
|
|
||||||
color.bg.currentline = rgb(40,40,56) // dark bluish gray
|
color.bg.currentline = #003366
|
||||||
|
|
||||||
color.bg.textfield.hint.invalid = maroon
|
color.bg.textfield.hint.invalid = maroon
|
||||||
|
|
||||||
color.bg.filterfield = color.bg.filtered
|
color.bg.filterfield = color.bg.filtered
|
||||||
color.fg.filterfield = darkSlateGray
|
color.fg.filterfield = darkSlateGray
|
||||||
|
|
||||||
color.bg.selection = #284028 // greenish
|
color.bg.selection = #003333 // greenish
|
||||||
color.bg.highlight = #404028 // yellowish
|
color.bg.highlight = #404028 // yellowish
|
||||||
|
|
||||||
color.bg.fieldpanel.selection.and.highlight = #344028 // yellow greenish
|
color.bg.fieldpanel.selection.and.highlight = #344028 // yellow greenish
|
||||||
|
|
|
@ -39,11 +39,11 @@ public interface GComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current HTML rendering 'enable-ment' of this component.
|
* Returns the current HTML rendering enablement of this component.
|
||||||
*
|
*
|
||||||
* @return boolean, true if HTML rendering is allowed
|
* @return boolean, true if HTML rendering is allowed
|
||||||
*/
|
*/
|
||||||
public default boolean getHTMLRenderingEnabled() {
|
public default boolean isHTMLRenderingEnabled() {
|
||||||
Object prop = ((JComponent) this).getClientProperty(HTML_DISABLE_STRING);
|
Object prop = ((JComponent) this).getClientProperty(HTML_DISABLE_STRING);
|
||||||
return prop == null || prop != Boolean.TRUE;
|
return prop == null || prop != Boolean.TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,13 +51,11 @@ public abstract class AbstractHtmlLabel extends JLabel
|
||||||
|
|
||||||
protected AbstractHtmlLabel() {
|
protected AbstractHtmlLabel() {
|
||||||
addPropertyChangeListener(this);
|
addPropertyChangeListener(this);
|
||||||
setHTMLRenderingEnabled(false); // disable parent html rendering so we can do our own
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AbstractHtmlLabel(String text) {
|
protected AbstractHtmlLabel(String text) {
|
||||||
super(text);
|
super(text);
|
||||||
addPropertyChangeListener(this);
|
addPropertyChangeListener(this);
|
||||||
setHTMLRenderingEnabled(false); // disable parent html rendering so we can do our own
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -82,7 +80,7 @@ public abstract class AbstractHtmlLabel extends JLabel
|
||||||
private void updateHtmlView() {
|
private void updateHtmlView() {
|
||||||
|
|
||||||
String text = getText();
|
String text = getText();
|
||||||
if (text == null) {
|
if (text == null || !isHTMLRenderingEnabled()) {
|
||||||
putClientProperty(BasicHTML.propertyKey, null);
|
putClientProperty(BasicHTML.propertyKey, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ public abstract class AbstractColumnConstraintEditor<T> implements ColumnConstra
|
||||||
* @return an HTML string suitable for a JLabel.
|
* @return an HTML string suitable for a JLabel.
|
||||||
*/
|
*/
|
||||||
protected final static String formatStatus(String message, boolean error) {
|
protected final static String formatStatus(String message, boolean error) {
|
||||||
Color color = error ? Colors.ERROR : Colors.FOREGROUND;
|
Color color = error ? Colors.Messages.ERROR : Colors.FOREGROUND;
|
||||||
String messageWithFont = HTMLUtilities.setFont(message, color, 12);
|
String messageWithFont = HTMLUtilities.setFont(message, color, 12);
|
||||||
String html = HTMLUtilities.wrapAsHTML(messageWithFont);
|
String html = HTMLUtilities.wrapAsHTML(messageWithFont);
|
||||||
return html;
|
return html;
|
||||||
|
|
|
@ -56,7 +56,7 @@ import ghidra.util.worker.PriorityWorker;
|
||||||
* Class for creating a JTree that supports filtering, threading, and a progress bar.
|
* Class for creating a JTree that supports filtering, threading, and a progress bar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GTree extends JPanel implements BusyListener, ThemeListener {
|
public class GTree extends JPanel implements BusyListener {
|
||||||
private static final Color BACKGROUND = new GColor("color.bg.tree");
|
private static final Color BACKGROUND = new GColor("color.bg.tree");
|
||||||
private AutoScrollTree tree;
|
private AutoScrollTree tree;
|
||||||
private GTreeModel model;
|
private GTreeModel model;
|
||||||
|
@ -93,6 +93,11 @@ public class GTree extends JPanel implements BusyListener, ThemeListener {
|
||||||
private JTreeMouseListenerDelegate mouseListenerDelegate;
|
private JTreeMouseListenerDelegate mouseListenerDelegate;
|
||||||
private GTreeDragNDropHandler dragNDropHandler;
|
private GTreeDragNDropHandler dragNDropHandler;
|
||||||
private boolean isFilteringEnabled = true;
|
private boolean isFilteringEnabled = true;
|
||||||
|
private ThemeListener themeListener = e -> {
|
||||||
|
if (e.isLookAndFeelChanged()) {
|
||||||
|
model.fireNodeStructureChanged(getModelRoot());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private ThreadLocal<TaskMonitor> threadLocalMonitor = new ThreadLocal<>();
|
private ThreadLocal<TaskMonitor> threadLocalMonitor = new ThreadLocal<>();
|
||||||
private PriorityWorker worker;
|
private PriorityWorker worker;
|
||||||
|
@ -135,7 +140,7 @@ public class GTree extends JPanel implements BusyListener, ThemeListener {
|
||||||
uniquePreferenceKey));
|
uniquePreferenceKey));
|
||||||
|
|
||||||
filterUpdateManager = new SwingUpdateManager(1000, 30000, () -> updateModelFilter());
|
filterUpdateManager = new SwingUpdateManager(1000, 30000, () -> updateModelFilter());
|
||||||
Gui.addThemeListener(this);
|
Gui.addThemeListener(themeListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -148,13 +153,6 @@ public class GTree extends JPanel implements BusyListener, ThemeListener {
|
||||||
threadLocalMonitor.set(monitor);
|
threadLocalMonitor.set(monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void themeChanged(ThemeEvent event) {
|
|
||||||
if (event.isLookAndFeelChanged()) {
|
|
||||||
model.fireNodeStructureChanged(getModelRoot());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the monitor in associated with the GTree for the calling thread. This method is
|
* Returns the monitor in associated with the GTree for the calling thread. This method is
|
||||||
* designed to be used by slow loading nodes that are loading <b>off the Swing thread</b>. Some
|
* designed to be used by slow loading nodes that are loading <b>off the Swing thread</b>. Some
|
||||||
|
@ -272,6 +270,8 @@ public class GTree extends JPanel implements BusyListener, ThemeListener {
|
||||||
realViewRootNode.disposeClones();
|
realViewRootNode.disposeClones();
|
||||||
}
|
}
|
||||||
model.dispose();
|
model.dispose();
|
||||||
|
|
||||||
|
Gui.removeThemeListener(themeListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDisposed() {
|
public boolean isDisposed() {
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class GThemeDefaults {
|
||||||
public static final GColor BACKGROUND = new GColor("color.bg");
|
public static final GColor BACKGROUND = new GColor("color.bg");
|
||||||
public static final GColor CURSOR = new GColor("color.cursor.focused");
|
public static final GColor CURSOR = new GColor("color.cursor.focused");
|
||||||
public static final GColor DISABLED = new GColor("color.palette.disabled");
|
public static final GColor DISABLED = new GColor("color.palette.disabled");
|
||||||
public static final GColor ERROR = new GColor("color.fg.error"); // TODO replace most uses of this with Messages.ERROR
|
public static final GColor ERROR = new GColor("color.fg.error");
|
||||||
public static final GColor FOREGROUND = new GColor("color.fg");
|
public static final GColor FOREGROUND = new GColor("color.fg");
|
||||||
public static final GColor FOREGROUND_DISABLED = new GColor("color.fg.disabled");
|
public static final GColor FOREGROUND_DISABLED = new GColor("color.fg.disabled");
|
||||||
//@formatter:on
|
//@formatter:on
|
||||||
|
@ -83,6 +83,7 @@ public class GThemeDefaults {
|
||||||
public static class Messages {
|
public static class Messages {
|
||||||
//@formatter:off
|
//@formatter:off
|
||||||
public static final GColor NORMAL = new GColor("color.fg.messages.normal");
|
public static final GColor NORMAL = new GColor("color.fg.messages.normal");
|
||||||
|
@SuppressWarnings("hiding") // we know there is another 'ERROR' field in this file
|
||||||
public static final GColor ERROR = new GColor("color.fg.messages.error");
|
public static final GColor ERROR = new GColor("color.fg.messages.error");
|
||||||
public static final GColor HINT = new GColor("color.fg.messages.hint");
|
public static final GColor HINT = new GColor("color.fg.messages.hint");
|
||||||
public static final GColor WARNING = new GColor("color.fg.messages.warning");
|
public static final GColor WARNING = new GColor("color.fg.messages.warning");
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Map;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import javax.swing.Icon;
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
import javax.swing.event.HyperlinkEvent;
|
import javax.swing.event.HyperlinkEvent;
|
||||||
import javax.swing.event.HyperlinkListener;
|
import javax.swing.event.HyperlinkListener;
|
||||||
|
@ -35,6 +36,7 @@ import javax.swing.text.html.HTML.Tag;
|
||||||
|
|
||||||
import generic.jar.ResourceFile;
|
import generic.jar.ResourceFile;
|
||||||
import generic.theme.*;
|
import generic.theme.*;
|
||||||
|
import generic.theme.GThemeDefaults.Colors;
|
||||||
import ghidra.framework.Application;
|
import ghidra.framework.Application;
|
||||||
import ghidra.framework.preferences.Preferences;
|
import ghidra.framework.preferences.Preferences;
|
||||||
import ghidra.util.Msg;
|
import ghidra.util.Msg;
|
||||||
|
@ -73,8 +75,7 @@ public class GHelpHTMLEditorKit extends HTMLEditorKit {
|
||||||
colorsById.put("h3", new GColor("color.fg.help.selector.h3"));
|
colorsById.put("h3", new GColor("color.fg.help.selector.h3"));
|
||||||
colorsById.put("p.providedbyplugin",
|
colorsById.put("p.providedbyplugin",
|
||||||
new GColor("color.fg.help.selector.p.provided.by.plugin"));
|
new GColor("color.fg.help.selector.p.provided.by.plugin"));
|
||||||
colorsById.put("p.relatedtopic",
|
colorsById.put("p.relatedtopic", new GColor("color.fg.help.selector.p.related.topic"));
|
||||||
new GColor("color.fg.help.selector.p.related.topic"));
|
|
||||||
colorsById.put("th", new GColor("color.fg.help.selector.th"));
|
colorsById.put("th", new GColor("color.fg.help.selector.th"));
|
||||||
colorsById.put("code", new GColor("color.fg.help.selector.code"));
|
colorsById.put("code", new GColor("color.fg.help.selector.code"));
|
||||||
colorsById.put("code.path", new GColor("color.fg.help.selector.code.path"));
|
colorsById.put("code.path", new GColor("color.fg.help.selector.code.path"));
|
||||||
|
@ -470,6 +471,11 @@ public class GHelpHTMLEditorKit extends HTMLEditorKit {
|
||||||
*/
|
*/
|
||||||
private class GHelpImageView extends ImageView {
|
private class GHelpImageView extends ImageView {
|
||||||
|
|
||||||
|
private static final String HELP_SHARED_ARROW = "help/shared/arrow.gif";
|
||||||
|
private static final Icon SHARED_ARROW_ICON = new HelpRightArrowIcon(Colors.FOREGROUND);
|
||||||
|
private static final IconProvider SHARED_ARROW_ICON_PROVIDER =
|
||||||
|
new IconProvider(SHARED_ARROW_ICON, null);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unusual Code Alert!
|
* Unusual Code Alert!
|
||||||
* This class exists to enable our help system to find custom icons defined in source
|
* This class exists to enable our help system to find custom icons defined in source
|
||||||
|
@ -541,7 +547,17 @@ public class GHelpHTMLEditorKit extends HTMLEditorKit {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
String srcString = src.toString();
|
//
|
||||||
|
// This code is looking for the specific referenced image file and then replacing that
|
||||||
|
// image file with something that can update its content at runtime, based on theme.
|
||||||
|
// Alternatively, we could have updated all help files to point to a GIcon, which
|
||||||
|
// handles updating itself when the theme changes. We chose to replace the icon here
|
||||||
|
// instead of in the source code to prevent changing many files.
|
||||||
|
//
|
||||||
|
String srcString = src.toString().trim();
|
||||||
|
if (srcString.equals(HELP_SHARED_ARROW)) {
|
||||||
|
return installImageFromCustomIcon(SHARED_ARROW_ICON_PROVIDER);
|
||||||
|
}
|
||||||
|
|
||||||
// check if the srcString is a defined theme icon id
|
// check if the srcString is a defined theme icon id
|
||||||
if (Gui.hasIcon(srcString)) {
|
if (Gui.hasIcon(srcString)) {
|
||||||
|
@ -562,6 +578,19 @@ public class GHelpHTMLEditorKit extends HTMLEditorKit {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private URL installImageFromCustomIcon(IconProvider iconProvider) {
|
||||||
|
|
||||||
|
if (iconProvider == null || iconProvider.isInvalid()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.image = iconProvider.getImage();
|
||||||
|
|
||||||
|
// note: this icon is not used to load the image; the 'image' we set is used instead
|
||||||
|
URL url = iconProvider.getOrCreateUrl();
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
private URL installImageFromJavaCode(String srcString) {
|
private URL installImageFromJavaCode(String srcString) {
|
||||||
|
|
||||||
IconProvider iconProvider = getIconFromJavaCode(srcString);
|
IconProvider iconProvider = getIconFromJavaCode(srcString);
|
||||||
|
|
154
Ghidra/Framework/Help/src/main/java/help/HelpRightArrowIcon.java
Normal file
154
Ghidra/Framework/Help/src/main/java/help/HelpRightArrowIcon.java
Normal file
|
@ -0,0 +1,154 @@
|
||||||
|
/* ###
|
||||||
|
* 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 help;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.geom.*;
|
||||||
|
|
||||||
|
import javax.swing.Icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A basic arrow that points to the right, with padding on the sides and above.
|
||||||
|
*/
|
||||||
|
public class HelpRightArrowIcon implements Icon {
|
||||||
|
|
||||||
|
private static final int ICON_SIZE = 20;
|
||||||
|
|
||||||
|
private Color color;
|
||||||
|
private Shape shape;
|
||||||
|
|
||||||
|
public HelpRightArrowIcon(Color color) {
|
||||||
|
this.color = color;
|
||||||
|
this.shape = buildShape();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Shape buildShape() {
|
||||||
|
|
||||||
|
GeneralPath barPath = new GeneralPath();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Construct the arrow in 2 parts: the line and the angle bracket. The arrow will not fill
|
||||||
|
// the full area. This allows space before and after the arrow. This space serves as
|
||||||
|
// padding between text inside of html content. The arrow is also closer to the bottom,
|
||||||
|
// to aligned vertically with text.
|
||||||
|
//
|
||||||
|
double height = 10;
|
||||||
|
double width = 12;
|
||||||
|
double thickness = 2;
|
||||||
|
double arrowthickness = 3;
|
||||||
|
|
||||||
|
double top = ICON_SIZE - height;
|
||||||
|
double cy = top + (height / 2);
|
||||||
|
double p1x = (ICON_SIZE - width) / 2;
|
||||||
|
double p1y = cy - (thickness / 2);
|
||||||
|
barPath.moveTo(p1x, p1y);
|
||||||
|
|
||||||
|
double barlength = width - 2;
|
||||||
|
double p2x = p1x + barlength;
|
||||||
|
double p2y = p1y;
|
||||||
|
barPath.lineTo(p2x, p2y);
|
||||||
|
|
||||||
|
double p3x = p2x;
|
||||||
|
double p3y = p2y + thickness;
|
||||||
|
barPath.lineTo(p3x, p3y);
|
||||||
|
|
||||||
|
double p4x = p1x;
|
||||||
|
double p4y = p3y;
|
||||||
|
barPath.lineTo(p4x, p4y);
|
||||||
|
|
||||||
|
// back to start of arrow line
|
||||||
|
barPath.lineTo(p1x, p1y);
|
||||||
|
barPath.closePath();
|
||||||
|
|
||||||
|
GeneralPath arrowPath = new GeneralPath();
|
||||||
|
|
||||||
|
// trailing arrow bar center
|
||||||
|
p1x = p1x + barlength + arrowthickness;
|
||||||
|
p1y = cy;
|
||||||
|
arrowPath.moveTo(p1x, p1y);
|
||||||
|
|
||||||
|
// trailing upper arrow bar point
|
||||||
|
double trianglewidth = 5;
|
||||||
|
p2x = p1x - trianglewidth;
|
||||||
|
p2y = top + 1;
|
||||||
|
arrowPath.lineTo(p2x, p2y);
|
||||||
|
|
||||||
|
// leading upper arrow bar point
|
||||||
|
p3x = p2x - arrowthickness;
|
||||||
|
p3y = p2y;
|
||||||
|
arrowPath.lineTo(p3x, p3y);
|
||||||
|
|
||||||
|
// leading arrow bar center
|
||||||
|
p4x = p1x - arrowthickness;
|
||||||
|
p4y = cy;
|
||||||
|
arrowPath.lineTo(p4x, p4y);
|
||||||
|
|
||||||
|
// leading lower arrow bar point
|
||||||
|
double p5x = p3x;
|
||||||
|
double p5y = ICON_SIZE - 1;
|
||||||
|
arrowPath.lineTo(p5x, p5y);
|
||||||
|
|
||||||
|
// trailing lower arrow bar point
|
||||||
|
double p6x = p2x;
|
||||||
|
double p6y = p5y;
|
||||||
|
arrowPath.lineTo(p6x, p6y);
|
||||||
|
|
||||||
|
// back to start
|
||||||
|
double p7x = p1x;
|
||||||
|
double p7y = p1y;
|
||||||
|
arrowPath.lineTo(p7x, p7y);
|
||||||
|
arrowPath.closePath();
|
||||||
|
|
||||||
|
AffineTransform identity = new AffineTransform();
|
||||||
|
Shape barShape = barPath.createTransformedShape(identity);
|
||||||
|
Area barArea = new Area(barShape);
|
||||||
|
|
||||||
|
Shape arrowShape = arrowPath.createTransformedShape(identity);
|
||||||
|
Area arrowArea = new Area(arrowShape);
|
||||||
|
|
||||||
|
Area fullArea = new Area();
|
||||||
|
fullArea.add(barArea);
|
||||||
|
fullArea.add(arrowArea);
|
||||||
|
|
||||||
|
return fullArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||||
|
|
||||||
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
|
|
||||||
|
try {
|
||||||
|
g2d.translate(x, y);
|
||||||
|
g2d.setColor(color);
|
||||||
|
g2d.fill(shape);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
g2d.translate(-x, -y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIconWidth() {
|
||||||
|
return ICON_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getIconHeight() {
|
||||||
|
return ICON_SIZE;
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 69 B |
|
@ -57,7 +57,7 @@ public class ThemeManagerPlugin extends Plugin implements ApplicationLevelOnlyPl
|
||||||
.onAction(e -> switchTheme())
|
.onAction(e -> switchTheme())
|
||||||
.buildAndInstall(tool);
|
.buildAndInstall(tool);
|
||||||
|
|
||||||
new ActionBuilder("Configure", owner).menuPath("Edit", "Theme", "Configure...")
|
new ActionBuilder("Configure", owner).menuPath("Edit", "Theme", "Configure")
|
||||||
.menuGroup(group, "2")
|
.menuGroup(group, "2")
|
||||||
.helpLocation(new HelpLocation("Theming", "Edit_Theme"))
|
.helpLocation(new HelpLocation("Theming", "Edit_Theme"))
|
||||||
.onAction(e -> configure())
|
.onAction(e -> configure())
|
||||||
|
|
|
@ -993,9 +993,8 @@ public abstract class PluginTool extends AbstractDockingTool {
|
||||||
optionsAction.setAddToAllWindows(true);
|
optionsAction.setAddToAllWindows(true);
|
||||||
optionsAction.setHelpLocation(
|
optionsAction.setHelpLocation(
|
||||||
new HelpLocation(ToolConstants.FRONT_END_HELP_TOPIC, "Tool Options"));
|
new HelpLocation(ToolConstants.FRONT_END_HELP_TOPIC, "Tool Options"));
|
||||||
MenuData menuData =
|
MenuData menuData = new MenuData(new String[] { ToolConstants.MENU_EDIT, "&Tool Options" },
|
||||||
new MenuData(new String[] { ToolConstants.MENU_EDIT, "&Tool Options..." }, null,
|
null, ToolConstants.TOOL_OPTIONS_MENU_GROUP);
|
||||||
ToolConstants.TOOL_OPTIONS_MENU_GROUP);
|
|
||||||
menuData.setMenuSubGroup(ToolConstants.TOOL_OPTIONS_MENU_GROUP);
|
menuData.setMenuSubGroup(ToolConstants.TOOL_OPTIONS_MENU_GROUP);
|
||||||
optionsAction.setMenuBarData(menuData);
|
optionsAction.setMenuBarData(menuData);
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,8 @@ public class GhidraTool extends PluginTool {
|
||||||
@Override
|
@Override
|
||||||
public PluginClassManager getPluginClassManager() {
|
public PluginClassManager getPluginClassManager() {
|
||||||
if (pluginClassManager == null) {
|
if (pluginClassManager == null) {
|
||||||
pluginClassManager = new PluginClassManager(Plugin.class, ApplicationLevelOnlyPlugin.class);
|
pluginClassManager =
|
||||||
|
new PluginClassManager(Plugin.class, ApplicationLevelOnlyPlugin.class);
|
||||||
}
|
}
|
||||||
return pluginClassManager;
|
return pluginClassManager;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +207,7 @@ public class GhidraTool extends PluginTool {
|
||||||
};
|
};
|
||||||
|
|
||||||
configureToolAction.setMenuBarData(new MenuData(
|
configureToolAction.setMenuBarData(new MenuData(
|
||||||
new String[] { ToolConstants.MENU_FILE, "Configure..." }, null, "PrintPost_PreTool"));
|
new String[] { ToolConstants.MENU_FILE, "Configure" }, null, "PrintPost_PreTool"));
|
||||||
|
|
||||||
configureToolAction.setEnabled(true);
|
configureToolAction.setEnabled(true);
|
||||||
addAction(configureToolAction);
|
addAction(configureToolAction);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue