mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GT-3495 - Refactor tool hierarchy to remove old 'Tool'
GT-3495 - GT-3495 - Refactor tool hierarchy to rename DockingTool to Tool
This commit is contained in:
parent
5dc7df71b3
commit
0ff6578d2c
92 changed files with 966 additions and 1228 deletions
|
@ -17,7 +17,6 @@ package ghidra.test;
|
|||
|
||||
import java.awt.Window;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -34,18 +33,20 @@ import docking.util.image.ToolIconURL;
|
|||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.options.ToolOptions;
|
||||
import ghidra.framework.plugintool.PluginEvent;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginClassManager;
|
||||
import ghidra.framework.plugintool.util.ServiceListener;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
||||
public class DummyTool implements Tool {
|
||||
public class DummyTool extends PluginTool {
|
||||
private final static String DEFAULT_NAME = "untitled";
|
||||
private String name = DEFAULT_NAME;
|
||||
private String instanceName;
|
||||
private String description;
|
||||
private ToolIconURL iconURL;
|
||||
private ToolIconURL dummyIconUrl;
|
||||
private Project project;
|
||||
|
||||
private DockingToolActions toolActions = new DummyToolActions();
|
||||
private DockingToolActions dummyToolActions = new DummyToolActions();
|
||||
|
||||
public DummyTool() {
|
||||
this(DEFAULT_NAME);
|
||||
|
@ -61,7 +62,7 @@ public class DummyTool implements Tool {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setToolName(String typeName) throws PropertyVetoException {
|
||||
public void setToolName(String typeName) {
|
||||
name = typeName;
|
||||
}
|
||||
|
||||
|
@ -194,10 +195,6 @@ public class DummyTool implements Tool {
|
|||
return null;
|
||||
}
|
||||
|
||||
public void restoreFromXml(Element root) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreDataStateFromXml(Element root) {
|
||||
//do nothing
|
||||
|
@ -227,18 +224,18 @@ public class DummyTool implements Tool {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setIconURL(ToolIconURL iconURL) {
|
||||
this.iconURL = iconURL;
|
||||
public void setIconURL(ToolIconURL iconUrl) {
|
||||
this.dummyIconUrl = iconUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToolIconURL getIconURL() {
|
||||
return iconURL;
|
||||
return dummyIconUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ImageIcon getIcon() {
|
||||
return iconURL.getIcon();
|
||||
return dummyIconUrl.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -417,7 +414,7 @@ public class DummyTool implements Tool {
|
|||
|
||||
@Override
|
||||
public DockingToolActions getToolActions() {
|
||||
return toolActions;
|
||||
return dummyToolActions;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -434,4 +431,9 @@ public class DummyTool implements Tool {
|
|||
public void removeServiceListener(ServiceListener listener) {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public PluginClassManager getPluginClassManager() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.Set;
|
|||
import docking.ComponentProvider;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.actions.DockingToolActions;
|
||||
import docking.actions.SharedDockingActionPlaceholder;
|
||||
|
||||
public class DummyToolActions implements DockingToolActions {
|
||||
|
||||
|
@ -67,4 +68,9 @@ public class DummyToolActions implements DockingToolActions {
|
|||
public void removeActions(ComponentProvider provider) {
|
||||
// stub
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSharedActionPlaceholder(SharedDockingActionPlaceholder placeholder) {
|
||||
// stub
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,13 +20,15 @@ import javax.swing.ImageIcon;
|
|||
import org.jdom.Element;
|
||||
|
||||
import docking.util.image.ToolIconURL;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.model.ToolTemplate;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
||||
public class DummyToolTemplate implements ToolTemplate {
|
||||
|
||||
@Override
|
||||
public Tool createTool(Project project) {
|
||||
public PluginTool createTool(Project project) {
|
||||
return new DummyTool(project);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue