diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationDialog.java deleted file mode 100644 index cd22ec56f5..0000000000 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataOrganizationDialog.java +++ /dev/null @@ -1,101 +0,0 @@ -/* ### - * IP: GHIDRA - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package ghidra.app.plugin.core.datamgr; - -import java.awt.BorderLayout; - -import javax.swing.JPanel; - -import docking.DialogComponentProvider; -import docking.widgets.label.GHtmlLabel; -import ghidra.program.model.data.*; -import ghidra.util.HTMLUtilities; - -/** - * The DataOrganizationDialog - */ -public class DataOrganizationDialog extends DialogComponentProvider { - - private static String TITLE = "Data Type Alignment"; - private DataTypeManager dataTypeManager; - private DataOrganization dataOrganization; - private JPanel mainPanel; - private DataOrganizationPanel alignPanel; - private SizeAlignmentPanel sizePanel; - private boolean actionComplete; - - /** - * Creates a data type organization dialog for specifying data type alignment information - * for a single data type manager. This dialog allows the user to align all data types in - * the associated data type manager. - * @param dataTypeManager the data type manager - * @param dataOrganization structure containing the alignment information. - * This object will be modified by the information entered into the dialog. - */ - public DataOrganizationDialog(DataTypeManager dataTypeManager, - DataOrganizationImpl dataOrganization) { - super(TITLE, true); - this.dataTypeManager = dataTypeManager; - this.dataOrganization = dataOrganization; - - JPanel headerPanel = new JPanel(); - headerPanel.add(new GHtmlLabel("Alignment Information for " + - HTMLUtilities.escapeHTML(dataTypeManager.getName()) + ".")); - - alignPanel = new DataOrganizationPanel(); - alignPanel.setOrganization(dataOrganization); - sizePanel = new SizeAlignmentPanel(); - sizePanel.setOrganization(dataOrganization); - - JPanel infoPanel = new JPanel(new BorderLayout()); - infoPanel.add(alignPanel, BorderLayout.NORTH); - infoPanel.add(sizePanel, BorderLayout.CENTER); - - mainPanel = new JPanel(new BorderLayout()); - mainPanel.add(headerPanel, BorderLayout.NORTH); - mainPanel.add(infoPanel, BorderLayout.CENTER); - addWorkPanel(mainPanel); - initialize(); - } - - private void initialize() { - actionComplete = false; - addOKButton(); - setOkButtonText("Set"); - addCancelButton(); -// setHelpLocation(new HelpLocation(plugin, "Align_Data_Types_In_Archive")); - } - - public boolean userCanceled() { - return !actionComplete && !isVisible(); - } - - @Override - protected void okCallback() { - actionComplete = true; - close(); - } - - @Override - protected void cancelCallback() { - super.cancelCallback(); - actionComplete = false; - } - - public DataOrganization getDataOrganization() { - return dataOrganization; - } -} diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java index c86dfc0ffc..7c3478d4bb 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPlugin.java @@ -106,7 +106,7 @@ public class DataTypeManagerPlugin extends ProgramPlugin @Override protected void init() { - recentlyOpenedArchiveMap = new LRUMap(RECENTLY_USED_CACHE_SIZE) { + recentlyOpenedArchiveMap = new LRUMap<>(RECENTLY_USED_CACHE_SIZE) { @Override protected void eldestEntryRemoved(Entry eldest) { DockingAction action = eldest.getValue(); @@ -719,30 +719,6 @@ public class DataTypeManagerPlugin extends ProgramPlugin return currentSelection; } -// public DataOrganization promptToChangeDataOrganization(DataTypeManager dataTypeManagerToCheck) -// throws CancelledException { -// DataOrganization dataOrganization = promptUserForDataOrganization(dataTypeManagerToCheck); -// dataTypeManagerToCheck.setDataOrganization(dataOrganization); -// return dataOrganization; -// } - -// public DataOrganization promptUserForDataOrganization(DataTypeManager dataTypeManagerToAlign) -// throws CancelledException { -// DataOrganization currentDataOrganization = dataTypeManagerToAlign.getDataOrganization(); -// if (currentDataOrganization == null) { -// currentDataOrganization = DataOrganizationImpl.getDefaultOrganization(); -// } -// DataOrganizationDialog dataOrgDialog = -// new DataOrganizationDialog(dataTypeManagerToAlign, currentDataOrganization); -// dataOrgDialog.setHelpLocation(new HelpLocation(this.getName(), -// "Align_Data_Types_In_Archive")); -// tool.showDialog(dataOrgDialog); -// if (dataOrgDialog.userCanceled()) { -// throw new CancelledException(); -// } -// return dataOrgDialog.getDataOrganization(); -// } - @Override public List getPopupActions(ActionContext context) { if (!(context instanceof DataTypesActionContext)) { diff --git a/Ghidra/Features/Base/src/main/java/ghidra/base/actions/HorizontalRuleAction.java b/Ghidra/Features/Base/src/main/java/ghidra/base/actions/HorizontalRuleAction.java index 81834beb74..a65e811fc7 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/base/actions/HorizontalRuleAction.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/base/actions/HorizontalRuleAction.java @@ -39,19 +39,16 @@ public class HorizontalRuleAction extends DockingAction { setEnabled(false); // The menu name is both names, one over the other, in a small, light grayish font. - // If the original topName or bottomName contain html text that needs escaping, the first - // '&' of the replacement html entity (like '<') will be consumed by the menudata deity - // and lost forever. - setMenuBarData(new MenuData(new String[] { - "
" + HTMLUtilities.escapeHTML(topName) + - "
" + HTMLUtilities.escapeHTML(bottomName) + "
" })); + setMenuBarData(new MenuData(new String[] { "
" + + fixupFirstAmp( + HTMLUtilities.escapeHTML(topName) + "
" + HTMLUtilities.escapeHTML(bottomName)) + + "
" })); // the description is meant to be used for the tooltip and is larger String padding = "     "; - setDescription("
" + padding + - fixupFirstAmp(HTMLUtilities.escapeHTML(topName) + padding + "
" + padding + - HTMLUtilities.escapeHTML(bottomName)) + - padding + "
"); + setDescription("
" + padding + HTMLUtilities.escapeHTML(topName) + padding + + "
" + padding + HTMLUtilities.escapeHTML(bottomName) + padding + + "
"); } private String fixupFirstAmp(String text) {