GT-2872 - Search - updated the search dialog to show itself during a

'repeat' search if the task monitor is needed; updated the progress of
the memory search to show progress
This commit is contained in:
dragonmacher 2019-05-15 11:53:41 -04:00
parent bf0e7792c0
commit 96788aa7fc
6 changed files with 106 additions and 106 deletions

View file

@ -72,7 +72,7 @@ public class DialogComponentProvider
private TaskScheduler taskScheduler;
private TaskMonitorComponent taskMonitorComponent;
private static KeyStroke escKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
private static final KeyStroke ESC_KEYSTROKE = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
private CardLayout progressCardLayout;
private JButton defaultButton;
@ -180,7 +180,7 @@ public class DialogComponentProvider
}
};
KeyBindingUtils.registerAction(rootPanel, escKeyStroke, escAction,
KeyBindingUtils.registerAction(rootPanel, ESC_KEYSTROKE, escAction,
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
}
@ -642,18 +642,6 @@ public class DialogComponentProvider
}
}
private void doSetSubStatusText(String text, MessageType type, boolean alert) {
SystemUtilities.assertThisIsTheSwingThread(
"Setting text must be performed on the Swing thread");
updateStatusToolTip();
if (alert) {
alertMessage();
}
}
/**
* Signals for this dialog to visually draw the user's attention to the status text
*/
@ -765,6 +753,13 @@ public class DialogComponentProvider
}
private void showProgressBar(String localTitle, boolean hasProgress, boolean canCancel) {
if (!isVisible()) {
// It doesn't make any sense to show the task monitor when the dialog is not
// visible, so show the dialog
DockingWindowManager.showDialog(getParent(), this);
}
taskMonitorComponent.setTaskName(localTitle);
taskMonitorComponent.showProgress(hasProgress);
taskMonitorComponent.setCancelButtonVisibility(canCancel);
@ -1065,6 +1060,13 @@ public class DialogComponentProvider
return dialog;
}
private Component getParent() {
if (dialog == null) {
return null;
}
return dialog.getParent();
}
public boolean isVisible() {
return ((dialog != null) && dialog.isVisible());
}

View file

@ -28,11 +28,13 @@ public interface DockingTool {
/**
* Returns a combination of the tool name and the instance name of the form
* tool name(instance name), e.g., SomeTool(2)
* @return the tool name
*/
public String getName();
/**
* Returns true if tool is visible.
* Returns true if tool is visible
* @return true if tool is visible
*/
public boolean isVisible();
@ -52,7 +54,8 @@ public interface DockingTool {
public void toFront();
/**
* Get the icon that the tool is using.
* Get the icon that the tool is using
* @return the icon that the tool is using
*/
public ImageIcon getIcon();
@ -64,8 +67,8 @@ public interface DockingTool {
public void addComponentProvider(ComponentProvider componentProvider, boolean show);
/**
* Removes the given ComponentProvider from the tool.
* @param componentProviderAdapter the provider to remove from the tool.
* Removes the given ComponentProvider from the tool
* @param componentProvider the provider to remove from the tool
*/
public void removeComponentProvider(ComponentProvider componentProvider);
@ -191,10 +194,12 @@ public interface DockingTool {
public void updateTitle(ComponentProvider componentProvider);
/**
* Signals to the tool that the provider's context has changed. This lets toolbar actions update
* enablement based on current context.
* Signals to the tool that the provider's context has changed. This lets toolbar and
* menu actions update enablement based on current context.
*
* <p>Pass <code>null</code> to signal that the entire tool's context has changed
*
* @param provider the provider whose context changed.
* @param provider the provider whose context changed; null to signal the tool's context
*/
public void contextChanged(ComponentProvider provider);
@ -207,6 +212,8 @@ public interface DockingTool {
/**
* Get the options for the given category name; if no options exist with
* the given name, then one is created.
* @param categoryName the category name
* @return the options
*/
public ToolOptions getOptions(String categoryName);
@ -217,7 +224,8 @@ public interface DockingTool {
public void setConfigChanged(boolean changed);
/**
* Return true if the tool's configuration has changed.
* Return true if the tool's configuration has changed
* @return true if the tool's configuration has changed
*/
public boolean hasConfigChanged();