mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for PR 25988: The 'Padding Character' preference of the Memory view doesn't work.
This commit is contained in:
parent
6b63c5a5dc
commit
d3ebea6093
3 changed files with 40 additions and 7 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-11-11 Mikhail Khodjaiants
|
||||
Fix for PR 25988: The 'Padding Character' preference of the Memory view doesn't work.
|
||||
* MemoryControlArea.java
|
||||
* MemoryViewPreferencePage.java
|
||||
|
||||
2002-11-05 Mikhail Khodjaiants
|
||||
Implementation of the "Add Global Variables" action of the Expressions view.
|
||||
Action images:
|
||||
|
|
|
@ -96,7 +96,8 @@ public class MemoryViewPreferencePage extends FieldEditorPreferencePage
|
|||
// addField( dirty );
|
||||
addField( font );
|
||||
|
||||
StringFieldEditor paddingChar = new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, "Padding Character:", 1, getFieldEditorParent() );
|
||||
// StringFieldEditor paddingChar = new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, "Padding Character:", 1, getFieldEditorParent() );
|
||||
StringFieldEditor paddingChar = createPaddingCharacterField();
|
||||
paddingChar.setTextLimit( 1 );
|
||||
addField( paddingChar );
|
||||
}
|
||||
|
@ -136,4 +137,15 @@ public class MemoryViewPreferencePage extends FieldEditorPreferencePage
|
|||
CDebugUIPlugin.getDefault().savePluginPreferences();
|
||||
return ok;
|
||||
}
|
||||
|
||||
private StringFieldEditor createPaddingCharacterField()
|
||||
{
|
||||
return new StringFieldEditor( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR, "Padding Character:", 1, getFieldEditorParent() )
|
||||
{
|
||||
protected boolean doCheckState()
|
||||
{
|
||||
return ( getTextControl().getText().length() == 1 );
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
|
|||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.IDebugTarget;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.CTabFolder;
|
||||
|
@ -72,11 +73,10 @@ public class MemoryControlArea extends Composite
|
|||
|
||||
private MemoryPresentation createPresentation()
|
||||
{
|
||||
/*
|
||||
IPreferenceStore pstore = CDebugUIPlugin.getDefault().getPreferenceStore();
|
||||
char[] paddingCharStr = pstore.getString( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR ).toCharArray();
|
||||
char paddingChar = ( paddingCharStr.length > 0 ) ? paddingCharStr[0] : '.';
|
||||
*/
|
||||
setPaddingChar( ( paddingCharStr.length > 0 ) ? paddingCharStr[0] : '.' );
|
||||
|
||||
return new MemoryPresentation();
|
||||
}
|
||||
|
||||
|
@ -164,10 +164,11 @@ public class MemoryControlArea extends Composite
|
|||
{
|
||||
fMemoryText.setDirtyColor();
|
||||
}
|
||||
else
|
||||
else if ( event.getProperty().equals( ICDebugPreferenceConstants.PREF_MEMORY_PADDING_CHAR ) )
|
||||
{
|
||||
// updatePresentation( event );
|
||||
// fMemoryText.refresh();
|
||||
String paddingCharString = (String)event.getNewValue();
|
||||
setPaddingChar( ( paddingCharString.length() > 0 ) ? paddingCharString.charAt( 0 ) : '.' );
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,6 +308,21 @@ public class MemoryControlArea extends Composite
|
|||
public void setPaddingChar( char paddingChar )
|
||||
{
|
||||
fPaddingChar = paddingChar;
|
||||
if ( getMemoryBlock() != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
getMemoryBlock().reformat( getMemoryBlock().getFormat(),
|
||||
getMemoryBlock().getWordSize(),
|
||||
getMemoryBlock().getNumberOfRows(),
|
||||
getMemoryBlock().getNumberOfColumns(),
|
||||
fPaddingChar );
|
||||
}
|
||||
catch( DebugException e )
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setWordSize( int wordSize )
|
||||
|
|
Loading…
Add table
Reference in a new issue