Skip to main content
summaryrefslogtreecommitdiffstats
path: root/memory
diff options
context:
space:
mode:
authorJohn Cortell2010-05-17 16:01:01 -0400
committerJohn Cortell2010-05-17 16:01:01 -0400
commitccb7b7ed22e1933c403ac9d0f3e29d74dab58f13 (patch)
tree43a64eb889cdee83376f7680f07c867a39f6d972 /memory
parenta491012509b6899750abba903c5351c947fdfa48 (diff)
downloadorg.eclipse.cdt-ccb7b7ed22e1933c403ac9d0f3e29d74dab58f13.tar.gz
org.eclipse.cdt-ccb7b7ed22e1933c403ac9d0f3e29d74dab58f13.tar.xz
org.eclipse.cdt-ccb7b7ed22e1933c403ac9d0f3e29d74dab58f13.zip
Bug 312098: do not create a rendering automatically when Memory Browser is opened (fixed regression to memory space support)
Diffstat (limited to 'memory')
-rw-r--r--memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java62
1 files changed, 37 insertions, 25 deletions
diff --git a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
index 2bb7198b50..1b6d3e9338 100644
--- a/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
+++ b/memory/org.eclipse.cdt.debug.ui.memory.memorybrowser/src/org/eclipse/cdt/debug/ui/memory/memorybrowser/MemoryBrowser.java
@@ -771,33 +771,41 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
return;
}
- CTabItem tabItem = activeFolder.getSelection();
- if (tabItem != null) {
- if(memorySpaces.length > 0) {
- fGotoMemorySpaceControl.setVisible(true);
- fGotoMemorySpaceControl.setItems(memorySpaces);
-
- // the n/a entry; don't think this needs to be translated
- fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0); //$NON-NLS-1$
- }
- else {
- fGotoMemorySpaceControl.setVisible(false);
- fGotoMemorySpaceControl.setItems(new String[0]);
- }
-
- updateMemorySpaceControlSelection(tabItem);
+ if (memorySpaces.length > 0) {
+ fGotoMemorySpaceControl.setItems(memorySpaces);
+ fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0); //$NON-NLS-1$ the n/a entry; don't think this needs to be translated
+ setMemorySpaceControlVisible(true);
+ }
+ else {
+ fGotoMemorySpaceControl.setItems(new String[0]);
+ setMemorySpaceControlVisible(false);
}
+
+ updateMemorySpaceControlSelection(activeFolder.getSelection());
+
fStackLayout.topControl.getParent().layout(true);
}
});
}
+
+ private void setMemorySpaceControlVisible(boolean visible) {
+ FormData data = (FormData)fGotoAddressBarControl.getLayoutData();
+ if (visible) {
+ data.left = new FormAttachment(fGotoMemorySpaceControl);
+ }
+ else {
+ data.left = new FormAttachment(0);
+ }
+ fGotoMemorySpaceControl.setVisible(visible);
+
+ }
/**
* Update the selection in the memory space combobox to reflect the memory
* space being shown in the given tab
*
* @param item
- * the active tab
+ * the active tab; may be null if in a "fresh" memory browser instance
*/
private void updateMemorySpaceControlSelection(CTabItem item) {
String[] memorySpaces = fGotoMemorySpaceControl.getItems();
@@ -806,20 +814,24 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
// is one of the ones now available. If it isn't, then select
// the first available one and update the tab data
boolean foundIt = false;
- String currentMemorySpace = (String) item.getData(KEY_MEMORY_SPACE);
- if (currentMemorySpace != null) {
- assert currentMemorySpace.length() > 0;
- for (String memorySpace : memorySpaces) {
- if (memorySpace.equals(currentMemorySpace)) {
- foundIt = true;
- fGotoMemorySpaceControl.setText(currentMemorySpace);
- break;
+ if (item != null) {
+ String currentMemorySpace = (String) item.getData(KEY_MEMORY_SPACE);
+ if (currentMemorySpace != null) {
+ assert currentMemorySpace.length() > 0;
+ for (String memorySpace : memorySpaces) {
+ if (memorySpace.equals(currentMemorySpace)) {
+ foundIt = true;
+ fGotoMemorySpaceControl.setText(currentMemorySpace);
+ break;
+ }
}
}
}
if (!foundIt) {
fGotoMemorySpaceControl.select(0);
- item.setData(KEY_MEMORY_SPACE, null);
+ if (item != null) {
+ item.setData(KEY_MEMORY_SPACE, null);
+ }
}
fGotoMemorySpaceControl.setVisible(true);
}

Back to the top