Merge remote-tracking branch

'origin/dev747368_GT-2698_hostile_html_whack_a_mole_UI_stuff'

Conflicts:
	Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisPanel.java
This commit is contained in:
ghidravore 2019-05-02 14:24:21 -04:00
commit 45222ad4d3
423 changed files with 6234 additions and 5902 deletions

View file

@ -27,6 +27,7 @@ import javax.swing.*;
import org.apache.commons.lang3.StringUtils;
import docking.framework.DockingApplicationConfiguration;
import docking.widgets.label.GDLabel;
import ghidra.GhidraApplicationLayout;
import ghidra.GhidraLaunchable;
import ghidra.app.plugin.core.datamgr.archive.SourceArchive;
@ -788,7 +789,7 @@ public class DataTypeArchiveTransformer implements GhidraLaunchable {
monitorComponent.setVisible(true);
statusPanel.add(monitorComponent, BorderLayout.EAST);
// Add the status message to the status area.
final JLabel statusLabel = new JLabel(" ");
JLabel statusLabel = new GDLabel(" ");
statusPanel.add(statusLabel, BorderLayout.CENTER);
Dimension preferredSize = statusLabel.getPreferredSize();
preferredSize.height = monitorComponent.getPreferredSize().height;

View file

@ -1,6 +1,5 @@
/* ###
* IP: GHIDRA
* REVIEWED: YES
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,10 +15,6 @@
*/
package ghidra.program.database.data;
import ghidra.framework.preferences.Preferences;
import ghidra.util.exception.*;
import ghidra.util.task.TaskMonitor;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -28,7 +23,13 @@ import java.io.IOException;
import javax.swing.*;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.filechooser.GhidraFileChooser;
import docking.widgets.label.GHtmlLabel;
import docking.widgets.label.GLabel;
import ghidra.framework.preferences.Preferences;
import ghidra.util.exception.*;
import ghidra.util.task.TaskMonitor;
public class DataTypeArchiveTransformerPanel extends JPanel {
@ -60,11 +61,10 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
}
private void setupDescription() {
String description =
"<HTML>" + "Specify the files for converting a new data type archive (.gdt)<BR>"
+ "to match the IDs of data types in an old data type archive.<BR>"
+ "The result will be saved to the destination archive." + "</HTML>";
JLabel label = new JLabel(description);
JLabel label = new GHtmlLabel(
"<HTML>Specify the files for converting a new data type archive (.gdt)<BR>" +
"to match the IDs of data types in an old data type archive.<BR>" +
"The result will be saved to the destination archive.</HTML>");
label.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
label.setHorizontalAlignment(SwingConstants.CENTER);
add(label, BorderLayout.NORTH);
@ -77,7 +77,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridy = 0;
gbc.gridx = 0;
gbc.gridwidth = 1;
filePanel.add(new JLabel("Old file name "), gbc);
filePanel.add(new GLabel("Old file name "), gbc);
gbc.gridx = 1;
gbc.gridwidth = 1;
@ -88,6 +88,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridwidth = 1;
JButton oldBrowseButton = new JButton(DOT_DOT_DOT);
oldBrowseButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setCursor(WAIT_CURSOR);
File file = chooseFile("Choose old data type archive");
@ -103,7 +104,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridx = 3;
gbc.gridwidth = 1;
useOldFileIDCheckBox = new JCheckBox(" Use Old File ID");
useOldFileIDCheckBox = new GCheckBox(" Use Old File ID");
filePanel.add(useOldFileIDCheckBox, gbc);
}
@ -114,7 +115,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridy = 1;
gbc.gridx = 0;
gbc.gridwidth = 1;
filePanel.add(new JLabel("New file name "), gbc);
filePanel.add(new GLabel("New file name "), gbc);
gbc.gridx = 1;
gbc.gridwidth = 1;
@ -125,6 +126,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridwidth = 1;
JButton newBrowseButton = new JButton(DOT_DOT_DOT);
newBrowseButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setCursor(WAIT_CURSOR);
File file = chooseFile("Choose new data type archive");
@ -146,7 +148,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridy = 2;
gbc.gridx = 0;
gbc.gridwidth = 1;
filePanel.add(new JLabel("Destination file name "), gbc);
filePanel.add(new GLabel("Destination file name "), gbc);
gbc.gridx = 1;
gbc.gridwidth = 1;
@ -157,6 +159,7 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
gbc.gridwidth = 1;
JButton destinationBrowseButton = new JButton(DOT_DOT_DOT);
destinationBrowseButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setCursor(WAIT_CURSOR);
File file = chooseFile("Choose destination file");
@ -192,14 +195,13 @@ public class DataTypeArchiveTransformerPanel extends JPanel {
}
File getLastDataTypeArchiveDirectory() {
String lastDirStr =
Preferences.getProperty(Preferences.LAST_OPENED_ARCHIVE_DIRECTORY,
System.getProperty("user.home"));
String lastDirStr = Preferences.getProperty(Preferences.LAST_OPENED_ARCHIVE_DIRECTORY,
System.getProperty("user.home"));
return new File(lastDirStr);
}
protected void transform(TaskMonitor monitor) throws InvalidInputException,
DuplicateFileException, IOException, CancelledException {
protected void transform(TaskMonitor monitor)
throws InvalidInputException, DuplicateFileException, IOException, CancelledException {
DataTypeArchiveTransformer.transform(getOldFile(), getNewFile(), getDestinationFile(),
useOldFileIDCheckBox.isSelected(), monitor);