1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bugzilla 292703

This commit is contained in:
Randy Rohrbach 2009-10-19 20:17:41 +00:00
parent 3abb81f9e4
commit 1b7d9e2dda
2 changed files with 12 additions and 2 deletions

View file

@ -64,7 +64,7 @@ public class FindAction implements IViewActionDelegate {
Shell shell = CDebugUIPlugin.getActiveWorkbenchShell();
FindReplaceDialog dialog = new FindReplaceDialog(shell, (IMemoryBlockExtension) memBlock,
fView, (Properties) fSearchDialogProperties);
fView, (Properties) fSearchDialogProperties, fAction);
if(action.getId().equals(FIND_NEXT_ID))
{
if(Boolean.valueOf(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, Boolean.FALSE.toString())))
@ -84,9 +84,13 @@ public class FindAction implements IViewActionDelegate {
}
private static IAction fAction = null;
public void selectionChanged(IAction action, ISelection selection) {
if(action.getId().equals(FIND_NEXT_ID))
{
fAction = action;
action.setEnabled(Boolean.valueOf(fSearchDialogProperties.getProperty(FindReplaceDialog.SEARCH_ENABLE_FIND_NEXT, Boolean.FALSE.toString())));
}
}

View file

@ -29,6 +29,7 @@ import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
import org.eclipse.debug.ui.memory.IRepositionableMemoryRendering;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
@ -110,7 +111,8 @@ public class FindReplaceDialog extends SelectionDialog
protected final static String SEARCH_FORMAT_WRAP = "SEARCH_FORMAT_WRAP"; //$NON-NLS-1$
protected final static String SEARCH_ENABLE_FIND_NEXT = "SEARCH_ENABLE_FIND_NEXT"; //$NON-NLS-1$
public FindReplaceDialog(Shell parent, IMemoryBlockExtension memoryBlock, IMemoryRenderingSite memoryView, Properties properties)
private IAction fFindAction = null;
public FindReplaceDialog(Shell parent, IMemoryBlockExtension memoryBlock, IMemoryRenderingSite memoryView, Properties properties, IAction findAction)
{
super(parent);
super.setTitle(Messages.getString("FindReplaceDialog.Title")); //$NON-NLS-1$
@ -120,6 +122,7 @@ public class FindReplaceDialog extends SelectionDialog
fMemoryView = memoryView;
fProperties = properties;
this.setBlockOnOpen(false);
fFindAction = findAction;
}
private BigInteger getUserStart()
@ -993,6 +996,9 @@ public class FindReplaceDialog extends SelectionDialog
fProperties.setProperty(SEARCH_ENABLE_FIND_NEXT, Boolean.TRUE.toString());
fProperties.setProperty(SEARCH_LAST_FOUND, "0x" + finalCurrentPosition.toString(16)); //$NON-NLS-1$
if ( fFindAction != null ) {
fFindAction.setEnabled(true);
}
return Status.OK_STATUS;
}
}