GP-1981 - Theming - Base Module

This commit is contained in:
dragonmacher
2022-09-28 19:09:05 -04:00
committed by ghidragon
parent dd31ff47a2
commit 0971c0088c
228 changed files with 1848 additions and 1694 deletions
@@ -21,7 +21,7 @@ import java.util.*;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import db.DBHandle;
import ghidra.program.model.address.*;
@@ -236,7 +236,7 @@ public class DBTraceBookmarkManager extends AbstractDBTraceSpaceBasedManager<DBT
}
@Override
public synchronized DBTraceBookmarkType defineBookmarkType(String typeName, ImageIcon icon,
public synchronized DBTraceBookmarkType defineBookmarkType(String typeName, Icon icon,
Color color, int priority) {
DBTraceBookmarkType type;
synchronized (this) {
@@ -18,6 +18,7 @@ package ghidra.trace.database.bookmark;
import java.awt.Color;
import java.util.*;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import ghidra.trace.model.bookmark.TraceBookmark;
@@ -33,14 +34,14 @@ public class DBTraceBookmarkType implements TraceBookmarkType {
protected final DBTraceBookmarkManager manager;
protected final String name;
protected ImageIcon icon;
protected Icon icon;
protected Color color;
protected int priority;
protected final int id = nextId();
protected final Collection<TraceBookmark> bookmarkView;
public DBTraceBookmarkType(DBTraceBookmarkManager manager, String name, ImageIcon icon,
public DBTraceBookmarkType(DBTraceBookmarkManager manager, String name, Icon icon,
Color color, int priority) {
this.manager = manager;
this.name = name;
@@ -62,7 +63,7 @@ public class DBTraceBookmarkType implements TraceBookmarkType {
}
@Override
public ImageIcon getIcon() {
public Icon getIcon() {
return icon;
}
@@ -19,7 +19,7 @@ import java.awt.Color;
import java.util.*;
import java.util.function.Predicate;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import org.apache.commons.collections4.IteratorUtils;
@@ -52,7 +52,7 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
}
@Override
public BookmarkType defineType(String type, ImageIcon icon, Color color, int priority) {
public BookmarkType defineType(String type, Icon icon, Color color, int priority) {
return bookmarkManager.defineBookmarkType(type, icon, color, priority);
}
@@ -284,11 +284,11 @@ public class DBTraceProgramViewBookmarkManager implements TraceProgramViewBookma
* {@link IteratorUtils#filteredIterator(Iterator, org.apache.commons.collections4.Predicate)}.
*
* This one understands that the predicate will be testing things of the (possibly
* more-specific) type of elements in the original iterator, not thatof the returned iterator.
* more-specific) type of elements in the original iterator, not that of the returned iterator.
*
* @param it
* @param predicate
* @return
* @param it the iterator
* @param predicate the predicate
* @return the iterator
*/
@SuppressWarnings("unchecked")
protected static <T, U extends T> Iterator<T> filteredIterator(Iterator<U> it,
@@ -18,7 +18,7 @@ package ghidra.trace.model.bookmark;
import java.awt.Color;
import java.util.Collection;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import ghidra.program.model.address.AddressSpace;
import ghidra.trace.model.stack.TraceStackFrame;
@@ -45,7 +45,7 @@ public interface TraceBookmarkManager extends TraceBookmarkOperations {
* the same location
* @return the newly-defined type
*/
TraceBookmarkType defineBookmarkType(String name, ImageIcon icon, Color color, int priority);
TraceBookmarkType defineBookmarkType(String name, Icon icon, Color color, int priority);
/**
* Get the defined bookmark types.
@@ -16,6 +16,7 @@ data/ElfFunctionsThatDoNotReturn||GHIDRA||||END|
data/ExtensionPoint.manifest||GHIDRA||||END|
data/MachOFunctionsThatDoNotReturn||GHIDRA||||END|
data/PEFunctionsThatDoNotReturn||GHIDRA||||END|
data/base.icons.theme.properties||GHIDRA||||END|
data/base.listing.theme.properties||GHIDRA||||END|
data/base.programgraph.theme.properties||GHIDRA||||END|
data/base.theme.properties||GHIDRA||||END|
@@ -1101,6 +1102,7 @@ src/main/resources/images/mem_chip3.png||GHIDRA||reviewed||END|
src/main/resources/images/memory16.gif||GHIDRA||||END|
src/main/resources/images/menu16.gif||GHIDRA||||END|
src/main/resources/images/move.png||GHIDRA||||END|
src/main/resources/images/no_small.png||GHIDRA||||END|
src/main/resources/images/notF.gif||GHIDRA||||END|
src/main/resources/images/notes.gif||GHIDRA||||END|
src/main/resources/images/nuvola/16x16/cdimage.png||Nuvola Icons - LGPL 2.1|||Nuvola icon set|END|
@@ -0,0 +1,399 @@
[Defaults]
icon.base.delete = icon.delete
icon.base.plus = icon.add
icon.base.edit.bytes = editbytes.gif
icon.base.pinned = pin.png
icon.base.hover.off = hoverOff.gif
icon.base.hover.on = hoverOn.gif
icon.base.lock = lock.gif
icon.base.unlock = unlock.gif
icon.base.search.marker = searchm_obj.gif
icon.base.application.home = GhidraIcon16.png
icon.base.application.16 = GhidraIcon16.png
icon.base.application.24 = GhidraIcon24.png
icon.base.application.32 = GhidraIcon32.png
icon.base.application.40 = GhidraIcon40.png
icon.base.application.48 = GhidraIcon48.png
icon.base.application.64 = GhidraIcon64.png
icon.base.application.128 = GhidraIcon128.png
icon.base.application.256 = GhidraIcon256.png
icon.provider.clone = camera-photo.png
icon.plugin.datatypes.built.in = package_development.png
icon.plugin.datatypes.built.in.disabled = package_development.png [disabled]
icon.plugin.datatypes.default = defaultDt.gif
icon.plugin.datatypes.default.disabled = disabledCode.gif
icon.plugin.datatypes.enum = enum.png
icon.plugin.datatypes.pointer = fingerPointer.png
icon.plugin.datatypes.function = functionDef.png
icon.plugin.datatypes.union = cUnion.png
icon.plugin.datatypes.typedef = typedef.png
icon.plugin.datatypes.structure = cstruct.png
icon.plugin.assembler.question = question_zero.png
icon.plugin.bookmark.add = icon.check
icon.plugin.bookmark.delete = icon.base.delete
icon.plugin.bookmark.select = text_align_justify.png
icon.plugin.bookmark.type.note = notes.gif
icon.plugin.bookmark.type.info = icon.information
icon.plugin.bookmark.type.warning = icon.warning
icon.plugin.bookmark.type.error = icon.base.delete
icon.plugin.bookmark.type.analysis = applications-system.png
icon.plugin.bookmark.type.default = unknown.gif
icon.plugin.calltree.provider =
icon.plugin.calltree.function = FunctionScope.gif
icon.plugin.calltree.recursive = arrow_rotate_clockwise.png
icon.plugin.calltree.refresh = icon.refresh
icon.plugin.calltree.refresh.not.needed = icon.plugin.calltree.refresh [disabled]
icon.plugin.calltree.filter.duplicates = application_double.png
icon.plugin.calltree.filter.select.source = text_align_justify.png
icon.plugin.calltree.node.dead.end = stopNode.png
icon.plugin.calltree.node.external = package.png
icon.plugin.checksum.compute = icon.refresh
icon.plugin.checksum.select = NextSelectionBlock16.gif
icon.plugin.checksum.show.hex = hexData.png
icon.plugin.checksum.xor = xor.png
icon.plugin.checksum.carry = carry.png
icon.plugin.checksum.ones.complement = onesComplement.png
icon.plugin.checksum.twos.complement = twosComplement.png
icon.plugin.clipboard.copy = icon.copy
icon.plugin.clipboard.paste = icon.paste
icon.plugin.codebrowser.cursor.location = cursor_arrow_flipped.gif
icon.plugin.codebrowser.cursor.marker = searchm_obj.gif
icon.plugin.codebrowser.format.collapse =field.header.up.png
icon.plugin.codebrowser.format.expand = field.header.down.png
icon.plugin.codebrowser.hover.off = icon.base.hover.off
icon.plugin.codebrowser.hover.on = icon.base.hover.on
icon.plugin.codebrowser.provider = Browser.gif
icon.plugin.codebrowser.mark.and.select.armed = MarkSelection.png {media-playback-start.png[size(12,12)][move(4,4)]}
icon.plugin.codebrowser.mark.and.select.unarmed = MarkSelection.png {media-playback-stop.png[size(12,12)][move(4,4)]}
icon.plugin.composite.editor.provider = accessories-text-editor.png
icon.plugin.composite.editor.provider.structure = icon.plugin.datatypes.structure
icon.plugin.composite.editor.provider.union = cUnion.png
icon.plugin.composite.editor.apply = disk.png
icon.plugin.composite.editor.array = Array.png
icon.plugin.composite.editor.bit.field.dialog.add = icon.base.plus
icon.plugin.composite.editor.bit.field.dialog.delete = icon.base.delete
icon.plugin.composite.editor.bit.field.dialog.edit = move.png
icon.plugin.composite.editor.bit.field.editor.decrement = Minus.png
icon.plugin.composite.editor.bit.field.editor.increment = icon.base.plus
icon.plugin.composite.editor.clear = icon.clear
icon.plugin.composite.editor.create = icon.plugin.datatypes.structure
icon.plugin.composite.editor.delete = icon.base.delete
icon.plugin.composite.editor.duplicate = DuplicateData.png
icon.plugin.composite.editor.duplicate.multiple = MultiDuplicateData.png
icon.plugin.composite.editor.insert.undefined = icon.base.plus
icon.plugin.composite.editor.move.down = down.png
icon.plugin.composite.editor.move.up = up.png
icon.plugin.composite.editor.search.next = go-down.tango.16.png [size(16,16)]
icon.plugin.composite.editor.search.previous = go-up.tango.16.png [size(16,16)]
icon.plugin.composite.editor.show.type = icon.home
icon.plugin.composite.editor.unpackage = Unpackage.gif
icon.plugin.enum.editor.provider = icon.plugin.datatypes.enum
icon.plugin.enum.editor.add = icon.base.plus
icon.plugin.enum.editor.apply = icon.save
icon.plugin.enum.editor.delete = icon.base.delete
icon.plugin.enum.editor.home = icon.home
icon.plugin.console.provider = monitor.png
icon.plugin.console.clear = icon.clear
icon.plugin.console.scroll.lock = lock.png
icon.plugin.datatypes.provider = dataTypes.png
icon.plugin.datatypes.commit.single.type = smallRightArrow.png
icon.plugin.datatypes.associate.single.type = smallLeftArrow.png
icon.plugin.datatypes.conflict.mode.rename.and.add = conflictRename.png
icon.plugin.datatypes.conflict.mode.use.existing = conflictKeep.png
icon.plugin.datatypes.conflict.mode.replace.existing = conflictReplace.png
icon.plugin.datatypes.conflict.mode.replace.or.rename = conflictReplaceOrRename.png
icon.plugin.datatypes.filter.arrays.off = Array.png
icon.plugin.datatypes.filter.arrays.on = FilterArrays.png
icon.plugin.datatypes.filter.pointers.off = fingerPointer.png
icon.plugin.datatypes.filter.pointers.on = FilterPointers.png
icon.plugin.datatypes.archive.built.in.closed = closedBookBrown.png
icon.plugin.datatypes.archive.built.in.open = openBookBrown.png
icon.plugin.datatypes.archive.file.closed = closedBookGreen.png
icon.plugin.datatypes.archive.file.open = openBookGreen.png
icon.plugin.datatypes.archive.invalid =closedFolderInvalid.png
icon.plugin.datatypes.archive.program.closed = closedBookRed.png
icon.plugin.datatypes.archive.program.open = openBookRed.png
icon.plugin.datatypes.archive.project.closed = closedBookBlue.png
icon.plugin.datatypes.archive.project.open = openBookBlue.png
icon.plugin.datatypes.tree.conflict = doubleArrow.png
icon.plugin.datatypes.tree.change.local = smallRightArrow.png
icon.plugin.datatypes.tree.change.source = smallLeftArrow.png
icon.plugin.datatypes.tree.missing = redQuestionMark.png
icon.plugin.datatypes.tree.node.archive.file.checked.out = icon.check
icon.plugin.datatypes.tree.node.archive.file.checked.out.exclusive = checkex.png
icon.plugin.datatypes.tree.node.archive.file.checked.out.not.latest = checkNotLatest.gif
icon.plugin.datatypes.tree.node.archive.file.hijacked = small_hijack.gif
icon.plugin.datatypes.tree.node.archive.file.read.only = user-busy.png [size(10,10)]
icon.plugin.datatypes.util.root = BookShelf.png
icon.plugin.datatypes.util.open.root = BookShelfOpen.png
icon.plugin.datatypes.util.open.archive = openFolderArchive.png
icon.plugin.datatypes.util.open.folder = openFolder.png
icon.plugin.datatypes.util.open.folder.disabled = disabledOpenFolder.png
icon.plugin.datatypes.util.open.folder.locked = openFolderCheckedOut.png
icon.plugin.datatypes.util.closed.archive = closedFolderArchive.png
icon.plugin.datatypes.util.closed.folder = closedFolder.png
icon.plugin.datatypes.util.closed.folder.disabled = disabledClosedFolder.png
icon.plugin.datatypes.util.closed.folder.locked = closedFolderCheckedOut.png
icon.plugin.datatypes.util.favorite = emblem-favorite.png
icon.plugin.datatypes.util.favorite.disabled = emblem-favorite.png [disabled]
icon.plugin.datawindow.provider = dataW.gif
icon.plugin.functiontags.add = 2rightarrow.png [size(16,16)]
icon.plugin.functiontags.remove = 2leftarrow.png [size(16,16)]
icon.plugin.functioncompare.new = page_white_c.png {bullet_star.png [size(16,16)][move(4,-4)]}
icon.plugin.functioncompare.function.next = arrow_down.png [move(3,1)] {FunctionScope.gif [move(-5,-2)]}
icon.plugin.functioncompare.function.previous = arrow_up.png [move(3,1)] {FunctionScope.gif [move(-5,-2)]}
icon.plugin.functioncompare.function.remove = edit-delete.png [move(3,3)] {FunctionScope.gif [move(-5,-2)]}
icon.plugin.functioncompare.open.function.table = page_white_c.png {icon.add [size(10,10)][move(10,10)]}
icon.plugin.functioncompare.scroll.lock = icon.base.lock
icon.plugin.functioncompare.scroll.unlock = icon.base.unlock
icon.plugin.functionwindow.provider = functions.gif
icon.plugin.instructiontable.address = DOSA_A.png
icon.plugin.instructiontable.scalar = DOSA_S.png
icon.plugin.instructiontable.operand = DOSA_O.png
icon.plugin.instructiontable.undefined = DOSA_D.png
icon.plugin.instructiontable.manual.entry = icon.base.edit.bytes
icon.plugin.instructiontable.binary = binaryData.gif
icon.plugin.instructiontable.hex = hexData.png
icon.plugin.interpreter.provider = monitor.png
icon.plugin.locationreferences.highlight = tag_yellow.png
icon.plugin.memorymap.provider = memory16.gif
icon.plugin.memorymap.add = icon.add
icon.plugin.memorymap.move = move.png
icon.plugin.memorymap.split = verticalSplit.png
icon.plugin.memorymap.expand.up = icon.toggle.collapse
icon.plugin.memorymap.expand.down = icon.toggle.expand
icon.plugin.memorymap.merge = Merge.png
icon.plugin.memorymap.delete = icon.delete
icon.plugin.memorymap.image.base = house.png
icon.plugin.merge = Merge.png
icon.plugin.merge.changed = changed16.gif
icon.plugin.merge.conflict.collapse = icon.toggle.collapse
icon.plugin.merge.conflict.expand = icon.toggle.expand
icon.plugin.merge.conflict.lock = lock.gif
icon.plugin.merge.conflict.unlock = unlock.gif
icon.plugin.merge.status.pending = bullet_green.png
icon.plugin.merge.status.in.progress = right.png
icon.plugin.merge.status.complete = checkmark_green.gif
icon.plugin.myprogramchanges.merge = vcMerge.png
icon.plugin.myprogramchanges.checkin = vcCheckIn.png
icon.plugin.navigation.bookmark = B.gif [size(16,16)]
icon.plugin.navigation.bookmark.analysis = applications-system.png
icon.plugin.navigation.bookmark.error = icon.error
icon.plugin.navigation.bookmark.info = icon.information
icon.plugin.navigation.bookmark.note = notes.gif
icon.plugin.navigation.bookmark.warning = icon.warning
icon.plugin.navigation.bookmark.unknown = unknown.gif
icon.plugin.navigation.bytes = V.png
icon.plugin.navigation.data = D.gif
icon.plugin.navigation.function = F.gif
icon.plugin.navigation.instruction = I.gif
icon.plugin.navigation.label = L.gif
icon.plugin.navigation.undefined = U.gif
icon.plugin.navigation.highlight.range.next = NextHighlightBlock16.gif
icon.plugin.navigation.highlight.range.previous = PreviousHighlightBlock16.gif
icon.plugin.navigation.selection.range.next = NextSelectionBlock16.gif
icon.plugin.navigation.selection.range.previous = PreviousSelectionBlock16.gif
icon.plugin.navigation.location.next = icon.right
icon.plugin.navigation.location.previous = icon.left
icon.plugin.bundlemanager.disable = media-playback-stop.png
icon.plugin.bundlemanager.enable = media-playback-start.png
icon.plugin.overview.provider = x-office-document-template.png
icon.plugin.programmanager.empty.small = empty8x16.png
icon.plugin.programmanager.close = x.gif
icon.plugin.programmanager.close.highlight = pinkX.gif
icon.plugin.programmanager.list = VCRFastForward.gif
icon.plugin.programmanager.transient = link.png
icon.plugin.programmanager.busy = icon.base.edit.bytes
icon.plugin.programtree.docs = openBookBlue.png
icon.plugin.programtree.fragment = codeNotInView.gif
icon.plugin.programtree.fragment.empty = emptyFragment.gif
icon.plugin.programtree.fragment.viewed = codeInView.gif
icon.plugin.programtree.fragment.viewed.empty = emptyFragmentInView.gif
icon.plugin.programtree.fragment.closed.folder = closedFolderInView.png
icon.plugin.programtree.fragment.open.folder = openFolderInView.png
icon.plugin.programtree.fragment.viewed.closed.folder.with.description = closedDescendantsInView.png
icon.plugin.programtree.closed.folder = closedFolder.png
icon.plugin.programtree.open.folder = openFolder.png
icon.plugin.programtree.open.tree = icon.folder.open
icon.plugin.programtree.new.tree = layout_add.png
icon.plugin.programtree.drag.copy = dragMoveCursor.gif
icon.plugin.programtree.drag.move = dragCopyCursor.gif
icon.plugin.reachability.provider = function_graph_curvey.png [rotate(90)]
icon.plugin.register = registerIcon.png
icon.plugin.register.group = registerGroup.png
icon.plugin.register.provider = icon.plugin.register.group
icon.plugin.scalartable.provider = dataW.gif
icon.plugin.scriptmanager.provider = play.png
icon.plugin.scriptmanager.run = play.png
icon.plugin.scriptmanager.run.again = play_again.png
icon.plugin.scriptmanager.edit = accessories-text-editor.png
icon.plugin.scriptmanager.edit.eclipse = eclipse.png
icon.plugin.scriptmanager.keybinding = key.png
icon.plugin.scriptmanager.delete = icon.delete
icon.plugin.scriptmanager.rename = icon.rename
icon.plugin.scriptmanager.new = script_add.png
icon.plugin.scriptmanager.manage = text_list_bullets.png
icon.plugin.scriptmanager.api = red-cross.png
icon.plugin.stringtable.provider = kmessedwords.png
icon.plugin.stringtable.defined = font.png
icon.plugin.stringtable.defined.partial = dialog-warning.png
icon.plugin.stringtable.undefined = magnifier.png
icon.plugin.stringtable.words = view-filter.png
icon.plugin.stringtable.conflicts = dialog-warning_red.png
icon.plugin.symboltree.provider = sitemap_color.png
icon.plugin.symboltree.goto = icon.base.search.marker
icon.plugin.symboltree.set.external = icon.base.edit.bytes
icon.plugin.symboltree.node.root = bullet_green.png
icon.plugin.symboltree.node.class = class.png
icon.plugin.symboltree.node.code = label.png
icon.plugin.symboltree.node.code.pinned = icon.base.pinned
icon.plugin.symboltree.node.code.external = ExternalData.gif
icon.plugin.symboltree.node.function = FunctionScope.gif
icon.plugin.symboltree.node.function.external = ExternalFunction.gif
icon.plugin.symboltree.node.function.thunk = ThunkFunction.gif
icon.plugin.symboltree.node.library = package.png
icon.plugin.symboltree.node.local.variable = LocalVariable.gif
icon.plugin.symboltree.node.parameter = Parameter.gif
icon.plugin.symboltree.node.namespace = Namespace.gif
icon.plugin.symboltree.node.organization.closed = closedFolderGroup.png
icon.plugin.symboltree.node.organization.open = openFolderGroup.png
icon.plugin.symboltree.node.category.classes.closed = closedFolderClasses.png
icon.plugin.symboltree.node.category.classes.open = openFolderClasses.png
icon.plugin.symboltree.node.category.function.closed = closedFolderFunctions.png
icon.plugin.symboltree.node.category.function.open = openFolderFunctions.png
icon.plugin.symboltree.node.category.exports.closed = closedFolder.png
icon.plugin.symboltree.node.category.exports.open = openFolder.png
icon.plugin.symboltree.node.category.imports.closed = closedFolderExternals.png
icon.plugin.symboltree.node.category.imports.open = openFolderExternals.png
icon.plugin.symboltree.node.category.label.closed = closedFolderLabels.png
icon.plugin.symboltree.node.category.label.open = openFolderLabels.png
icon.plugin.symboltree.node.category.namespace.closed = closedFolderNamespaces.png
icon.plugin.symboltree.node.category.namespace.open = openFolderNamespaces.png
icon.plugin.symboltree.node.group.folder.closed = closedFolderGroup.png
icon.plugin.symboltree.node.group.folder.open = openFolderGroup.png
icon.plugin.symboltable.provider = table.png
icon.plugin.symboltable.references.to =references_to.gif
icon.plugin.symboltable.instructions.from = I.gif
icon.plugin.symboltable.data.from = D.gif
icon.plugin.symboltable.referencetable.provider = table_go.png
icon.plugin.table.service = magnifier.png
icon.plugin.table.service.marker = icon.base.search.marker
icon.plugin.table.delete.row = table_delete.png
icon.plugin.totd.provider = help-hint.png
icon.plugin.viewstrings.provider = dataW.gif
icon.plugin.debug.dbviewer.provider = zoom.png
icon.plugin.debug.domaineventviewer.provider = monitor.png
icon.plugin.debug.propertymanager.provider = document-properties.png
icon.plugin.debug.propertymanager.marker = searchm_pink.gif
icon.plugin.fsbrowser.copy = icon.copy
icon.plugin.fsbrowser.cut = icon.cut
icon.plugin.fsbrowser.delete = page_delete.png
icon.plugin.fsbrowser.font = icon.font
icon.plugin.fsbrowser.locked = icon.base.lock
icon.plugin.fsbrowser.new = page_add.png
icon.plugin.fsbrowser.paste = icon.paste
icon.plugin.fsbrowser.redo = icon.redo
icon.plugin.fsbrowser.rename = icon.rename
icon.plugin.fsbrowser.refresh = icon.refresh
icon.plugin.fsbrowser.save = icon.save
icon.plugin.fsbrowser.save.as = icon.save.as
icon.plugin.fsbrowser.undo = icon.undo
icon.plugin.fsbrowser.unlocked = icon.base.unlock
icon.plugin.fsbrowser.close = images/famfamfam_silk_icons_v013/door.png
icon.plugin.fsbrowser.collapse.all = images/famfamfam_silk_icons_v013/arrow_in.png
icon.plugin.fsbrowser.compress = images/famfamfam_silk_icons_v013/compress.png
icon.plugin.fsbrowser.create.firmware = media-flash.png
icon.plugin.fsbrowser.expand.all = images/famfamfam_silk_icons_v013/arrow_inout.png
icon.plugin.fsbrowser.extract = package_green.png
icon.plugin.fsbrowser.info = icon.information
icon.plugin.fsbrowser.open = images/famfamfam_silk_icons_v013/door_open.png
icon.plugin.fsbrowser.open.as.binary = images/famfamfam_silk_icons_v013/controller.png
icon.plugin.fsbrowser.open.in.listing = images/famfamfam_silk_icons_v013/folder_table.png
icon.plugin.fsbrowser.open.file.system = images/famfamfam_silk_icons_v013/folder_brick.png
icon.plugin.fsbrowser.photo = images/famfamfam_silk_icons_v013/photo.png
icon.plugin.fsbrowser.view.as.image = images/oxygen/16x16/games-config-background.png
icon.plugin.fsbrowser.view.as.text = format-text-bold.png
icon.plugin.fsbrowser.eclipse = eclipse.png
icon.plugin.fsbrowser.jar = images/famfamfam_silk_icons_v013/page_white_cup.png
icon.plugin.fsbrowser.import = images/famfamfam_silk_icons_v013/application_get.png
icon.plugin.fsbrowser.ios = images/famfamfam_silk_icons_v013/phone.png
icon.plugin.fsbrowser.open.all = images/famfamfam_silk_icons_v013/application_cascade.png
icon.plugin.fsbrowser.list.mounted = downArrow.png
icon.base.util.fixed.bit.size.field = icon.pulldown
icon.base.util.viewer.fieldfactory.label = icon.base.pinned [move(0,4)]
icon.base.util.viewer.fieldfactory.openclose.closed = small_plus.png
icon.base.util.viewer.fieldfactory.openclose.open = small_minus.png
icon.base.util.viewer.fieldfactory.variable = icon.warning
icon.base.util.listingcompare.provider = table_relationship.png
icon.base.util.listingcompare.cursor = cursor_arrow_flipped.gif
icon.base.util.listingcompare.diff.next = view-sort-ascending.png
icon.base.util.listingcompare.previous.next = view-sort-descending.png
icon.base.util.listingcompare.area.markers.all = text_list_bullets.png
icon.base.util.listingcompare.area.markers.unmatched = icon.navigate.in
icon.base.util.listingcompare.area.markers.diff = table_relationship.png
icon.base.util.listingcompare.hover.off = icon.base.hover.off
icon.base.util.listingcompare.hover.on = icon.base.hover.on
icon.base.util.listingdiff.diffs.not = no_small.png
icon.base.util.listingdiff.diffs.byte = binaryData.gif
icon.base.util.listingdiff.diffs.constants = class.png
icon.base.util.listingdiff.diffs.registers = registerGroup.png
icon.base.util.xml.functions.bookmark = imported_bookmark.gif
icon.base.util.datatree.version.control.archive.dt.checkout.undo = vcUndoCheckOut.png
[Dark Defaults]
@@ -159,6 +159,8 @@ color.bg.plugin.windowlocation.window.selected = rgba(0, 255, 0, 200)
color.fg.plugin.windowlocation.window.text = gray
[Dark Defaults]
color.bg = rgb(40, 42, 46) // TODO this should be in a more generic module
@@ -22,7 +22,7 @@ import java.io.PrintStream;
import java.util.HashSet;
import java.util.Set;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import org.apache.commons.lang3.StringUtils;
@@ -40,7 +40,7 @@ import ghidra.program.model.listing.Instruction;
import ghidra.program.model.mem.ByteMemBufferImpl;
import ghidra.program.model.mem.MemBuffer;
import ghidra.util.NumericUtilities;
import resources.ResourceManager;
import resources.Icons;
public class AssemblyThrasherDevScript extends GhidraScript {
public static final String BOOKMARK_FAIL = "AssemblyFailure";
@@ -104,7 +104,7 @@ public class AssemblyThrasherDevScript extends GhidraScript {
clearBackgroundColor(currentProgram.getMemory().getAllInitializedAddressSet());
BookmarkManager bm = currentProgram.getBookmarkManager();
ImageIcon myIcon = ResourceManager.loadImage("images/warning.png");
Icon myIcon = Icons.WARNING_ICON;
bm.defineType(BOOKMARK_FAIL, myIcon, Palette.YELLOW, 0);
bm.removeBookmarks(BOOKMARK_FAIL);
@@ -26,6 +26,7 @@ import docking.options.editor.ButtonPanelFactory;
import docking.util.image.ToolIconURL;
import docking.widgets.OptionDialog;
import docking.widgets.label.*;
import generic.theme.GIcon;
import ghidra.app.context.ListingActionContext;
import ghidra.app.merge.tool.ListingMergePanel;
import ghidra.app.nav.Navigatable;
@@ -36,7 +37,6 @@ import ghidra.framework.plugintool.ComponentProviderAdapter;
import ghidra.program.util.ProgramLocation;
import ghidra.util.HelpLocation;
import ghidra.util.layout.VerticalLayout;
import resources.ResourceManager;
/**
* Component that displays merge components as needed.
@@ -59,7 +59,7 @@ class MergeManagerProvider extends ComponentProviderAdapter {
private JButton cancelButton;
private boolean wasCanceled;
private ImageIcon MERGE_ICON = ResourceManager.loadImage("images/Merge.png");
private Icon MERGE_ICON = new GIcon("icon.plugin.merge");
private JPanel mainPanel;
public MergeManagerProvider(MergeManagerPlugin plugin, String title) {
@@ -17,16 +17,17 @@ package ghidra.app.merge;
import java.awt.BorderLayout;
import java.util.HashMap;
import java.util.Map;
import javax.swing.*;
import javax.swing.border.Border;
import docking.widgets.label.GIconLabel;
import docking.widgets.label.GLabel;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors.Palette;
import ghidra.util.Msg;
import ghidra.util.layout.VerticalLayout;
import resources.ResourceManager;
/**
* The MergeProgressPanel displays the name of each merge phase along with an icon indicating
@@ -34,11 +35,10 @@ import resources.ResourceManager;
*/
public class MergeProgressPanel extends JPanel {
public static ImageIcon DEFINED_ICON = ResourceManager.loadImage("images/bullet_green.png");
public static ImageIcon IN_PROGRESS_ICON = ResourceManager.loadImage("images/right.png");
public static ImageIcon COMPLETED_ICON =
ResourceManager.loadImage("images/checkmark_green.gif");
private HashMap<String, JLabel> imageMap = new HashMap<>();
public static Icon DEFINED_ICON = new GIcon("icon.plugin.merge.status.pending");
public static Icon IN_PROGRESS_ICON = new GIcon("icon.plugin.merge.status.in.progress");
public static Icon COMPLETED_ICON = new GIcon("icon.plugin.merge.status.complete");
private Map<String, JLabel> imageMap = new HashMap<>();
private static int INDENT_IN_PIXELS = 20;
/**
@@ -17,14 +17,12 @@ package ghidra.app.merge;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import docking.widgets.label.GDLabel;
import docking.widgets.label.GIconLabel;
import resources.ResourceManager;
import resources.Icons;
/**
* The PhaseProgressPanel provides a title, progress bar and message for the current phase that is
@@ -33,7 +31,7 @@ import resources.ResourceManager;
public class PhaseProgressPanel extends JPanel {
private final static String DEFAULT_INFO = "Merge programs in progress...";
private ImageIcon INFORM_ICON = ResourceManager.loadImage("images/information.png");
private Icon INFORM_ICON = Icons.INFO_ICON;
private JLabel titleLabel;
private JProgressBar progressBar;
@@ -105,12 +103,7 @@ public class PhaseProgressPanel extends JPanel {
doSetMessage(DEFAULT_INFO);
// Sets up the timer for updating the GUI.
updateTimer = new Timer(250, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
update();
}
});
updateTimer = new Timer(250, e -> update());
}
// Method for use by the timer to update the progress bar or message.
@@ -30,7 +30,7 @@ import ghidra.app.merge.MergeConstants;
import ghidra.app.merge.util.ConflictCountPanel;
import ghidra.framework.data.DomainObjectMergeManager;
import ghidra.program.model.data.*;
import resources.ResourceManager;
import resources.Icons;
/**
* Panel to select a data type in order to resolve a conflict.
@@ -86,9 +86,6 @@ class DataTypeMergePanel extends JPanel {
buttonGroup.add(originalRB);
}
/**
*
*/
int getSelectedOption() {
if (latestRB.isSelected()) {
return DataTypeMergeManager.OPTION_LATEST;
@@ -105,13 +102,10 @@ class DataTypeMergePanel extends JPanel {
private void create() {
buttonGroup = new ButtonGroup();
ItemListener listener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
mergeManager.clearStatusText();
mergeManager.setApplyEnabled(true);
}
ItemListener listener = e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
mergeManager.clearStatusText();
mergeManager.setApplyEnabled(true);
}
};
@@ -180,7 +174,7 @@ class DataTypeMergePanel extends JPanel {
private JPanel createInfoPanel() {
Icon icon = ResourceManager.loadImage("images/information.png");
Icon icon = Icons.INFO_ICON;
JLabel imageLabel = new GIconLabel(icon);
MultiLineLabel label =
@@ -30,7 +30,7 @@ import ghidra.app.merge.MergeConstants;
import ghidra.app.merge.util.ConflictCountPanel;
import ghidra.framework.data.DomainObjectMergeManager;
import ghidra.program.model.data.SourceArchive;
import resources.ResourceManager;
import resources.Icons;
/**
* Panel to select a source archive in order to resolve a conflict.
@@ -104,13 +104,10 @@ class SourceArchiveMergePanel extends JPanel {
private void create() {
buttonGroup = new ButtonGroup();
ItemListener listener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
mergeManager.clearStatusText();
mergeManager.setApplyEnabled(true);
}
ItemListener listener = e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
mergeManager.clearStatusText();
mergeManager.setApplyEnabled(true);
}
};
@@ -175,7 +172,7 @@ class SourceArchiveMergePanel extends JPanel {
private JPanel createInfoPanel() {
Icon icon = ResourceManager.loadImage("images/information.png");
Icon icon = Icons.INFO_ICON;
JLabel imageLabel = new GIconLabel(icon);
MultiLineLabel label = new MultiLineLabel(
@@ -26,6 +26,7 @@ import docking.widgets.button.GRadioButton;
import docking.widgets.fieldpanel.FieldPanel;
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
import docking.widgets.label.GIconLabel;
import generic.theme.GIcon;
import ghidra.app.merge.MergeConstants;
import ghidra.app.merge.MergeManager;
import ghidra.app.merge.util.ConflictCountPanel;
@@ -45,7 +46,6 @@ import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSet;
import ghidra.program.model.listing.Program;
import ghidra.program.model.symbol.ExternalLocation;
import resources.ResourceManager;
import resources.icons.EmptyIcon;
/**
@@ -60,8 +60,8 @@ class ExternalAddConflictPanel extends JPanel implements CodeFormatService {
public static final String MERGE_BOTH_BUTTON_NAME =
ExternalFunctionMerger.MERGE_BOTH_BUTTON_NAME;
private static Icon hideIcon = ResourceManager.loadImage("images/collapse.gif");
private static Icon showIcon = ResourceManager.loadImage("images/expand.gif");
private static final Icon HIDE_ICON = new GIcon("icons.base.listing.conflict.collapse");
private static final Icon SHOW_ICON = new GIcon("icons.base.listing.conflict.expand");
private DomainObjectMergeManager mergeManager;
private int totalConflicts;
@@ -291,18 +291,18 @@ class ExternalAddConflictPanel extends JPanel implements CodeFormatService {
class ShowHeaderButton extends EmptyBorderButton {
ShowHeaderButton() {
super(showIcon);
super(SHOW_ICON);
setFocusable(false);
setToolTipText("Toggle Format Header");
addActionListener(e -> {
if (isSelected()) {
setSelected(false);
setIcon(showIcon);
setIcon(SHOW_ICON);
latestPanel.showHeader(false);
}
else {
setSelected(true);
setIcon(hideIcon);
setIcon(HIDE_ICON);
latestPanel.showHeader(true);
}
});
@@ -28,6 +28,7 @@ import docking.widgets.checkbox.GCheckBox;
import docking.widgets.fieldpanel.FieldPanel;
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
import docking.widgets.fieldpanel.support.BackgroundColorModel;
import generic.theme.GIcon;
import ghidra.app.merge.MergeConstants;
import ghidra.app.nav.Navigatable;
import ghidra.app.plugin.core.codebrowser.hover.*;
@@ -54,12 +55,11 @@ import ghidra.util.datastruct.WeakDataStructureFactory;
import ghidra.util.datastruct.WeakSet;
import ghidra.util.exception.NotYetImplementedException;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
public class ListingMergePanel extends JPanel
implements MergeConstants, FocusListener, CodeFormatService {
private static Icon hideIcon = ResourceManager.loadImage("images/collapse.gif");
private static Icon showIcon = ResourceManager.loadImage("images/expand.gif");
private static final Icon HIDE_ICON = new GIcon("icons.base.listing.conflict.collapse");
private static final Icon SHOW_ICON = new GIcon("icons.base.listing.conflict.expand");
private JComponent topComp;
private JComponent bottomComp;
@@ -297,9 +297,8 @@ public class ListingMergePanel extends JPanel
}
/**
* Color the background of all 4 listings to the indicated color for
* the indicated addresses.
* @param addrSet
* Color the background of all 4 listings to the indicated color for the indicated addresses.
* @param addrSet the addresses
*/
public void paintAllBackgrounds(AddressSetView addrSet) {
backgroundColorModel.setAddressSet(addrSet);
@@ -509,18 +508,18 @@ public class ListingMergePanel extends JPanel
private class ShowHeaderButton extends EmptyBorderButton {
ShowHeaderButton() {
super(showIcon);
super(SHOW_ICON);
setFocusable(false);
setToolTipText("Toggle Format Header");
addActionListener(e -> {
if (isSelected()) {
setSelected(false);
setIcon(showIcon);
setIcon(SHOW_ICON);
listingPanels[RESULT].showHeader(false);
}
else {
setSelected(true);
setIcon(hideIcon);
setIcon(HIDE_ICON);
listingPanels[RESULT].showHeader(true);
}
});
@@ -616,14 +615,12 @@ public class ListingMergePanel extends JPanel
}
class LockComponent extends GCheckBox {
private static final Icon lock = ResourceManager.loadImage("images/lock.gif");
private static final Icon unlock = ResourceManager.loadImage("images/unlock.gif");
LockComponent() {
super(unlock);
super(new GIcon("icon.plugin.merge.conflict.unlock"));
setToolTipText("Lock/Unlock with other views");
setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
setSelectedIcon(lock);
setSelectedIcon(new GIcon("icon.plugin.merge.conflict.lock"));
setSelected(true);
}
@@ -635,26 +632,3 @@ class LockComponent extends GCheckBox {
setSelected(lock);
}
}
/***
// class LockComponent extends ToolbarButton {
// private static final Icon lock = ResourceManager.loadImage("images/lock.gif");
// private static final Icon unlock = ResourceManager.loadImage("images/unlock.gif");
// LockComponent() {
// super(unlock);
// setBorder(BorderFactory.createEmptyBorder(0,2,0,2));
// setSelectedIcon(lock);
// setSelected(true);
// addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// setSelected(!isSelected());
// }
// });
// }
// boolean isLocked() {
// return isSelected();
// }
// void setLocked(boolean lock) {
// setSelected(lock);
// }
// }
***/
@@ -16,7 +16,6 @@
package ghidra.app.merge.tree;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
@@ -27,7 +26,7 @@ import docking.widgets.label.GDLabel;
import docking.widgets.label.GIconLabel;
import ghidra.app.merge.MergeConstants;
import ghidra.program.model.listing.Program;
import resources.ResourceManager;
import resources.Icons;
/**
* Panel to get user input to resolve name conflicts when private name of tree
@@ -129,7 +128,7 @@ class NameConflictsPanel extends JPanel {
iconPanel.setLayout(new BoxLayout(iconPanel, BoxLayout.X_AXIS));
conflictsLabel = new GDLabel("'My' name already exists in Latest Version");
ImageIcon icon = ResourceManager.loadImage("images/information.png");
Icon icon = Icons.INFO_ICON;
iconPanel.add(new GIconLabel(icon));
iconPanel.add(Box.createHorizontalStrut(5));
iconPanel.add(conflictsLabel);
@@ -158,12 +157,9 @@ class NameConflictsPanel extends JPanel {
panel.add(rbPanel, BorderLayout.CENTER);
add(panel);
ItemListener itemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (listener != null) {
listener.stateChanged(null);
}
ItemListener itemListener = e -> {
if (listener != null) {
listener.stateChanged(null);
}
};
keepOtherRB.addItemListener(itemListener);
@@ -21,10 +21,11 @@ import javax.swing.*;
import docking.widgets.label.GDLabel;
import docking.widgets.label.GIconLabel;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors;
import generic.theme.GThemeDefaults.Colors.Messages;
import ghidra.util.layout.PairLayout;
import resources.ResourceManager;
import resources.Icons;
/**
* Panel to show whether tree name and tree structure changed.
@@ -41,9 +42,8 @@ class TreeChangePanel extends JPanel {
private JLabel nameIconLabel;
private JLabel structureIconLabel;
private final static ImageIcon CHANGED_ICON = ResourceManager.loadImage("images/changed16.gif");
private final static ImageIcon NO_CHANGE_ICON =
ResourceManager.loadImage("images/EmptyIcon16.gif");
private final static Icon CHANGED_ICON = new GIcon("icon.plugin.merge.changed");
private final static Icon NO_CHANGE_ICON = Icons.EMPTY_ICON;
private final static Color CHANGED_COLOR = Colors.FOREGROUND;
private final static Color NO_CHANGE_COLOR = Messages.HINT;
@@ -21,6 +21,7 @@ import java.awt.Point;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors.Palette;
import resources.MultiIcon;
import resources.ResourceManager;
@@ -29,8 +30,7 @@ import resources.icons.TranslateIcon;
public class NavigatableIconFactory {
private static final ImageIcon SNAPSHOT_ICON =
ResourceManager.loadImage("images/camera-photo.png");
private static final Icon SNAPSHOT_ICON = new GIcon("icon.provider.clone");
public static ImageIcon createSnapshotOverlayIcon(Icon primaryIcon) {
MultiIcon newOuterIcon = new MultiIcon(primaryIcon);
@@ -28,6 +28,7 @@ import docking.widgets.autocomplete.*;
import docking.widgets.label.GDLabel;
import docking.widgets.textfield.TextFieldLinker;
import generic.theme.GColor;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors;
import ghidra.GhidraApplicationLayout;
import ghidra.GhidraLaunchable;
@@ -43,7 +44,6 @@ import ghidra.program.model.address.Address;
import ghidra.program.model.lang.LanguageID;
import ghidra.program.model.listing.Instruction;
import ghidra.util.NumericUtilities;
import resources.ResourceManager;
/**
* A pair of text fields suitable for guided assembly
@@ -336,7 +336,7 @@ public class AssemblyDualTextField {
@Override
protected void addContent(JPanel content) {
Box controls = Box.createHorizontalBox();
Icon icon = ResourceManager.loadImage("images/question_zero.png");
Icon icon = new GIcon("icon.plugin.assembler.question");
EmptyBorderToggleButton button = new EmptyBorderToggleButton(icon);
button.setToolTipText("Exhaust unspecified bits, otherwise zero them");
button.addActionListener((e) -> {
@@ -17,11 +17,12 @@ package ghidra.app.plugin.core.bookmark;
import java.awt.Color;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import org.apache.commons.lang3.StringUtils;
import generic.theme.GColor;
import generic.theme.GIcon;
import ghidra.app.services.*;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSet;
@@ -29,7 +30,6 @@ import ghidra.program.model.listing.*;
import ghidra.program.util.MarkerLocation;
import ghidra.util.HTMLUtilities;
import ghidra.util.Swing;
import resources.ResourceManager;
/**
* Handles navigation/display of bookmarks in the browser marker margins.
@@ -38,13 +38,12 @@ public class BookmarkNavigator {
private static final int BIG_CHANGE = 1000;
final static ImageIcon NOTE_ICON = ResourceManager.loadImage("images/notes.gif");
final static ImageIcon INFO_ICON = ResourceManager.loadImage("images/information.png");
final static ImageIcon WARNING_ICON = ResourceManager.loadImage("images/warning.png");
final static ImageIcon ERROR_ICON = ResourceManager.loadImage("images/edit-delete.png");
final static ImageIcon ANALYSIS_ICON =
ResourceManager.loadImage("images/applications-system.png");
final static ImageIcon DEFAULT_ICON = ResourceManager.loadImage("images/unknown.gif");
final static Icon NOTE_ICON = new GIcon("icon.plugin.bookmark.type.note");
final static Icon INFO_ICON = new GIcon("icon.plugin.bookmark.type.info");
final static Icon WARNING_ICON = new GIcon("icon.plugin.bookmark.type.warning");
final static Icon ERROR_ICON = new GIcon("icon.plugin.bookmark.type.error");
final static Icon ANALYSIS_ICON = new GIcon("icon.plugin.bookmark.type.analysis");
final static Icon DEFAULT_ICON = new GIcon("icon.plugin.bookmark.type.default");
final static int NOTE_PRIORITY = MarkerService.BOOKMARK_PRIORITY;
final static int ERROR_PRIORITY = MarkerService.BOOKMARK_PRIORITY + BIG_CHANGE;
@@ -81,7 +80,7 @@ public class BookmarkNavigator {
priority = DEFAULT_PRIORITY;
}
ImageIcon icon = bmt.getIcon();
Icon icon = bmt.getIcon();
if (icon == null) {
icon = DEFAULT_ICON;
}
@@ -26,6 +26,7 @@ import docking.Tool;
import docking.action.*;
import docking.actions.PopupActionProvider;
import docking.widgets.table.GTable;
import generic.theme.GIcon;
import ghidra.app.CorePluginPackage;
import ghidra.app.events.ProgramSelectionPluginEvent;
import ghidra.app.plugin.PluginCategoryNames;
@@ -43,7 +44,8 @@ import ghidra.program.util.*;
import ghidra.util.Msg;
import ghidra.util.table.SelectionNavigationAction;
import ghidra.util.task.SwingUpdateManager;
import resources.*;
import resources.Icons;
import resources.MultiIconBuilder;
/**
* Plugin to for adding/deleting/editing bookmarks.
@@ -115,7 +117,7 @@ public class BookmarkPlugin extends ProgramPlugin
tool.addAction(addAction);
MultiIconBuilder builder = new MultiIconBuilder(Icons.CONFIGURE_FILTER_ICON);
builder.addLowerRightIcon(ResourceManager.loadImage("images/check.png"));
builder.addLowerRightIcon(new GIcon("icon.plugin.bookmark.add"));
Icon filterTypesChanged = builder.build();
Icon filterTypesUnchanged = Icons.CONFIGURE_FILTER_ICON;
DockingAction filterAction = new DockingAction("Filter Bookmarks", getName()) {
@@ -150,7 +152,7 @@ public class BookmarkPlugin extends ProgramPlugin
provider.delete();
}
};
Icon icon = ResourceManager.loadImage("images/edit-delete.png");
Icon icon = new GIcon("icon.plugin.bookmark.delete");
deleteAction.setKeyBindingData(new KeyBindingData(KeyEvent.VK_DELETE, 0));
deleteAction.setPopupMenuData(new MenuData(new String[] { "Delete" }, icon));
deleteAction.setDescription("Delete Selected Bookmarks");
@@ -164,7 +166,7 @@ public class BookmarkPlugin extends ProgramPlugin
select(provider.getBookmarkLocations());
}
};
icon = ResourceManager.loadImage("images/text_align_justify.png");
icon = new GIcon("icon.plugin.bookmark.select");
selectionAction.setPopupMenuData(
new MenuData(new String[] { "Select Bookmark Locations" }, icon));
selectionAction.setToolBarData(new ToolBarData(icon));
@@ -49,10 +49,6 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
private JTextField commentTextField;
private JCheckBox selectionCB;
/**
* Creates new CreateBookmarkDialog
*
*/
CreateBookmarkDialog(BookmarkPlugin plugin, CodeUnit cu, boolean hasSelection) {
super(BookmarkType.NOTE + " Bookmark", true, true, true, false);
@@ -71,6 +67,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
setHelpLocation(new HelpLocation("BookmarkPlugin", "CreateBookmarkDialog"));
}
@Override
public void dispose() {
this.plugin = null;
this.program = null;
@@ -202,7 +199,7 @@ public class CreateBookmarkDialog extends DialogComponentProvider {
gbc.anchor = GridBagConstraints.WEST;
mainPanel.add(commentTextField, gbc);
ImageIcon icon = BookmarkNavigator.NOTE_ICON;
Icon icon = BookmarkNavigator.NOTE_ICON;
JLabel imageLabel = new GIconLabel(icon);
imageLabel.setPreferredSize(
new Dimension(icon.getIconWidth() + 20, icon.getIconHeight() + 20));
@@ -23,6 +23,7 @@ import javax.swing.Icon;
import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.MenuData;
import generic.theme.GIcon;
import ghidra.app.CorePluginPackage;
import ghidra.app.context.ListingActionContext;
import ghidra.app.plugin.PluginCategoryNames;
@@ -37,7 +38,6 @@ import ghidra.program.model.symbol.ReferenceManager;
import ghidra.program.util.ProgramLocation;
import ghidra.util.HelpLocation;
import resources.Icons;
import resources.ResourceManager;
/**
* Assuming a function <b>foo</b>, this plugin will show all callers of <b>foo</b> and all
@@ -58,9 +58,8 @@ import resources.ResourceManager;
public class CallTreePlugin extends ProgramPlugin {
static final Icon PROVIDER_ICON = Icons.ARROW_DOWN_RIGHT_ICON;
static final Icon FUNCTION_ICON = ResourceManager.loadImage("images/FunctionScope.gif");
static final Icon RECURSIVE_ICON =
ResourceManager.loadImage("images/arrow_rotate_clockwise.png");
static final Icon FUNCTION_ICON = new GIcon("icon.plugin.calltree.function");
static final Icon RECURSIVE_ICON = new GIcon("icon.plugin.calltree.recursive");
private List<CallTreeProvider> providers = new ArrayList<>();
private DockingAction showCallTreeFromMenuAction;
@@ -33,6 +33,7 @@ import docking.widgets.tree.*;
import docking.widgets.tree.support.GTreeSelectionEvent.EventOrigin;
import docking.widgets.tree.support.GTreeSelectionListener;
import docking.widgets.tree.tasks.GTreeExpandAllTask;
import generic.theme.GIcon;
import ghidra.app.events.ProgramLocationPluginEvent;
import ghidra.app.events.ProgramSelectionPluginEvent;
import ghidra.app.services.GoToService;
@@ -51,18 +52,18 @@ import ghidra.util.exception.CancelledException;
import ghidra.util.task.SwingUpdateManager;
import ghidra.util.task.TaskMonitor;
import resources.Icons;
import resources.ResourceManager;
public class CallTreeProvider extends ComponentProviderAdapter implements DomainObjectListener {
static final String EXPAND_ACTION_NAME = "Fully Expand Selected Nodes";
static final String TITLE = "Function Call Trees";
private static final Icon EMPTY_ICON = ResourceManager.loadImage("images/EmptyIcon16.gif");
private static final Icon EMPTY_ICON = Icons.EMPTY_ICON;
private static final Icon EXPAND_ICON = Icons.EXPAND_ALL_ICON;
private static final Icon COLLAPSE_ICON = Icons.COLLAPSE_ALL_ICON;
private static Icon REFRESH_ICON = Icons.REFRESH_ICON;
private static Icon REFRESH_NOT_NEEDED_ICON = ResourceManager.getDisabledIcon(REFRESH_ICON, 60);
private static Icon REFRESH_ICON = new GIcon("icon.plugin.calltree.refresh");
private static Icon REFRESH_NOT_NEEDED_ICON =
new GIcon("icon.plugin.calltree.refresh.not.needed");
private static final String RECURSE_DEPTH_PROPERTY_NAME = "call.tree.recurse.depth";
private static final String DEFAULT_RECURSE_DEPTH = "5";
@@ -365,9 +366,9 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
doUpdate();
}
};
filterDuplicates.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/application_double.png"),
filterOptionsToolbarGroup, "1"));
filterDuplicates
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.calltree.filter.duplicates"),
filterOptionsToolbarGroup, "1"));
filterDuplicates.setSelected(true);
filterDuplicates
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Filter"));
@@ -503,7 +504,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
return true;
}
};
ImageIcon icon = ResourceManager.loadImage("images/text_align_justify.png");
Icon icon = new GIcon("icon.plugin.calltree.filter.select.source");
selectSourceAction.setPopupMenuData(
new MenuData(new String[] { "Select Call Source" }, icon, selectionMenuGroup));
selectSourceAction.setHelpLocation(
@@ -581,8 +582,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
return currentFunction != null;
}
};
homeAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/go-home.png"), homeToolbarGroup));
homeAction.setToolBarData(new ToolBarData(Icons.HOME_ICON, homeToolbarGroup));
homeAction.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Home"));
tool.addLocalAction(this, homeAction);
@@ -15,6 +15,14 @@
*/
package ghidra.app.plugin.core.calltree;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.Icon;
import docking.widgets.tree.GTreeNode;
import generic.theme.GIcon;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Function;
import ghidra.program.model.listing.Program;
@@ -23,18 +31,9 @@ import ghidra.program.util.ProgramLocation;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.Icon;
import resources.ResourceManager;
import docking.widgets.tree.GTreeNode;
public class DeadEndNode extends CallNode {
private static final Icon ICON = ResourceManager.loadImage("images/stopNode.png");
private static final Icon ICON = new GIcon("icon.plugin.calltree.node.dead.end");
private final Reference reference;
private String name;
@@ -100,6 +99,6 @@ public class DeadEndNode extends CallNode {
@Override
public List<GTreeNode> generateChildren(TaskMonitor monitor) throws CancelledException {
return new ArrayList<GTreeNode>();
return new ArrayList<>();
}
}
@@ -22,6 +22,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import javax.swing.Icon;
import docking.widgets.tree.GTreeNode;
import generic.theme.GIcon;
import ghidra.program.model.address.Address;
import ghidra.program.model.listing.Function;
import ghidra.program.util.FunctionSignatureFieldLocation;
@@ -29,12 +30,11 @@ import ghidra.program.util.ProgramLocation;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
import resources.MultiIcon;
import resources.ResourceManager;
import resources.icons.TranslateIcon;
public class ExternalCallNode extends CallNode {
private static final Icon EXTERNAL_ICON = ResourceManager.loadImage("images/package.png");
private static final Icon EXTERNAL_ICON = new GIcon("icon.plugin.calltree.node.external");
private final Icon EXTERNAL_FUNCTION_ICON;
private final Icon baseIcon;
@@ -77,7 +77,7 @@ public class ExternalCallNode extends CallNode {
@Override
public List<GTreeNode> generateChildren(TaskMonitor monitor) throws CancelledException {
return new ArrayList<GTreeNode>();
return new ArrayList<>();
}
@Override
@@ -24,6 +24,7 @@ import javax.swing.*;
import docking.ActionContext;
import docking.action.*;
import docking.widgets.label.GDLabel;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors;
import ghidra.app.context.ProgramContextAction;
import ghidra.framework.plugintool.ComponentProviderAdapter;
@@ -31,8 +32,6 @@ import ghidra.util.HelpLocation;
import ghidra.util.classfinder.ClassSearcher;
import ghidra.util.table.GhidraTable;
import ghidra.util.task.TaskLauncher;
import resources.Icons;
import resources.ResourceManager;
/**
* Provider to invoke computation of various checksums and display them in a table.
@@ -233,7 +232,8 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
};
computeAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "compute"));
computeAction.setEnabled(true);
computeAction.setToolBarData(new ToolBarData(Icons.REFRESH_ICON, null));
computeAction
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.checksum.compute"), null));
computeAction.setDescription("Refreshes checksums");
selectionAction = new ToggleDockingAction("On Selection", plugin.getName()) {
@@ -251,7 +251,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
selectionAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "On_Selection"));
selectionAction.setEnabled(plugin.hasSelection());
selectionAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/NextSelectionBlock16.gif"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.select"), null));
selectionAction.setDescription("When toggled, generates checksums on " +
"selection. Otherwise checksums are generated over the entire program");
@@ -269,7 +269,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
showHexAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "As_Hex"));
showHexAction.setEnabled(true);
showHexAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/hexData.png"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.show.hex"), null));
showHexAction.setDescription("Toggle to show the hex values instead of decimal values.");
xorAction = new ToggleDockingAction("XOR Checksum Values", plugin.getName()) {
@@ -289,7 +289,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
xorAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "xor"));
xorAction.setEnabled(true);
xorAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/xor.png"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.xor"), null));
xorAction.setDescription("Toggle to recompute values with a xor operation.");
carryAction = new ToggleDockingAction("Carry Checksum Values", plugin.getName()) {
@@ -310,7 +310,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
carryAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "carry"));
carryAction.setEnabled(true);
carryAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/carry.png"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.carry"), null));
carryAction.setDescription("Toggle to recompute values with a carry operation.");
onesCompAction = new ToggleDockingAction("Ones Complement", plugin.getName()) {
@@ -330,7 +330,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
onesCompAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "ones_comp"));
onesCompAction.setEnabled(true);
onesCompAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/onesComplement.png"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.ones.complement"), null));
onesCompAction.setDescription("Toggle to recompute values with a one's complement.");
twosCompAction = new ToggleDockingAction("Twos Complement", plugin.getName()) {
@@ -350,7 +350,7 @@ public class ComputeChecksumsProvider extends ComponentProviderAdapter {
twosCompAction.setHelpLocation(new HelpLocation("ComputeChecksumsPlugin", "twos_comp"));
twosCompAction.setEnabled(true);
twosCompAction.setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/twosComplement.png"), null));
new ToolBarData(new GIcon("icon.plugin.checksum.twos.complement"), null));
twosCompAction.setDescription("Toggle to recompute values with a two's complement.");
tool.addLocalAction(this, onesCompAction);
@@ -29,6 +29,7 @@ import javax.swing.event.ChangeListener;
import docking.*;
import docking.action.*;
import docking.dnd.GClipboard;
import generic.theme.GIcon;
import ghidra.app.CorePluginPackage;
import ghidra.app.context.ListingActionContext;
import ghidra.app.plugin.PluginCategoryNames;
@@ -43,7 +44,6 @@ import ghidra.program.model.listing.Program;
import ghidra.util.HelpLocation;
import ghidra.util.Msg;
import ghidra.util.task.*;
import resources.ResourceManager;
//@formatter:off
@PluginInfo(
@@ -361,7 +361,7 @@ public class ClipboardPlugin extends ProgramPlugin implements ClipboardOwner, Cl
this.clipboardService = clipboardService;
setPopupMenuData(new MenuData(new String[] { "Copy" }, "Clipboard"));
setToolBarData(new ToolBarData(ResourceManager.loadImage("images/page_white_copy.png"),
setToolBarData(new ToolBarData(new GIcon("icon.plugin.clipboard.copy"),
"Clipboard"));
setKeyBindingData(new KeyBindingData(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK));
setHelpLocation(new HelpLocation("ClipboardPlugin", "Copy"));
@@ -395,7 +395,7 @@ public class ClipboardPlugin extends ProgramPlugin implements ClipboardOwner, Cl
setPopupMenuData(new MenuData(new String[] { "Paste" }, "Clipboard"));
setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/page_paste.png"), "Clipboard"));
new ToolBarData(new GIcon("icon.plugin.clipboard.paste"), "Clipboard"));
setKeyBindingData(new KeyBindingData(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK));
setHelpLocation(new HelpLocation("ClipboardPlugin", "Paste"));
}
@@ -20,7 +20,7 @@ import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
@@ -31,6 +31,7 @@ import docking.widgets.fieldpanel.field.Field;
import docking.widgets.fieldpanel.support.FieldLocation;
import docking.widgets.fieldpanel.support.FieldSelection;
import generic.theme.GColor;
import generic.theme.GIcon;
import ghidra.GhidraOptions;
import ghidra.app.events.ProgramHighlightPluginEvent;
import ghidra.app.events.ProgramSelectionPluginEvent;
@@ -56,7 +57,6 @@ import ghidra.program.model.listing.Program;
import ghidra.program.util.ProgramLocation;
import ghidra.program.util.ProgramSelection;
import ghidra.util.*;
import resources.ResourceManager;
public abstract class AbstractCodeBrowserPlugin<P extends CodeViewerProvider> extends Plugin
implements CodeViewerService, CodeFormatService, OptionsChangeListener, FormatModelListener,
@@ -74,8 +74,8 @@ public abstract class AbstractCodeBrowserPlugin<P extends CodeViewerProvider> ex
//@formatter:on
// - Icon -
private ImageIcon CURSOR_LOC_ICON =
ResourceManager.loadImage("images/cursor_arrow_flipped.gif");
private static final Icon CURSOR_LOC_ICON =
new GIcon("icon.plugin.codebrowser.cursor.location");
protected final P connectedProvider;
protected List<P> disconnectedProviders = new ArrayList<>();
protected FormatManager formatMgr;
@@ -15,10 +15,11 @@
*/
package ghidra.app.plugin.core.codebrowser;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import docking.action.builder.ActionBuilder;
import docking.tool.ToolConstants;
import generic.theme.GIcon;
import ghidra.GhidraOptions;
import ghidra.app.CorePluginPackage;
import ghidra.app.plugin.PluginCategoryNames;
@@ -38,7 +39,6 @@ import ghidra.util.datastruct.Accumulator;
import ghidra.util.exception.CancelledException;
import ghidra.util.table.*;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
/**
* Plugin for adding some basic selection actions for Code Browser Listings.
@@ -129,7 +129,7 @@ public class CodeBrowserSelectionPlugin extends Plugin {
GhidraProgramTableModel<Address> model = createTableModel(program, codeUnits, selection);
String title = "Selection Table";
ImageIcon markerIcon = ResourceManager.loadImage("images/searchm_obj.gif");
Icon markerIcon = new GIcon("icon.plugin.codebrowser.cursor.marker");
TableComponentProvider<Address> tableProvider =
tableService.showTableWithMarkers(title + " " + model.getName(), "Selection",
model, PluginConstants.SEARCH_HIGHLIGHT_COLOR, markerIcon, title, null);
@@ -37,6 +37,7 @@ import docking.widgets.fieldpanel.FieldPanel;
import docking.widgets.fieldpanel.HoverHandler;
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
import docking.widgets.fieldpanel.support.*;
import generic.theme.GIcon;
import ghidra.app.nav.*;
import ghidra.app.plugin.core.clipboard.CodeBrowserClipboardProvider;
import ghidra.app.plugin.core.codebrowser.actions.*;
@@ -56,7 +57,6 @@ import ghidra.program.model.listing.*;
import ghidra.program.util.*;
import ghidra.util.HelpLocation;
import ghidra.util.Swing;
import resources.ResourceManager;
public class CodeViewerProvider extends NavigatableComponentProviderAdapter
implements ProgramLocationListener, ProgramSelectionListener, Draggable, Droppable,
@@ -67,12 +67,12 @@ public class CodeViewerProvider extends NavigatableComponentProviderAdapter
private static final String TITLE = NAME + ": ";
private static final Icon LISTING_FORMAT_EXPAND_ICON =
ResourceManager.loadImage("images/field.header.down.png");
new GIcon("icon.plugin.codebrowser.format.expand");
private static final Icon LISTING_FORMAT_COLLAPSE_ICON =
ResourceManager.loadImage("images/field.header.up.png");
new GIcon("icon.plugin.codebrowser.format.collapse");
private static final Icon HOVER_ON_ICON = ResourceManager.loadImage("images/hoverOn.gif");
private static final Icon HOVER_OFF_ICON = ResourceManager.loadImage("images/hoverOff.gif");
private static final Icon HOVER_ON_ICON = new GIcon("icon.plugin.codebrowser.hover.on");
private static final Icon HOVER_OFF_ICON = new GIcon("icon.plugin.codebrowser.hover.off");
private static final String HOVER_MODE = "Hover Mode";
private static final String DIVIDER_LOCATION = "DividerLocation";
@@ -130,7 +130,7 @@ public class CodeViewerProvider extends NavigatableComponentProviderAdapter
ComponentProvider.registerProviderNameOwnerChange(OLD_NAME, owner, NAME, owner);
setConnected(isConnected);
setIcon(ResourceManager.loadImage("images/Browser.gif"));
setIcon(new GIcon("icon.plugin.codebrowser.provider"));
if (!isConnected) {
setTransient();
}
@@ -16,11 +16,11 @@
package ghidra.app.plugin.core.codebrowser;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import docking.ActionContext;
import docking.action.*;
import docking.tool.ToolConstants;
import generic.theme.GIcon;
import ghidra.app.context.NavigatableActionContext;
import ghidra.app.nav.Navigatable;
import ghidra.app.util.HelpTopics;
@@ -28,8 +28,6 @@ import ghidra.program.model.address.Address;
import ghidra.program.util.ProgramLocation;
import ghidra.program.util.ProgramSelection;
import ghidra.util.HelpLocation;
import resources.MultiIconBuilder;
import resources.ResourceManager;
/**
* Actions for creating a selection using two distinct steps. The first time the action
@@ -61,17 +59,8 @@ public class MarkAndSelectionAction extends ToggleDockingAction {
}
private void buildIcons() {
ImageIcon baseImage = ResourceManager.loadImage("images/MarkSelection.png");
ImageIcon mediaStart = ResourceManager.loadImage("images/media-playback-start.png");
ImageIcon mediaStop = ResourceManager.loadImage("images/media-playback-stop.png");
MultiIconBuilder builder = new MultiIconBuilder(baseImage);
builder.addLowerRightIcon(mediaStart, 12, 12);
unarmedIcon = builder.build();
builder = new MultiIconBuilder(baseImage);
builder.addLowerRightIcon(mediaStop, 12, 12);
armedIcon = builder.build();
unarmedIcon = new GIcon("icon.plugin.codebrowser.mark.and.select.unarmed");
armedIcon = new GIcon("icon.plugin.codebrowser.mark.and.select.armed");
}
@Override
@@ -15,19 +15,17 @@
*/
package ghidra.app.plugin.core.codebrowser.actions;
import ghidra.app.context.ProgramActionContext;
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
import ghidra.util.HelpLocation;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import resources.ResourceManager;
import docking.ActionContext;
import docking.action.*;
import generic.theme.GIcon;
import ghidra.app.context.ProgramActionContext;
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
import ghidra.util.HelpLocation;
public class CloneCodeViewerAction extends DockingAction {
@@ -36,27 +34,26 @@ public class CloneCodeViewerAction extends DockingAction {
public CloneCodeViewerAction(String owner, CodeViewerProvider provider) {
super("Code Viewer Clone", owner);
this.provider = provider;
ImageIcon image = ResourceManager.loadImage("images/camera-photo.png");
setToolBarData( new ToolBarData( image, "zzzz" ) );
Icon image = new GIcon("icon.provider.clone");
setToolBarData(new ToolBarData(image, "zzzz"));
setDescription("Create a snapshot (disconnected) copy of this Listing window ");
setHelpLocation(new HelpLocation("Snapshots", "Snapshots_Start"));
setKeyBindingData( new KeyBindingData( KeyEvent.VK_T,
InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK ) );
setKeyBindingData(new KeyBindingData(KeyEvent.VK_T,
InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK));
}
@Override
public boolean isEnabledForContext( ActionContext context ) {
public boolean isEnabledForContext(ActionContext context) {
if (context instanceof ProgramActionContext) {
ProgramActionContext programContext = (ProgramActionContext)context;
ProgramActionContext programContext = (ProgramActionContext) context;
return programContext.getProgram() != null;
}
return false;
}
@Override
public void actionPerformed(ActionContext context) {
provider.cloneWindow();
}
}
@@ -15,12 +15,12 @@
*/
package ghidra.app.plugin.core.compositeeditor;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import docking.ActionContext;
import generic.theme.GIcon;
import ghidra.app.util.datatype.EmptyCompositeException;
import ghidra.program.model.data.InvalidDataTypeException;
import resources.ResourceManager;
/**
* ApplyAction is an action for applying editor changes.
@@ -29,7 +29,7 @@ public class ApplyAction extends CompositeEditorTableAction {
public final static String ACTION_NAME = "Apply Editor Changes";
private final static String GROUP_NAME = BASIC_ACTION_GROUP;
private final static ImageIcon ICON = ResourceManager.loadImage("images/disk.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.apply");
private final static String[] POPUP_PATH = new String[] { "Apply Edits" };
public ApplyAction(CompositeEditorProvider provider) {
@@ -17,13 +17,13 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.util.exception.UsrException;
import resources.ResourceManager;
/**
* Action for use in the composite data type editor.
@@ -31,7 +31,7 @@ import resources.ResourceManager;
*/
public class ArrayAction extends CompositeEditorTableAction {
private final static ImageIcon ICON = ResourceManager.loadImage("images/Array.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.array");
public final static String ACTION_NAME = "Create Array";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Create an array";
@@ -23,16 +23,18 @@ import docking.*;
import docking.action.*;
import docking.menu.DockingCheckboxMenuItemUI;
import docking.widgets.OptionDialog;
import generic.theme.GIcon;
import ghidra.app.services.DataTypeManagerService;
import ghidra.program.model.data.*;
import ghidra.util.HelpLocation;
import resources.ResourceManager;
public class BitFieldEditorDialog extends DialogComponentProvider {
private static final Icon ADD_ICON = ResourceManager.loadImage("images/Plus.png");
private static final Icon EDIT_ICON = ResourceManager.loadImage("images/move.png");
private static final Icon DELETE_ICON = ResourceManager.loadImage("images/edit-delete.png");
//@formatter:off
private static final Icon ADD_ICON = new GIcon("icon.plugin.composite.editor.bit.field.dialog.add");
private static final Icon EDIT_ICON = new GIcon("icon.plugin.composite.editor.bit.field.dialog.edit");
private static final Icon DELETE_ICON = new GIcon("icon.plugin.composite.editor.bit.field.dialog.delete");
//@formatter:on
private DataTypeManagerService dtmService;
private Composite composite;
@@ -28,6 +28,7 @@ import docking.ActionContext;
import docking.widgets.DropDownSelectionTextField;
import docking.widgets.OptionDialog;
import docking.widgets.label.GDLabel;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors;
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitAttributes;
import ghidra.app.plugin.core.compositeeditor.BitFieldPlacementComponent.BitFieldAllocation;
@@ -38,7 +39,6 @@ import ghidra.program.model.data.*;
import ghidra.program.model.data.Composite;
import ghidra.util.data.DataTypeParser.AllowedDataTypes;
import ghidra.util.layout.*;
import resources.ResourceManager;
/**
* <code>BitFieldEditorPanel</code> provides the ability to add or modify bitfields
@@ -46,8 +46,10 @@ import resources.ResourceManager;
*/
public class BitFieldEditorPanel extends JPanel {
private static final Icon DECREMENT_ICON = ResourceManager.loadImage("images/Minus.png");
private static final Icon INCREMENT_ICON = ResourceManager.loadImage("images/Plus.png");
//@formatter:off
private static final Icon DECREMENT_ICON = new GIcon("icon.plugin.composite.editor.bit.field.editor.decrement");
private static final Icon INCREMENT_ICON = new GIcon("icon.plugin.composite.editor.bit.field.editor.increment");
//@formatter:on
private DataTypeManagerService dtmService;
private Composite composite;
@@ -17,20 +17,19 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import ghidra.util.Msg;
import generic.theme.GIcon;
import ghidra.util.exception.UsrException;
import resources.ResourceManager;
public class ClearAction extends CompositeEditorTableAction {
public final static String ACTION_NAME = "Clear Components";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static ImageIcon ICON = ResourceManager.loadImage("images/erase16.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.clear");
private final static String[] POPUP_PATH = new String[] { "Clear" };
private final static KeyStroke KEY_STROKE = KeyStroke.getKeyStroke(KeyEvent.VK_C, 0);
@@ -47,10 +46,6 @@ public class ClearAction extends CompositeEditorTableAction {
try {
model.clearSelectedComponents();
}
catch (OutOfMemoryError memExc) {
String errMsg = "Couldn't clear components. Out of memory.";
Msg.showError(this, null, "Out of Memory", errMsg, memExc);
}
catch (UsrException ue) {
model.setStatus(ue.getMessage());
}
@@ -22,6 +22,7 @@ import javax.swing.*;
import docking.ActionContext;
import docking.ComponentProvider;
import docking.widgets.OptionDialog;
import generic.theme.GIcon;
import ghidra.app.context.ProgramActionContext;
import ghidra.app.services.DataTypeManagerService;
import ghidra.app.util.datatype.EmptyCompositeException;
@@ -33,7 +34,6 @@ import ghidra.util.HelpLocation;
import ghidra.util.datastruct.WeakDataStructureFactory;
import ghidra.util.datastruct.WeakSet;
import ghidra.util.exception.AssertException;
import resources.ResourceManager;
/**
* Editor provider for a Composite Data Type.
@@ -41,8 +41,7 @@ import resources.ResourceManager;
public abstract class CompositeEditorProvider extends ComponentProviderAdapter
implements EditorProvider, EditorActionListener {
protected static final ImageIcon EDITOR_ICON =
ResourceManager.loadImage("images/accessories-text-editor.png");
protected static final Icon EDITOR_ICON = new GIcon("icon.plugin.composite.editor.provider");
protected Plugin plugin;
protected Category category;
@@ -56,9 +55,6 @@ public abstract class CompositeEditorProvider extends ComponentProviderAdapter
/**
* Construct a new stack editor provider.
* @param plugin owner of this provider
* @param program program for data type; may be null if data type
* is part of an archive
* @param stack the stack frame to be edited
*/
protected CompositeEditorProvider(Plugin plugin) {
super(plugin.getTool(), "Composite Editor", plugin.getName());
@@ -283,6 +279,7 @@ public abstract class CompositeEditorProvider extends ComponentProviderAdapter
/**
* Prompts the user if the editor has unsaved changes. Saves the changes if
* the user indicates to do so.
* @param allowCancel true if allowed to cancel
* @return 0 if the user canceled; 1 if the user saved changes;
* 2 if the user did not to save changes; 3 if there was an error when
* the changes were applied.
@@ -17,15 +17,15 @@ package ghidra.app.plugin.core.compositeeditor;
import java.util.Arrays;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import docking.ActionContext;
import generic.theme.GIcon;
import ghidra.util.Swing;
import ghidra.util.exception.CancelledException;
import ghidra.util.exception.UsrException;
import ghidra.util.task.TaskLauncher;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
/**
* Action for use in the structure data type editor.
@@ -33,8 +33,7 @@ import resources.ResourceManager;
*/
public class CreateInternalStructureAction extends CompositeEditorTableAction {
private final static ImageIcon ICON =
ResourceManager.loadImage("images/cstruct.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.create");
public final static String ACTION_NAME = "Create Structure From Selection";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION =
@@ -17,22 +17,22 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.util.exception.CancelledException;
import ghidra.util.exception.UsrException;
import ghidra.util.task.TaskLauncher;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
public class DeleteAction extends CompositeEditorTableAction {
public final static String ACTION_NAME = "Delete Components";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static ImageIcon ICON = ResourceManager.loadImage("images/edit-delete.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.delete");
private final static String[] popupPath = new String[] { "Delete" };
private final static KeyStroke KEY_STROKE = KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0);
@@ -18,21 +18,21 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.util.exception.UsrException;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
/**
* Action to duplicate the selected row
*/
public class DuplicateAction extends CompositeEditorTableAction {
private final static ImageIcon ICON = ResourceManager.loadImage("images/DuplicateData.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.duplicate");
public final static String ACTION_NAME = "Duplicate Component";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Duplicate the selected component";
@@ -18,26 +18,26 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import docking.widgets.dialogs.NumberInputDialog;
import generic.theme.GIcon;
import ghidra.util.HelpLocation;
import ghidra.util.exception.CancelledException;
import ghidra.util.exception.UsrException;
import ghidra.util.task.TaskLauncher;
import ghidra.util.task.TaskMonitor;
import resources.ResourceManager;
/**
* Action that allows the user to make multiple duplicates of the selected item
*/
public class DuplicateMultipleAction extends CompositeEditorTableAction {
private final static ImageIcon ICON =
ResourceManager.loadImage("images/MultiDuplicateData.png");
private final static Icon ICON =
new GIcon("icon.plugin.composite.editor.duplicate.multiple");
public final static String ACTION_NAME = "Duplicate Multiple of Component";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Duplicate multiple of the selected component";
@@ -18,14 +18,14 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.program.model.data.*;
import ghidra.util.exception.UsrException;
import resources.ResourceManager;
/**
* Action for use in the structure data type editor.
@@ -33,8 +33,7 @@ import resources.ResourceManager;
*/
public class InsertUndefinedAction extends CompositeEditorTableAction {
private final static ImageIcon ICON =
ResourceManager.loadImage("images/Plus.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.insert.undefined");
public final static String ACTION_NAME = "Insert Undefined Byte";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Insert an undefined byte before the selection";
@@ -18,13 +18,13 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.util.exception.UsrException;
import resources.ResourceManager;
/**
* Action for use in the composite data type editor.
@@ -32,7 +32,7 @@ import resources.ResourceManager;
*/
public class MoveDownAction extends CompositeEditorTableAction {
private final static ImageIcon ICON = ResourceManager.loadImage("images/down.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.move.down");
public final static String ACTION_NAME = "Move Components Down";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Move the selected components down";
@@ -18,13 +18,13 @@ package ghidra.app.plugin.core.compositeeditor;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import generic.theme.GIcon;
import ghidra.util.exception.UsrException;
import resources.ResourceManager;
/**
* Action for use in the composite data type editor.
@@ -32,7 +32,7 @@ import resources.ResourceManager;
*/
public class MoveUpAction extends CompositeEditorTableAction {
private final static ImageIcon ICON = ResourceManager.loadImage("images/up.png");
private final static Icon ICON = new GIcon("icon.plugin.composite.editor.move.up");
public final static String ACTION_NAME = "Move Components Up";
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Move selected components up";
@@ -25,14 +25,12 @@ import javax.swing.event.DocumentListener;
import docking.widgets.EmptyBorderButton;
import docking.widgets.label.GLabel;
import resources.ResourceManager;
import generic.theme.GIcon;
public class SearchControlPanel extends JPanel {
private static final Icon NEXT_ICON = ResourceManager.getScaledIcon(
ResourceManager.loadImage("images/go-down.tango.16.png"), 16, 16);
private static final Icon PREV_ICON = ResourceManager.getScaledIcon(
ResourceManager.loadImage("images/go-up.tango.16.png"), 16, 16);
private static final Icon NEXT_ICON = new GIcon("icon.plugin.composite.editor.search.next");
private static final Icon PREV_ICON = new GIcon("icon.plugin.composite.editor.search.previous");
private CompositeEditorPanel editorPanel;
private JTextField textField;
@@ -19,9 +19,9 @@ import javax.swing.Icon;
import docking.ActionContext;
import docking.action.ToolBarData;
import generic.theme.GIcon;
import ghidra.app.services.DataTypeManagerService;
import ghidra.program.model.data.*;
import resources.ResourceManager;
/**
* Shows the editor's data type in the UI using the {@link DataTypeManagerService}.
@@ -31,14 +31,13 @@ public class ShowDataTypeInTreeAction extends CompositeEditorTableAction {
// This action should go after the row-based actions, which have this group:
// 3_COMPONENT_EDITOR_ACTION
private static final String TOOLBAR_GROUP = "4_COMPONENT_EDITOR_ACTION";
private static final Icon ICON = ResourceManager.loadImage("images/go-home.png");
private static final Icon ICON = new GIcon("icon.plugin.composite.editor.show.type");
public ShowDataTypeInTreeAction(CompositeEditorProvider provider) {
super(provider, "Show In Data Type Manager", TOOLBAR_GROUP, null /*popupPath*/,
null /*menuPath*/, ICON);
setToolBarData(
new ToolBarData(ResourceManager.loadImage("images/go-home.png"), TOOLBAR_GROUP));
setToolBarData(new ToolBarData(ICON, TOOLBAR_GROUP));
}
@Override
@@ -15,19 +15,19 @@
*/
package ghidra.app.plugin.core.compositeeditor;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import generic.theme.GIcon;
import ghidra.framework.plugintool.Plugin;
import ghidra.program.model.data.Structure;
import resources.ResourceManager;
/**
* Editor for a Structure Data Type.
*/
public class StructureEditorProvider extends CompositeEditorProvider {
protected static final ImageIcon STRUCTURE_EDITOR_ICON =
ResourceManager.loadImage("images/cstruct.png");
protected static final Icon STRUCTURE_EDITOR_ICON =
new GIcon("icon.plugin.composite.editor.provider.structure");
public StructureEditorProvider(Plugin plugin, Structure structureDataType,
boolean showHexNumbers) {
@@ -15,19 +15,19 @@
*/
package ghidra.app.plugin.core.compositeeditor;
import javax.swing.ImageIcon;
import javax.swing.Icon;
import generic.theme.GIcon;
import ghidra.framework.plugintool.Plugin;
import ghidra.program.model.data.Union;
import resources.ResourceManager;
/**
* Editor for a Union Data Type.
*/
public class UnionEditorProvider extends CompositeEditorProvider {
protected static final ImageIcon UNION_EDITOR_ICON =
ResourceManager.loadImage("images/cUnion.png");
protected static final Icon UNION_EDITOR_ICON =
new GIcon("icon.plugin.composite.editor.provider.union");
public UnionEditorProvider(Plugin plugin, Union unionDataType, boolean showInHex) {
super(plugin);

Some files were not shown because too many files have changed in this diff Show More