mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-5354_James_function_tags_selection_action--SQUASHED'
This commit is contained in:
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -127,4 +127,12 @@ public class AllFunctionsPanel extends JPanel {
|
|||||||
public FunctionTableModel getTableModel() {
|
public FunctionTableModel getTableModel() {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the underlying table.
|
||||||
|
* @return table
|
||||||
|
*/
|
||||||
|
public GhidraTable getTable() {
|
||||||
|
return table;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@@ -43,6 +43,7 @@ import ghidra.program.model.listing.*;
|
|||||||
import ghidra.program.util.FunctionLocation;
|
import ghidra.program.util.FunctionLocation;
|
||||||
import ghidra.program.util.ProgramLocation;
|
import ghidra.program.util.ProgramLocation;
|
||||||
import ghidra.util.*;
|
import ghidra.util.*;
|
||||||
|
import ghidra.util.table.actions.MakeProgramSelectionAction;
|
||||||
import ghidra.util.task.SwingUpdateManager;
|
import ghidra.util.task.SwingUpdateManager;
|
||||||
import resources.ResourceManager;
|
import resources.ResourceManager;
|
||||||
|
|
||||||
@@ -107,6 +108,8 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
|||||||
// this we would need to reload from file on each new program activation.
|
// this we would need to reload from file on each new program activation.
|
||||||
private Set<FunctionTag> tagsFromFile;
|
private Set<FunctionTag> tagsFromFile;
|
||||||
|
|
||||||
|
private FunctionTagPlugin plugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@@ -115,18 +118,26 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
|||||||
*/
|
*/
|
||||||
public FunctionTagProvider(FunctionTagPlugin plugin, Program program) {
|
public FunctionTagProvider(FunctionTagPlugin plugin, Program program) {
|
||||||
super(plugin.getTool(), "Function Tags", plugin.getName(), ProgramActionContext.class);
|
super(plugin.getTool(), "Function Tags", plugin.getName(), ProgramActionContext.class);
|
||||||
|
this.plugin = plugin;
|
||||||
setHelpLocation(new HelpLocation(plugin.getName(), plugin.getName()));
|
setHelpLocation(new HelpLocation(plugin.getName(), plugin.getName()));
|
||||||
this.program = program;
|
this.program = program;
|
||||||
mainPanel = createWorkPanel();
|
mainPanel = createWorkPanel();
|
||||||
addToTool();
|
addToTool();
|
||||||
|
createActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentShown() {
|
public void componentShown() {
|
||||||
updateView();
|
updateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void componentHidden() {
|
||||||
|
allFunctionsPanel.getTable().clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JComponent getComponent() {
|
public JComponent getComponent() {
|
||||||
return mainPanel;
|
return mainPanel;
|
||||||
@@ -406,7 +417,6 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
|||||||
if (!sTags.isEmpty()) {
|
if (!sTags.isEmpty()) {
|
||||||
allFunctionsPanel.refresh(sTags);
|
allFunctionsPanel.refresh(sTags);
|
||||||
}
|
}
|
||||||
|
|
||||||
Function function = getFunction(currentLocation);
|
Function function = getFunction(currentLocation);
|
||||||
sourcePanel.refresh(function);
|
sourcePanel.refresh(function);
|
||||||
targetPanel.refresh(function);
|
targetPanel.refresh(function);
|
||||||
@@ -495,4 +505,10 @@ public class FunctionTagProvider extends ComponentProviderAdapter implements Dom
|
|||||||
|
|
||||||
return inputPanel;
|
return inputPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createActions() {
|
||||||
|
tool.addLocalAction(this,
|
||||||
|
new MakeProgramSelectionAction(plugin, allFunctionsPanel.getTable()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user