1
0
Fork 0
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:
Mikhail Khodjaiants 2002-10-30 23:39:31 +00:00
parent 18d7a22ac2
commit ee3a8df6fd
7 changed files with 59 additions and 9 deletions

View file

@ -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
Implementation of the 'SaveMemoryChanges' action.
* IFormattedMemoryBlock.java: added the 'saveChanges' method.

View file

@ -128,4 +128,6 @@ public interface IFormattedMemoryBlock extends IMemoryBlock
boolean isDirty();
void saveChanges() throws DebugException;
void refresh() throws DebugException;
}

View file

@ -584,4 +584,22 @@ public class CFormattedMemoryBlock extends CDebugElement
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 );
}
}
}
}

View file

@ -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
Implementation of the 'SaveMemoryChanges' action.
* SaveMemoryChangesAction.java

View file

@ -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.ICDebugHelpContextIds;
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.help.WorkbenchHelp;
import org.eclipse.ui.texteditor.IUpdate;
@ -37,14 +36,6 @@ public class RefreshMemoryAction extends SelectionProviderAction implements IUpd
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)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
@ -52,4 +43,12 @@ public class RefreshMemoryAction extends SelectionProviderAction implements IUpd
{
setEnabled( fMemoryViewer.canUpdate() );
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
public void run()
{
fMemoryViewer.refreshMemoryBlock();
}
}

View file

@ -371,6 +371,21 @@ public class MemoryControlArea extends Composite
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()
{

View file

@ -205,6 +205,11 @@ public class MemoryViewer extends ContentViewer
((MemoryControlArea)fTabFolder.getSelection().getControl()).saveChanges();
}
public void refreshMemoryBlock()
{
((MemoryControlArea)fTabFolder.getSelection().getControl()).refreshMemoryBlock();
}
public boolean showAscii()
{
return ((MemoryControlArea)fTabFolder.getSelection().getControl()).getPresentation().displayASCII();