mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Implementing the 'Refresh Memory' action.
This commit is contained in:
parent
18d7a22ac2
commit
ee3a8df6fd
7 changed files with 59 additions and 9 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-10-30 Mikhail Khodjaiants
|
||||||
|
Implementing the 'Refresh Memory' action.
|
||||||
|
* IFormattedMemoryBlock.java: added the 'refresh' method.
|
||||||
|
* CFormattedMemoryBlock.java: implementation of the 'refresh' method.
|
||||||
|
|
||||||
2002-10-30 Mikhail Khodjaiants
|
2002-10-30 Mikhail Khodjaiants
|
||||||
Implementation of the 'SaveMemoryChanges' action.
|
Implementation of the 'SaveMemoryChanges' action.
|
||||||
* IFormattedMemoryBlock.java: added the 'saveChanges' method.
|
* IFormattedMemoryBlock.java: added the 'saveChanges' method.
|
||||||
|
|
|
@ -128,4 +128,6 @@ public interface IFormattedMemoryBlock extends IMemoryBlock
|
||||||
boolean isDirty();
|
boolean isDirty();
|
||||||
|
|
||||||
void saveChanges() throws DebugException;
|
void saveChanges() throws DebugException;
|
||||||
|
|
||||||
|
void refresh() throws DebugException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -584,4 +584,22 @@ public class CFormattedMemoryBlock extends CDebugElement
|
||||||
Arrays.fill( fDirtyBytes, false );
|
Arrays.fill( fDirtyBytes, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#refresh()
|
||||||
|
*/
|
||||||
|
public void refresh() throws DebugException
|
||||||
|
{
|
||||||
|
if ( getCDIMemoryBlock() != null )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getCDIMemoryBlock().refresh();
|
||||||
|
}
|
||||||
|
catch( CDIException e )
|
||||||
|
{
|
||||||
|
targetRequestFailed( e.getMessage(), null );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2002-10-30 Mikhail Khodjaiants
|
||||||
|
Implementing the 'Refresh Memory' action.
|
||||||
|
* RefreshMemoryAction.java
|
||||||
|
* MemoryControlArea.java
|
||||||
|
* MemoryViewer.java
|
||||||
|
|
||||||
2002-10-30 Mikhail Khodjaiants
|
2002-10-30 Mikhail Khodjaiants
|
||||||
Implementation of the 'SaveMemoryChanges' action.
|
Implementation of the 'SaveMemoryChanges' action.
|
||||||
* SaveMemoryChangesAction.java
|
* SaveMemoryChangesAction.java
|
||||||
|
|
|
@ -8,7 +8,6 @@ package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
import org.eclipse.cdt.debug.internal.ui.CDebugImages;
|
||||||
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds;
|
||||||
import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
|
||||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
|
||||||
import org.eclipse.ui.actions.SelectionProviderAction;
|
import org.eclipse.ui.actions.SelectionProviderAction;
|
||||||
import org.eclipse.ui.help.WorkbenchHelp;
|
import org.eclipse.ui.help.WorkbenchHelp;
|
||||||
import org.eclipse.ui.texteditor.IUpdate;
|
import org.eclipse.ui.texteditor.IUpdate;
|
||||||
|
@ -37,14 +36,6 @@ public class RefreshMemoryAction extends SelectionProviderAction implements IUpd
|
||||||
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.REFRESH_MEMORY_ACTION );
|
WorkbenchHelp.setHelp( this, ICDebugHelpContextIds.REFRESH_MEMORY_ACTION );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(IStructuredSelection)
|
|
||||||
*/
|
|
||||||
public void selectionChanged( IStructuredSelection selection )
|
|
||||||
{
|
|
||||||
super.selectionChanged( selection );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
* @see org.eclipse.ui.texteditor.IUpdate#update()
|
||||||
*/
|
*/
|
||||||
|
@ -52,4 +43,12 @@ public class RefreshMemoryAction extends SelectionProviderAction implements IUpd
|
||||||
{
|
{
|
||||||
setEnabled( fMemoryViewer.canUpdate() );
|
setEnabled( fMemoryViewer.canUpdate() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.jface.action.IAction#run()
|
||||||
|
*/
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
fMemoryViewer.refreshMemoryBlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,6 +371,21 @@ public class MemoryControlArea extends Composite
|
||||||
tabItems[fIndex].setText( title );
|
tabItems[fIndex].setText( title );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void refreshMemoryBlock()
|
||||||
|
{
|
||||||
|
if ( getMemoryBlock() != null )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
getMemoryBlock().refresh();
|
||||||
|
}
|
||||||
|
catch( DebugException e )
|
||||||
|
{
|
||||||
|
CDebugUIPlugin.errorDialog( "Unable to refresh memory.", e.getStatus() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void saveChanges()
|
protected void saveChanges()
|
||||||
{
|
{
|
||||||
|
|
|
@ -205,6 +205,11 @@ public class MemoryViewer extends ContentViewer
|
||||||
((MemoryControlArea)fTabFolder.getSelection().getControl()).saveChanges();
|
((MemoryControlArea)fTabFolder.getSelection().getControl()).saveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void refreshMemoryBlock()
|
||||||
|
{
|
||||||
|
((MemoryControlArea)fTabFolder.getSelection().getControl()).refreshMemoryBlock();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean showAscii()
|
public boolean showAscii()
|
||||||
{
|
{
|
||||||
return ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().displayASCII();
|
return ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().displayASCII();
|
||||||
|
|
Loading…
Add table
Reference in a new issue