mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-1981 Theme help and module conversions
This commit is contained in:
parent
4eb3d8fd86
commit
9a0d7892da
120 changed files with 1540 additions and 2846 deletions
|
@ -74,6 +74,11 @@ public class DefaultHelpService implements HelpService {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reload() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
private void displayHelpInfo(Object helpObj) {
|
||||
String msg = getHelpInfo(helpObj);
|
||||
Msg.showInfo(this, null, "Help Info", msg);
|
||||
|
|
|
@ -46,6 +46,7 @@ public class GHelpBroker extends DefaultHelpBroker {
|
|||
|
||||
protected JEditorPane htmlEditorPane;
|
||||
private Window activationWindow;
|
||||
private boolean initialized;
|
||||
|
||||
/**
|
||||
* Construct a new GhidraHelpBroker.
|
||||
|
@ -89,6 +90,22 @@ public class GHelpBroker extends DefaultHelpBroker {
|
|||
}
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
clearHighlights();
|
||||
initialized = false;
|
||||
if (isDisplayed()) {
|
||||
setDisplayed(false);
|
||||
setDisplayed(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void clearHighlights() {
|
||||
TextHelpModel helpModel = (TextHelpModel) getCustomHelpModel();
|
||||
if (helpModel != null) {
|
||||
helpModel.removeAllHighlights();
|
||||
}
|
||||
}
|
||||
|
||||
protected void showNavigationAid(URL url) {
|
||||
// this base class does not have a navigation aid
|
||||
}
|
||||
|
@ -134,7 +151,7 @@ public class GHelpBroker extends DefaultHelpBroker {
|
|||
}
|
||||
|
||||
private void initializeScreenDevice() {
|
||||
if (isInitialized()) {
|
||||
if (initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -179,20 +196,21 @@ public class GHelpBroker extends DefaultHelpBroker {
|
|||
initializeUIComponents(contentPane);
|
||||
}
|
||||
|
||||
private boolean isInitialized() {
|
||||
return htmlEditorPane != null;
|
||||
}
|
||||
|
||||
private void initializeUIComponents(Container contentPane) {
|
||||
|
||||
if (isInitialized()) {
|
||||
if (initialized) {
|
||||
return;// already initialized
|
||||
}
|
||||
|
||||
Component[] components = contentPane.getComponents();
|
||||
JHelp jHelp = (JHelp) components[0];
|
||||
addCustomToolbarItems(jHelp);
|
||||
JHelpContentViewer contentViewer = jHelp.getContentViewer();
|
||||
JEditorPane activeHtmlPane = getHTMLEditorPane(contentViewer);
|
||||
if (activeHtmlPane == htmlEditorPane && initialized) {
|
||||
return; // already initialized
|
||||
}
|
||||
|
||||
addCustomToolbarItems(jHelp);
|
||||
htmlEditorPane = getHTMLEditorPane(contentViewer);
|
||||
|
||||
// just creating the search wires everything together
|
||||
|
@ -203,6 +221,7 @@ public class GHelpBroker extends DefaultHelpBroker {
|
|||
}
|
||||
|
||||
installActions(jHelp);
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
protected void installHelpSearcher(JHelp jHelp, HelpModel helpModel) {
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.List;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.event.HyperlinkListener;
|
||||
|
@ -496,8 +495,7 @@ public class GHelpHTMLEditorKit extends HTMLEditorKit {
|
|||
return null;
|
||||
}
|
||||
|
||||
ImageIcon imageIcon = iconProvider.getIcon();
|
||||
this.image = imageIcon.getImage();
|
||||
this.image = iconProvider.getImage();
|
||||
|
||||
URL url = iconProvider.getOrCreateUrl();
|
||||
return url;
|
||||
|
|
|
@ -113,4 +113,9 @@ public interface HelpService {
|
|||
* initializing
|
||||
*/
|
||||
public boolean helpExists();
|
||||
|
||||
/**
|
||||
* Called when a major system even happens, such as changing the system theme.
|
||||
*/
|
||||
public void reload();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue