Package org.eclipse.debug.ui.memory
Class AbstractTextRendering
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.debug.ui.memory.AbstractMemoryRendering
org.eclipse.debug.internal.ui.views.memory.renderings.AbstractBaseTableRendering
org.eclipse.debug.ui.memory.AbstractTableRendering
org.eclipse.debug.ui.memory.AbstractTextRendering
- All Implemented Interfaces:
EventListener
,IAdaptable
,IMemoryRendering
,IRepositionableMemoryRendering
,IResettableMemoryRendering
,IPropertyChangeListener
Abstract implementation of a rendering that translates memory into
text, displayed in a table.
Clients should subclass from this class if they wish to provide a table text rendering with a specific code page.
- Since:
- 3.1
-
Field Summary
Fields inherited from class org.eclipse.debug.ui.memory.AbstractTableRendering
PROPERTY_COL_SIZE, PROPERTY_ROW_SIZE, PROPERTY_SELECTED_ADDRESS, PROPERTY_TOP_ADDRESS
-
Constructor Summary
ConstructorDescriptionAbstractTextRendering
(String renderingId) Constructs a text rendering of the specified type.AbstractTextRendering
(String renderingId, String codePage) Constructs a text rendering of the specified type on the given code page. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getBytes
(String dataType, BigInteger address, MemoryByte[] currentValues, String data) Returns bytes for the given text corresponding to bytes at the given address for the specified rendering type.Returns the current code page used by this rendering.getString
(String dataType, BigInteger address, MemoryByte[] data) Returns text for the given memory bytes at the specified address for the specified rendering type.void
setCodePage
(String codePage) Sets the code page for this rendering.Methods inherited from class org.eclipse.debug.ui.memory.AbstractTableRendering
becomesHidden, becomesVisible, createActions, createControl, createToolTipControl, displayError, displayTable, dispose, fillContextMenu, format, getAdapter, getAddressableSize, getAddressableUnitPerColumn, getAddressableUnitPerLine, getBytesPerColumn, getBytesPerLine, getColorProviderAdapter, getControl, getFontProviderAdapter, getLabel, getLabelProviderAdapter, getNumCharsPerByte, getSelectedAddress, getSelectedAsBytes, getSelectedAsString, getTablePresentationAdapter, getTableViewer, getToolTipText, goToAddress, isDisplayingError, propertyChange, refresh, reset, resetRendering, resizeColumnsToPreferredSize, toolTipAboutToShow, updateLabels, updateRenderingLabel
Methods inherited from class org.eclipse.debug.ui.memory.AbstractMemoryRendering
activated, addPropertyChangeListener, createPopupMenu, deactivated, decorateImage, decorateLabel, firePropertyChangedEvent, getImage, getMemoryBlock, getMemoryRenderingContainer, getPopupMenuManager, getRenderingId, init, isVisible, removePropertyChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.debug.ui.memory.IMemoryRendering
activated, addPropertyChangeListener, deactivated, getImage, getMemoryBlock, getRenderingId, init, removePropertyChangeListener
-
Constructor Details
-
AbstractTextRendering
Constructs a text rendering of the specified type.- Parameters:
renderingId
- memory rendering type identifier
-
AbstractTextRendering
Constructs a text rendering of the specified type on the given code page.- Parameters:
renderingId
- memory rendering type identifiercodePage
- the name of a supportedcharset
, for example
CP1252
-
-
Method Details
-
setCodePage
Sets the code page for this rendering. This does not cause the rendering to be updated with the new code page. Clients need to update the rendering manually when the code page is changed.- Parameters:
codePage
- the name of a supportedcharset
, for example
CP1252
-
getCodePage
Returns the current code page used by this rendering. Returns null if not set.- Returns:
- Returns the current code page used by this rendering. Returns null if not set.
-
getString
Description copied from class:AbstractTableRendering
Returns text for the given memory bytes at the specified address for the specified rendering type. This is called by the label provider for. Subclasses must override.- Specified by:
getString
in classAbstractTableRendering
- Parameters:
dataType
- rendering type identifieraddress
- address where the bytes belong todata
- the bytes- Returns:
- a string to represent the memory. Cannot not return
null
. Returns a string to pad the cell if the memory cannot be converted successfully.
-
getBytes
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) Description copied from class:AbstractTableRendering
Returns bytes for the given text corresponding to bytes at the given address for the specified rendering type. This is called by the cell modifier when modifying bytes in a memory block. Subclasses must convert the string value to an array of bytes. The bytes will be passed to the debug adapter for memory block modification. Returnsnull
if the bytes cannot be formatted properly.- Specified by:
getBytes
in classAbstractTableRendering
- Parameters:
dataType
- rendering type identifieraddress
- address the bytes begin atcurrentValues
- current values of the data in bytes formatdata
- the string to be converted to bytes- Returns:
- the bytes converted from a string
-