GP-1556 - Added support for searching for structure fields by offset

This commit is contained in:
dragonmacher 2022-03-25 09:43:50 -04:00
parent 883f5a687a
commit 812ea4fe1e
45 changed files with 1461 additions and 840 deletions

View file

@ -41,10 +41,10 @@ import utilities.util.reflection.ReflectionUtilities;
* the entire application.
* <p>
* DockingActions can be invoked from the global menu, a popup menu, a toolbar, and/or a keybinding,
* depending on whether or not menuBarData, popupMenuData, toolBarData, and/or keyBindingData have
* depending on whether or not menuBarData, popupMenuData, toolBarData, and/or keyBindingData have
* been set.
* <p>
* <b>
* <b>
* Implementors of this class should override {@link #actionPerformed(ActionContext)}.
* </b>
* <p>
@ -199,12 +199,12 @@ public abstract class DockingAction implements DockingActionIf {
* <P>
* If the client wants the action on all windows, then they can call {@link #shouldAddToAllWindows}
* <P>
* If the client wants the action to be on a window only when the window can produce
* a certain context type, the the client should call
* If the client wants the action to be on a window only when the window can produce
* a certain context type, the the client should call
* {@link #addToWindowWhen(Class)}
* <P>
* Otherwise, by default, the action will only be on the main window.
*
*
*/
@Override
public final boolean shouldAddToWindow(boolean isMainWindow, Set<Class<?>> contextTypes) {
@ -212,7 +212,7 @@ public abstract class DockingAction implements DockingActionIf {
if (menuBarData == null && toolBarData == null) {
return false;
}
// clients can specify that the action should be on all windows.
if (shouldAddToAllWindows) {
return true;
@ -242,6 +242,14 @@ public abstract class DockingAction implements DockingActionIf {
DockingWindowManager.getHelpService().registerHelp(this, location);
}
/**
* Returns the help location for this action
* @return the help location for this action
*/
public HelpLocation getHelpLocation() {
return DockingWindowManager.getHelpService().getHelpLocation(this);
}
/**
* Signals the the help system that this action does not need a help entry. Some actions
* are so obvious that they do not require help, such as an action that renames a file.
@ -579,10 +587,10 @@ public abstract class DockingAction implements DockingActionIf {
/**
* Sets a predicate for dynamically determining the action's enabled state. If this
* predicate is not set, the action's enable state must be controlled directly using the
* {@link DockingAction#setEnabled(boolean)} method. See
* {@link DockingAction#setEnabled(boolean)} method. See
* {@link DockingActionIf#isEnabledForContext(ActionContext)}
*
* @param predicate the predicate that will be used to dynamically determine an action's
*
* @param predicate the predicate that will be used to dynamically determine an action's
* enabled state.
*/
public void enabledWhen(Predicate<ActionContext> predicate) {
@ -592,10 +600,10 @@ public abstract class DockingAction implements DockingActionIf {
/**
* Sets a predicate for dynamically determining if this action should be included in
* an impending pop-up menu. If this predicate is not set, the action's will be included
* in an impending pop-up, if it is enabled. See
* in an impending pop-up, if it is enabled. See
* {@link DockingActionIf#isAddToPopup(ActionContext)}
*
* @param predicate the predicate that will be used to dynamically determine an action's
*
* @param predicate the predicate that will be used to dynamically determine an action's
* enabled state.
*/
public void popupWhen(Predicate<ActionContext> predicate) {
@ -603,10 +611,10 @@ public abstract class DockingAction implements DockingActionIf {
}
/**
* Sets a predicate for dynamically determining if this action is valid for the current
* Sets a predicate for dynamically determining if this action is valid for the current
* {@link ActionContext}. See {@link DockingActionIf#isValidContext(ActionContext)}
*
* @param predicate the predicate that will be used to dynamically determine an action's
*
* @param predicate the predicate that will be used to dynamically determine an action's
* validity for a given {@link ActionContext}
*/
public void validContextWhen(Predicate<ActionContext> predicate) {
@ -620,14 +628,14 @@ public abstract class DockingAction implements DockingActionIf {
* that can produce an ActionContext that is appropriate for this action.
* <P>
* @param contextClass the ActionContext class required to be producible by a
* provider that is hosted in that window before this action is added to that
* window.
*
* provider that is hosted in that window before this action is added to that
* window.
*
*/
public void addToWindowWhen(Class<? extends ActionContext> contextClass) {
addToWindowWhenContextClass = contextClass;
}
/**
* Tells this action to add itself to all windows
* <P>
@ -664,5 +672,5 @@ public abstract class DockingAction implements DockingActionIf {
String classInfo = trace[0].toString();
return classInfo;
}
}

View file

@ -27,8 +27,8 @@ import docking.widgets.label.GDLabel;
import docking.widgets.label.GHtmlLabel;
/**
* A dialog that has text fields to get user input.
*
* A dialog that has text fields to get user input.
*
*/
public class InputWithChoicesDialog extends DialogComponentProvider {
@ -39,12 +39,12 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
/**
* Creates a provider for a generic input dialog with the specified title,
* a label and a editable comboBox pre-populated with selectable values. The user
* can check the value of {@link #isCanceled()} to know whether or not
* can check the value of {@link #isCanceled()} to know whether or not
* the user canceled the operation. To get the user selected value use the
* {@link #getValue()} value(s) entered by the user. If the user cancelled the operation, then
* null will be returned from <code>getValue()</code>.
* <P>
*
*
* @param dialogTitle used as the name of the dialog's title bar
* @param label value to use for the label of the text field
* @param optionValues values to populate the combo box
@ -69,12 +69,12 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
/**
* Creates a provider for a generic input dialog with the specified title,
* a label and a editable comboBox pre-populated with selectable values. The user
* can check the value of {@link #isCanceled()} to know whether or not
* can check the value of {@link #isCanceled()} to know whether or not
* the user canceled the operation. To get the user selected value use the
* {@link #getValue()} value(s) entered by the user. If the user cancelled the operation, then
* null will be returned from <code>getValue()</code>.
* <P>
*
*
* @param dialogTitle used as the name of the dialog's title bar
* @param label value to use for the label of the text field
* @param optionValues values to populate the combo box
@ -180,6 +180,11 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
if (isCanceled) {
return null;
}
if (allowEdits) {
return combo.getText();
}
Object selectedItem = combo.getSelectedItem();
return selectedItem == null ? null : selectedItem.toString();
}
@ -188,7 +193,7 @@ public class InputWithChoicesDialog extends DialogComponentProvider {
* Set the current choice to value.
* @param value updated choice
* @throws NoSuchElementException if choice does not permit edits and value is
* not a valid choice.
* not a valid choice.
*/
public void setValue(String value) {
combo.setSelectedItem(value);