GP-1981 Theme help and module conversions

This commit is contained in:
ghidragon 2022-09-13 16:36:26 -04:00
parent 4eb3d8fd86
commit 9a0d7892da
120 changed files with 1540 additions and 2846 deletions

View file

@ -18,6 +18,7 @@ apply from: "$rootProject.projectDir/gradle/javaProject.gradle"
apply from: "$rootProject.projectDir/gradle/jacocoProject.gradle"
apply from: "$rootProject.projectDir/gradle/javaTestProject.gradle"
apply from: "$rootProject.projectDir/gradle/javadoc.gradle"
apply plugin: 'eclipse'
eclipse.project.name = 'Framework Project'

View file

@ -9,6 +9,12 @@
Module.manifest||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
data/project.theme.properties||GHIDRA||||END|
src/main/help/help/TOC_Source.xml||GHIDRA||||END|
src/main/help/help/topics/Theming/Theming.htm||GHIDRA||||END|
src/main/help/help/topics/Theming/images/ColorEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/FontEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/IconEditor.png||GHIDRA||||END|
src/main/help/help/topics/Theming/images/ThemeDialog.png||GHIDRA||||END|
src/main/java/ghidra/framework/cmd/package.html||GHIDRA||reviewed||END|
src/main/java/ghidra/framework/data/package.html||GHIDRA||reviewed||END|
src/main/java/ghidra/framework/model/package.html||GHIDRA||||END|

View file

@ -23,6 +23,7 @@ import ghidra.framework.main.ApplicationLevelOnlyPlugin;
import ghidra.framework.main.UtilityPluginPackage;
import ghidra.framework.plugintool.*;
import ghidra.framework.plugintool.util.PluginStatus;
import ghidra.util.HelpLocation;
//@formatter:off
@PluginInfo(
@ -49,31 +50,35 @@ public class ThemeManagerPlugin extends Plugin implements ApplicationLevelOnlyPl
new ActionBuilder("Edit Theme", owner)
.menuPath("Edit", "Theme")
.menuGroup(group, "1")
.helpLocation(new HelpLocation("Theming", "Edit_Theme"))
.onAction(e -> ThemeDialog.editTheme())
.buildAndInstall(tool);
new ActionBuilder("Reset To Default", owner)
.menuPath("Edit", themeSubMenu, "Reset To Default")
new ActionBuilder("Reset", owner)
.menuPath("Edit", themeSubMenu, "Reset Theme Values")
.menuGroup(group, "2")
.helpLocation(new HelpLocation("Theming", "Reset_Theme_Values"))
.onAction(e -> ThemeUtils.resetThemeToDefault())
.buildAndInstall(tool);
new ActionBuilder("Import Theme", owner)
.menuPath("Edit", themeSubMenu, "Import...")
.menuGroup(group, "3")
.helpLocation(new HelpLocation("Theming", "Import_Theme"))
.onAction(e -> ThemeUtils.importTheme())
.buildAndInstall(tool);
new ActionBuilder("Export Theme", owner)
.menuPath("Edit", themeSubMenu, "Export...")
.menuGroup(group, "4")
.helpLocation(new HelpLocation("Theming", "Export_Theme"))
.onAction(e -> ThemeUtils.exportTheme())
.buildAndInstall(tool);
new ActionBuilder("Delete Theme", owner)
.menuPath("Edit", themeSubMenu, "Delete...")
.menuGroup(group, "5")
// .enabledWhen(e -> Gui.getActiveTheme() instanceof FileGTheme)
.helpLocation(new HelpLocation("Theming", "Delete_Theme"))
.onAction(e -> ThemeUtils.deleteTheme())
.buildAndInstall(tool);

View file

@ -31,6 +31,7 @@ import docking.tool.ToolConstants;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.list.ListPanel;
import generic.theme.GThemeDefaults.Colors;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.framework.ToolUtils;
import ghidra.framework.model.ToolTemplate;
import ghidra.util.HelpLocation;
@ -183,7 +184,7 @@ class ImportGhidraToolsDialog extends DialogComponentProvider {
while (itr.hasNext()) {
tools[count] = itr.next();
checkboxes[count] = new GCheckBox(tools[count], false);
checkboxes[count].setBackground(Color.LIGHT_GRAY);
checkboxes[count].setBackground(Palette.LIGHT_GRAY);
count++;
}

View file

@ -15,15 +15,16 @@
*/
package ghidra.framework.main;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.*;
import java.util.List;
import javax.swing.*;
import docking.DialogComponentProvider;
import docking.tool.ToolConstants;
import docking.widgets.table.*;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.framework.data.ContentHandler;
import ghidra.framework.model.*;
import ghidra.framework.project.tool.GhidraToolTemplate;
@ -239,8 +240,10 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
private class ContentHandlerComparator implements Comparator<ToolAssociationInfo> {
@Override
public int compare(ToolAssociationInfo o1, ToolAssociationInfo o2) {
return o1.getContentHandler().getContentType().compareTo(
o2.getContentHandler().getContentType());
return o1.getContentHandler()
.getContentType()
.compareTo(
o2.getContentHandler().getContentType());
}
}
@ -298,7 +301,7 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
return;
}
renderer.setForeground(Color.LIGHT_GRAY);
renderer.setForeground(Palette.LIGHT_GRAY);
Icon icon = null;
if (template.getName().equals(info.getAssociatedToolName())) {