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

Replaced the usage of 'setWordSize' method by the 'reformat' method of 'IFormattedMemoryBlock'.

This commit is contained in:
Mikhail Khodjaiants 2002-10-25 15:52:38 +00:00
parent 60ea319f0a
commit c915146cf3
3 changed files with 21 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2002-10-25 Mikhail Khodjaiants
Replaced the usage of 'setWordSize' method by the 'reformat' method of 'IFormattedMemoryBlock'.
* MemorySizeAction.java
* MemoryViewer.java
2002-10-24 Mikhail Khodjaiants
Set the 'relationship' attribute value to 'stack' for the 'MemoryView' perspective extension.
* plugin.xml

View file

@ -7,6 +7,9 @@ package org.eclipse.cdt.debug.internal.ui.actions;
import org.eclipse.cdt.debug.core.IFormattedMemoryBlock;
import org.eclipse.cdt.debug.internal.ui.views.memory.MemoryViewer;
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.texteditor.IUpdate;
@ -76,8 +79,16 @@ public class MemorySizeAction extends Action implements IUpdate
*/
public void run()
{
fGroup.setCurrentSelection( this );
fMemoryViewer.setWordSize( fId );
try
{
fMemoryViewer.setWordSize( fId );
fGroup.setCurrentSelection( this );
}
catch( DebugException e )
{
CDebugUIPlugin.errorDialog( e.getMessage(), (IStatus)null );
setChecked( false );
}
}
public String getActionId()

View file

@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.ui.views.memory;
import org.eclipse.cdt.debug.core.ICMemoryManager;
import org.eclipse.cdt.debug.core.IFormattedMemoryBlock;
import org.eclipse.debug.core.DebugException;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ContentViewer;
import org.eclipse.jface.viewers.ISelection;
@ -216,12 +217,12 @@ public class MemoryViewer extends ContentViewer
return ( block != null ) ? block.getWordSize() : 0;
}
public void setWordSize( int size )
public void setWordSize( int size ) throws DebugException
{
IFormattedMemoryBlock block = ((MemoryControlArea)fTabFolder.getSelection().getControl()).getMemoryBlock();
if ( block != null )
{
block.setWordSize( size );
block.reformat( block.getFormat(), size, block.getNumberOfRows(), block.getNumberOfColumns() );
((MemoryControlArea)fTabFolder.getSelection().getControl()).refresh();
}
}