Merge remote-tracking branch 'origin/GT-2886-dragonmacher-beep-npe'

Conflicts:
	Ghidra/Framework/Project/src/main/java/ghidra/framework/plugintool/PluginTool.java
This commit is contained in:
Ryan Kurtz 2019-05-23 12:08:34 -04:00
commit f9a1652974
8 changed files with 51 additions and 33 deletions

View file

@ -1909,7 +1909,7 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
}
/**
* Set the status text in the active component window.
* Set the status text in the active component window
* @param text status text
*/
public void setStatusText(String text) {
@ -1918,6 +1918,30 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
}
}
/**
* Set the status text in the active component window
*
* @param text string to be displayed in the Status display area
* @param beep whether to beep or not
*/
public void setStatusText(String text, boolean beep) {
if (root == null) {
return;
}
setStatusText(text);
if (beep) {
Toolkit.getDefaultToolkit().beep();
}
}
/**
* A convenience method to make an attention-grabbing noise to the user
*/
public static void beep() {
Toolkit.getDefaultToolkit().beep();
}
/**
* Set the menu group associated with a cascaded submenu. This allows
* a cascading menu item to be grouped with a specific set of actions.

View file

@ -21,7 +21,7 @@ import java.util.*;
import javax.swing.*;
import docking.*;
import ghidra.util.SystemUtilities;
import ghidra.util.Swing;
/**
* Action that manages multiple PluginActions mapped to this action's key binding.
@ -146,7 +146,6 @@ public class MultipleKeyAction extends DockingKeyBindingAction {
}
// If more than one action, prompt user for selection
JFrame rootFrame = winMgr.getRootFrame();
if (list.size() > 1) {
// popup dialog to show multiple actions
if (dialog == null) {
@ -159,7 +158,7 @@ public class MultipleKeyAction extends DockingKeyBindingAction {
// doing the show in an invoke later seems to fix a strange swing bug that lock up
// the program if you tried to invoke a new action too quickly after invoking
// it the first time
SystemUtilities.runSwingLater(() -> winMgr.showDialog(dialog));
Swing.runLater(() -> DockingWindowManager.showDialog(dialog));
}
else if (list.size() == 1) {
final ExecutableKeyActionAdapter actionProxy = list.get(0);
@ -168,8 +167,7 @@ public class MultipleKeyAction extends DockingKeyBindingAction {
}
else {
String name = (String) getValue(Action.NAME);
winMgr.setStatusText("Action (" + name + ") not valid in this context!");
rootFrame.getToolkit().beep();
winMgr.setStatusText("Action (" + name + ") not valid in this context!", true);
}
}