mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch
'origin/GP-7030-dragonmacher-edit-references-npe'
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.
|
||||||
@@ -157,6 +157,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
setWindowMenuGroup(TITLE_PREFIX);
|
setWindowMenuGroup(TITLE_PREFIX);
|
||||||
|
|
||||||
tool.addComponentProvider(this, false);
|
tool.addComponentProvider(this, false);
|
||||||
|
setupActions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupActions() {
|
private void setupActions() {
|
||||||
@@ -179,7 +180,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
new MenuData(new String[] { "Add..." }, ADD_ICON, ADD_REFS_GROUP));
|
new MenuData(new String[] { "Add..." }, ADD_ICON, ADD_REFS_GROUP));
|
||||||
addRefAction.setToolBarData(new ToolBarData(ADD_ICON, "EditAction"));
|
addRefAction.setToolBarData(new ToolBarData(ADD_ICON, "EditAction"));
|
||||||
addRefAction.setEnabled(true);
|
addRefAction.setEnabled(true);
|
||||||
tool.addLocalAction(this, addRefAction);
|
addLocalAction(addRefAction);
|
||||||
|
|
||||||
deleteRefAction = new DockingAction("Delete References", plugin.getName()) {
|
deleteRefAction = new DockingAction("Delete References", plugin.getName()) {
|
||||||
@Override
|
@Override
|
||||||
@@ -199,7 +200,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
new MenuData(new String[] { "Delete..." }, DELETE_ICON, ADD_REFS_GROUP));
|
new MenuData(new String[] { "Delete..." }, DELETE_ICON, ADD_REFS_GROUP));
|
||||||
deleteRefAction.setToolBarData(new ToolBarData(DELETE_ICON, "EditAction"));
|
deleteRefAction.setToolBarData(new ToolBarData(DELETE_ICON, "EditAction"));
|
||||||
deleteRefAction.setEnabled(false);
|
deleteRefAction.setEnabled(false);
|
||||||
tool.addLocalAction(this, deleteRefAction);
|
addLocalAction(deleteRefAction);
|
||||||
|
|
||||||
editRefAction = new DockingAction("Edit Reference", plugin.getName()) {
|
editRefAction = new DockingAction("Edit Reference", plugin.getName()) {
|
||||||
@Override
|
@Override
|
||||||
@@ -219,7 +220,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
new MenuData(new String[] { "Edit..." }, EDIT_ICON, ADD_REFS_GROUP));
|
new MenuData(new String[] { "Edit..." }, EDIT_ICON, ADD_REFS_GROUP));
|
||||||
editRefAction.setToolBarData(new ToolBarData(EDIT_ICON, "EditAction"));
|
editRefAction.setToolBarData(new ToolBarData(EDIT_ICON, "EditAction"));
|
||||||
editRefAction.setEnabled(false);
|
editRefAction.setEnabled(false);
|
||||||
tool.addLocalAction(this, editRefAction);
|
addLocalAction(editRefAction);
|
||||||
|
|
||||||
selectAction = new DockingAction("Select Destinations", plugin.getName()) {
|
selectAction = new DockingAction("Select Destinations", plugin.getName()) {
|
||||||
@Override
|
@Override
|
||||||
@@ -232,7 +233,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
selectAction.setDescription("Select reference destinations");
|
selectAction.setDescription("Select reference destinations");
|
||||||
selectAction.setToolBarData(new ToolBarData(SELECT_ICON, "NavAction"));
|
selectAction.setToolBarData(new ToolBarData(SELECT_ICON, "NavAction"));
|
||||||
selectAction.setEnabled(true);
|
selectAction.setEnabled(true);
|
||||||
tool.addLocalAction(this, selectAction);
|
addLocalAction(selectAction);
|
||||||
|
|
||||||
followLocationToggleAction =
|
followLocationToggleAction =
|
||||||
new ToggleDockingAction("Follow location changes", plugin.getName()) {
|
new ToggleDockingAction("Follow location changes", plugin.getName()) {
|
||||||
@@ -243,7 +244,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
};
|
};
|
||||||
followLocationToggleAction.setEnabled(true);
|
followLocationToggleAction.setEnabled(true);
|
||||||
followLocationToggleAction.setToolBarData(new ToolBarData(RECV_LOCATION_ICON, "NavAction"));
|
followLocationToggleAction.setToolBarData(new ToolBarData(RECV_LOCATION_ICON, "NavAction"));
|
||||||
tool.addLocalAction(this, followLocationToggleAction);
|
addLocalAction(followLocationToggleAction);
|
||||||
|
|
||||||
gotoReferenceLocationToggleAction =
|
gotoReferenceLocationToggleAction =
|
||||||
new ToggleDockingAction("GoTo selected destination", plugin.getName()) {
|
new ToggleDockingAction("GoTo selected destination", plugin.getName()) {
|
||||||
@@ -255,7 +256,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
gotoReferenceLocationToggleAction
|
gotoReferenceLocationToggleAction
|
||||||
.setToolBarData(new ToolBarData(SEND_LOCATION_ICON, "NavAction"));
|
.setToolBarData(new ToolBarData(SEND_LOCATION_ICON, "NavAction"));
|
||||||
gotoReferenceLocationToggleAction.setEnabled(true);
|
gotoReferenceLocationToggleAction.setEnabled(true);
|
||||||
tool.addLocalAction(this, gotoReferenceLocationToggleAction);
|
addLocalAction(gotoReferenceLocationToggleAction);
|
||||||
|
|
||||||
goHomeAction = new DockingAction("GoTo source location", plugin.getName()) {
|
goHomeAction = new DockingAction("GoTo source location", plugin.getName()) {
|
||||||
@Override
|
@Override
|
||||||
@@ -269,7 +270,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
goHomeAction.setToolBarData(new ToolBarData(HOME_ICON, "NavAction"));
|
goHomeAction.setToolBarData(new ToolBarData(HOME_ICON, "NavAction"));
|
||||||
goHomeAction.setDescription("GoTo reference source location");
|
goHomeAction.setDescription("GoTo reference source location");
|
||||||
goHomeAction.setEnabled(true);
|
goHomeAction.setEnabled(true);
|
||||||
tool.addLocalAction(this, goHomeAction);
|
addLocalAction(goHomeAction);
|
||||||
enableGotoReferenceLocation(plugin.getDefaultGotoReferenceLocation());
|
enableGotoReferenceLocation(plugin.getDefaultGotoReferenceLocation());
|
||||||
enableFollowLocation(plugin.getDefaultFollowOnLocation());
|
enableFollowLocation(plugin.getDefaultFollowOnLocation());
|
||||||
|
|
||||||
@@ -376,7 +377,6 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
|
|
||||||
if (!tool.isVisible(this)) {
|
if (!tool.isVisible(this)) {
|
||||||
tool.showComponentProvider(this, true);
|
tool.showComponentProvider(this, true);
|
||||||
setupActions();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
init(referenceInfo);
|
init(referenceInfo);
|
||||||
@@ -603,13 +603,7 @@ public class EditReferencesProvider extends ComponentProviderAdapter
|
|||||||
instrPanel.setSelectedOpIndex(opIndex, -1);
|
instrPanel.setSelectedOpIndex(opIndex, -1);
|
||||||
followSelectedReference();
|
followSelectedReference();
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// int opIndex = MNEONIC_OPINDEX;
|
|
||||||
// if (selRows.length != 0) {
|
|
||||||
// opIndex = tableModel.getReference(selRows[0]).getOperandIndex();
|
|
||||||
// }
|
|
||||||
// instrPanel.setSelectedOpIndex(opIndex);
|
|
||||||
// }
|
|
||||||
selectionBusy = false;
|
selectionBusy = false;
|
||||||
updateLocation();
|
updateLocation();
|
||||||
adjustActionState();
|
adjustActionState();
|
||||||
|
|||||||
@@ -1,13 +1,12 @@
|
|||||||
/* ###
|
/* ###
|
||||||
* IP: GHIDRA
|
* IP: GHIDRA
|
||||||
* REVIEWED: YES
|
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user