Created
January 8, 2018 08:38
-
-
Save Bloofer/9759850cd211f056910f343eb93e78cb to your computer and use it in GitHub Desktop.
Deckard clone snippet #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int getDefaultRowSize() { | |
int rowSize = DebugUITools.getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_ROW_SIZE); | |
int bytePerLine = rowSize * getAddressableSize(); | |
// check synchronized row size | |
Integer size = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE); | |
if (size != null) | |
{ | |
// row size is stored as actual number of bytes in synchronizer | |
int syncRowSize = size.intValue(); | |
if (syncRowSize > 0) | |
{ | |
bytePerLine = syncRowSize; | |
} | |
} | |
else | |
{ | |
int defaultRowSize = -1; | |
IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class); | |
if (elmt != null) | |
{ | |
if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL)) | |
{ | |
defaultRowSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL); | |
return defaultRowSize * getAddressableSize(); | |
} | |
} | |
if (defaultRowSize <= 0) | |
// no synchronized property, ask preference store by id | |
defaultRowSize = getDefaultRowSizeByModel(getMemoryBlock().getModelIdentifier()); | |
if (defaultRowSize > 0) | |
bytePerLine = defaultRowSize * getAddressableSize(); | |
} | |
return bytePerLine; | |
} | |
/** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment