Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 20805 Details for
Bug 74559
[README] Memory View does not scroll properly on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch to org.eclipse.debug.ui
ui_507a.txt (text/plain), 68.83 KB, created by
Samantha Chan
on 2005-05-07 19:04:43 EDT
(
hide
)
Description:
patch to org.eclipse.debug.ui
Filename:
MIME Type:
Creator:
Samantha Chan
Created:
2005-05-07 19:04:43 EDT
Size:
68.83 KB
patch
obsolete
>Index: plugin.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/plugin.properties,v >retrieving revision 1.191 >diff -u -r1.191 plugin.properties >--- plugin.properties 6 May 2005 17:33:19 -0000 1.191 >+++ plugin.properties 7 May 2005 22:54:47 -0000 >@@ -328,8 +328,8 @@ > BreakpointWorkingSet.name=Breakpoint > > memoryRenderingsExtensionPointName = Memory Renderings >-SetDefaultColumnSizeActionName =Set Default Column Size ... > SetPaddedStrActionName = Set Padded String ... >+TableRenderingPrefActionName = Table Renderings Preferences... > > DropToFrameAction.label=Drop to Frame > DropToFrameAction.tooltip=Drop to Frame >Index: plugin.xml >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/plugin.xml,v >retrieving revision 1.328 >diff -u -r1.328 plugin.xml >--- plugin.xml 6 May 2005 17:33:16 -0000 1.328 >+++ plugin.xml 7 May 2005 22:54:47 -0000 >@@ -883,6 +883,14 @@ > style="toggle" > id="org.eclipse.debug.ui.linkrenderingpanes"/> > <action >+ class="org.eclipse.debug.internal.ui.views.memory.renderings.TableRenderingPrefAction" >+ helpContextId="TableRenderingPrefAction_context" >+ id="org.eclipse.debug.ui.tablerendering.preferencesaction" >+ label="%TableRenderingPrefActionName" >+ menubarPath="additions" >+ style="push" >+ tooltip="%TableRenderingPrefActionName"/> >+ <action > disabledIcon="icons/full/dlcl16/det_pane_right.gif" > hoverIcon="icons/full/elcl16/det_pane_right.gif" > toolbarPath="RenderingPanesGroup" >@@ -893,14 +901,6 @@ > style="toggle" > id="org.eclipse.debug.ui.togglesplitpane"/> > <action >- helpContextId="DefaultColumnSizePrefAction_context" >- label="%SetDefaultColumnSizeActionName" >- class="org.eclipse.debug.internal.ui.views.memory.renderings.SetDefaultColumnSizePrefAction" >- tooltip="%SetDefaultColumnSizeActionName" >- style="push" >- menubarPath="additions" >- id="org.eclipse.debug.ui.setDefaultColumnSize"/> >- <action > helpContextId="SetPaddedStrAction_context" > label="%SetPaddedStrActionName" > class="org.eclipse.debug.internal.ui.views.memory.renderings.SetPaddedStringAction" >Index: ui/org/eclipse/debug/internal/ui/DebugUIMessages.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.java,v >retrieving revision 1.9 >diff -u -r1.9 DebugUIMessages.java >--- ui/org/eclipse/debug/internal/ui/DebugUIMessages.java 4 May 2005 20:16:39 -0000 1.9 >+++ ui/org/eclipse/debug/internal/ui/DebugUIMessages.java 7 May 2005 22:54:47 -0000 >@@ -98,8 +98,6 @@ > public static String MonitorMemoryBlockDialog_NumberOfBytes; > public static String GoToAddressDialog_Address; > public static String GoToAddressDialog_GoToAddress; >- public static String DefaultColumnSizeDialog_DefaultColumnSize; >- public static String DefaultColumnSizeDialog_ColumnSize; > public static String CodePagesPrefDialog_1; > public static String CodePagesPrefDialog_2; > public static String CodePagesPrefDialog_3; >@@ -161,7 +159,9 @@ > public static String AbstractTableRendering_1; > public static String AbstractTableRendering_2; > public static String AbstractTableRendering_3; >+ public static String AbstractTableRendering_4; > public static String AbstractTableRendering_5; >+ public static String AbstractTableRendering_6; > public static String AbstractTableRendering_8; > public static String AbstractTableRendering_9; > public static String AbstractTableRendering_10; >@@ -198,6 +198,12 @@ > public static String TableRenderingPropertiesPage_23; > public static String TableRenderingPropertiesPage_25; > public static String TableRenderingPropertiesPage_26; >+ public static String TableRenderingPrefAction_0; >+ public static String TableRenderingPreferencePage_0; >+ public static String TableRenderingPreferencePage_1; >+ public static String TableRenderingPreferencePage_2; >+ public static String TableRenderingPreferencePage_3; >+ public static String TableRenderingPreferencePage_4; > > static { > // load message values from bundle file >@@ -205,4 +211,5 @@ > } > > >+ > } >\ No newline at end of file >Index: ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties,v >retrieving revision 1.91 >diff -u -r1.91 DebugUIMessages.properties >--- ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties 26 Apr 2005 16:51:52 -0000 1.91 >+++ ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties 7 May 2005 22:54:47 -0000 >@@ -93,8 +93,6 @@ > MonitorMemoryBlockDialog_NumberOfBytes = Number of bytes: > GoToAddressDialog_Address = Address: > GoToAddressDialog_GoToAddress = Go To Address... >-DefaultColumnSizeDialog_DefaultColumnSize = Default Column Size >-DefaultColumnSizeDialog_ColumnSize = &Column Size: > CodePagesPrefDialog_1=Select Codepages > CodePagesPrefDialog_2=Codepage for rendering memory to ASCII strings: > CodePagesPrefDialog_3=Change... >@@ -159,6 +157,8 @@ > AbstractTableRendering_5=Column Size > AbstractTableRendering_8=Unknown > AbstractTableRendering_9=Unknown >+AbstractTableRendering_4=Next Page >+AbstractTableRendering_6=Previous Page > AbstractTableRendering_10=Unable to get base address. > AbstractTableRendering_11=Address is out of range. > AbstractTableRendering_12=Reset Failed. >@@ -191,3 +191,9 @@ > TableRenderingPropertiesPage_23=Writable: > TableRenderingPropertiesPage_25=Line Address: > TableRenderingPropertiesPage_26=Units Per Line: >+TableRenderingPreferencePage_0=&Column Size: >+TableRenderingPreferencePage_1=Automatically load next page of memory when scrolled to end of buffer >+TableRenderingPreferencePage_2=Number of Lines per Page: >+TableRenderingPreferencePage_3=Page size cannot be less than 1. >+TableRenderingPreferencePage_4=Page size is invalid. >+TableRenderingPrefAction_0=Table Renderings >Index: ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java,v >retrieving revision 1.15 >diff -u -r1.15 DebugUIPreferenceInitializer.java >--- ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java 2 May 2005 22:05:20 -0000 1.15 >+++ ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java 7 May 2005 22:54:47 -0000 >@@ -12,6 +12,7 @@ > > import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; > import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; >+import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil; > import org.eclipse.debug.ui.IDebugUIConstants; > import org.eclipse.jface.dialogs.MessageDialogWithToggle; > import org.eclipse.jface.preference.IPreferenceStore; >@@ -102,5 +103,12 @@ > IDebugPreferenceConstants.DEFAULT_ASCII_CP); > prefs.setDefault(IDebugUIConstants.PREF_DEFAULT_EBCDIC_CODE_PAGE, > IDebugPreferenceConstants.DEFAULT_EBCDIC_CP); >+ >+ if (MemoryViewUtil.isLinuxGTK()) >+ prefs.setDefault(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, false); >+ else >+ prefs.setDefault(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, true); >+ >+ prefs.setDefault(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE, IDebugPreferenceConstants.DEFAULT_PAGE_SIZE); > } > } >Index: ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java,v >retrieving revision 1.60 >diff -u -r1.60 IInternalDebugUIConstants.java >--- ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java 26 Apr 2005 21:42:05 -0000 1.60 >+++ ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java 7 May 2005 22:54:47 -0000 >@@ -274,4 +274,11 @@ > * @since 3.1 > */ > public static final String ID_BREAKPOINT_WORKINGSET = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$ >+ >+ >+ /** >+ * Address at the beginning of a page in a table rendering. >+ * @since 3.1 >+ */ >+ public static final String PROPERTY_PAGE_START_ADDRESS = "pageStart"; //$NON-NLS-1$ > } >Index: ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java,v >retrieving revision 1.34 >diff -u -r1.34 IDebugPreferenceConstants.java >--- ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java 6 Apr 2005 18:48:25 -0000 1.34 >+++ ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java 7 May 2005 22:54:47 -0000 >@@ -162,6 +162,30 @@ > * @since 3.1 > */ > public static final String DEFAULT_EBCDIC_CP = "CP037"; //$NON-NLS-1$ >+ >+ /** >+ * Preference to determine if table rendering should dynamically load >+ * memory as the user scrolls >+ * >+ * @since 3.1 >+ */ >+ public static final String PREF_DYNAMIC_LOAD_MEM = "org.eclpise.debug.ui.memory.dynamicLoad"; //$NON-NLS-1$ >+ >+ >+ /** >+ * Size of buffer in a table rendering when dynamic loading mode is off. >+ * >+ * @since 3.1 >+ */ >+ public static final String PREF_TABLE_RENDERING_PAGE_SIZE = "org.eclispe.debug.ui.memory.pageSize"; //$NON-NLS-1$ >+ >+ /** >+ * Default page size when dynamic loading mode is off. This preference is stored >+ * in number of lines. >+ * >+ * @since 3.1 >+ */ >+ public static final int DEFAULT_PAGE_SIZE = 20; > } > > >Index: ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java,v >retrieving revision 1.9 >diff -u -r1.9 MemoryViewUtil.java >--- ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java 24 Feb 2005 06:43:47 -0000 1.9 >+++ ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java 7 May 2005 22:54:47 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.debug.internal.ui.views.memory; > >+import java.math.BigInteger; >+ > import org.eclipse.core.runtime.Platform; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.IMemoryBlockManager; >@@ -22,7 +24,6 @@ > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.swt.SWT; > import org.eclipse.swt.widgets.Shell; >-import org.eclipse.swt.widgets.Table; > > /** > * Util class for Memory View >@@ -140,22 +141,9 @@ > { > return DebugPlugin.getDefault().getMemoryBlockManager(); > } >- >- >- static public void linuxWorkAround(Table table) >- { >- if (table == null) >- return; >- >- if (table.isDisposed()) >- return; >- >- if(isLinuxGTK()) >- while(table.getDisplay().readAndDispatch()){} >- } > > static public boolean isLinuxGTK() >- { >+ { > String ws = Platform.getWS(); > return ws.equals(Platform.WS_GTK); > } >@@ -174,4 +162,16 @@ > return true; > } > >+ public static BigInteger alignDoubleWordBoundary(BigInteger integer) >+ { >+ String str =integer.toString(16); >+ if (!str.endsWith("0")) //$NON-NLS-1$ >+ { >+ str = str.substring(0, str.length() - 1); >+ str += "0"; //$NON-NLS-1$ >+ integer = new BigInteger(str, 16); >+ } >+ >+ return integer; >+ } > } >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultColumnSizeDialog.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultColumnSizeDialog.java >diff -N ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultColumnSizeDialog.java >--- ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultColumnSizeDialog.java 7 Apr 2005 16:23:48 -0000 1.4 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,107 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2005 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >- >-package org.eclipse.debug.internal.ui.views.memory.renderings; >- >-import org.eclipse.debug.internal.ui.DebugUIMessages; >-import org.eclipse.debug.internal.ui.DebugUIPlugin; >-import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; >-import org.eclipse.debug.ui.IDebugUIConstants; >-import org.eclipse.jface.dialogs.Dialog; >-import org.eclipse.jface.preference.IPreferenceStore; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.layout.GridData; >-import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Combo; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Shell; >-import org.eclipse.ui.PlatformUI; >- >-/** >- * Dialog for setting default column size in Memory View >- * @since 3.0 >- */ >-public class DefaultColumnSizeDialog extends Dialog { >- >- IPreferenceStore fPrefStore; >- Combo fColumnSize; >- >- private int[] fColumnSizes = new int[] {1, 2, 4, 8, 16}; >- >- /** >- * @param parentShell >- */ >- protected DefaultColumnSizeDialog(Shell parentShell) { >- super(parentShell); >- setShellStyle(getShellStyle() | SWT.RESIZE); >- fPrefStore = DebugUIPlugin.getDefault().getPreferenceStore(); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) >- */ >- protected Control createDialogArea(Composite parent) { >- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".DefaultColumnSizeDialog_context"); //$NON-NLS-1$ >- >- getShell().setText(DebugUIMessages.DefaultColumnSizeDialog_DefaultColumnSize); >- >- Composite content = (Composite) super.createDialogArea(parent); >- GridLayout layout = new GridLayout(); >- layout.numColumns = 2; >- content.setLayout(layout); >- >- Label textLabel = new Label(content, SWT.NONE); >- textLabel.setText(DebugUIMessages.DefaultColumnSizeDialog_ColumnSize); >- >- GridData textLayout = new GridData(); >- textLabel.setLayoutData(textLayout); >- >- fColumnSize = new Combo(content, SWT.BORDER|SWT.READ_ONLY); >- >- GridData columnLayout= new GridData(); >- fColumnSize.setLayoutData(columnLayout); >- >- for (int i=0; i<fColumnSizes.length; i++) >- { >- fColumnSize.add(String.valueOf(fColumnSizes[i])); >- } >- >- int colSize = fPrefStore.getInt(IDebugPreferenceConstants.PREF_COLUMN_SIZE); >- int idx = 0; >- >- for (int i=0; i<fColumnSizes.length; i++) >- { >- if (fColumnSizes[i] == colSize) >- { >- idx = i; >- break; >- } >- } >- >- fColumnSize.select(idx); >- >- return content; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.jface.dialogs.Dialog#okPressed() >- */ >- protected void okPressed() { >- int idx = fColumnSize.getSelectionIndex(); >- int colSize = fColumnSizes[idx]; >- >- fPrefStore.setValue(IDebugPreferenceConstants.PREF_COLUMN_SIZE, colSize); >- >- super.okPressed(); >- } >-} >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/SetDefaultColumnSizePrefAction.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/views/memory/renderings/SetDefaultColumnSizePrefAction.java >diff -N ui/org/eclipse/debug/internal/ui/views/memory/renderings/SetDefaultColumnSizePrefAction.java >--- ui/org/eclipse/debug/internal/ui/views/memory/renderings/SetDefaultColumnSizePrefAction.java 24 Feb 2005 06:43:47 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,50 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2004, 2005 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.debug.internal.ui.views.memory.renderings; >- >-import org.eclipse.debug.internal.ui.DebugUIPlugin; >-import org.eclipse.jface.action.IAction; >-import org.eclipse.jface.viewers.ISelection; >-import org.eclipse.swt.widgets.Shell; >-import org.eclipse.ui.IViewActionDelegate; >-import org.eclipse.ui.IViewPart; >- >- >-/** >- * Action for setting default column size in a table rendering >- * @since 3.0 >- * >- */ >-public class SetDefaultColumnSizePrefAction implements IViewActionDelegate { >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) >- */ >- public void init(IViewPart view) { >- >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) >- */ >- public void run(IAction action) { >- Shell shell = DebugUIPlugin.getShell(); >- DefaultColumnSizeDialog dialog = new DefaultColumnSizeDialog(shell); >- dialog.open(); >- >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) >- */ >- public void selectionChanged(IAction action, ISelection selection) { >- } >-} >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java,v >retrieving revision 1.5 >diff -u -r1.5 TableRenderingContentInput.java >--- ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java 31 Mar 2005 14:16:41 -0000 1.5 >+++ ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java 7 May 2005 22:54:47 -0000 >@@ -29,7 +29,7 @@ > private int fPostBuffer; // number of lines after thes last visible line > private int fDefaultBufferSize; > private BigInteger fLoadAddress; // Top address to load at the table >- private int fNumVisibleLines; // number of visible lines >+ private int fNumLines; // number of visible lines > private boolean fUpdateDelta; // should the content provider calculate delta info > private BigInteger fMemoryBlockBaseAddress; // base address of the memory block when this input is set > private BigInteger fStartAddress; >@@ -41,7 +41,7 @@ > fPreBuffer = preBuffer; > fPostBuffer = postBuffer; > fLoadAddress = loadAddress; >- fNumVisibleLines = numOfLines; >+ fNumLines = numOfLines; > fDefaultBufferSize = defaultBufferSize; > fUpdateDelta = updateDelta; > >@@ -52,9 +52,7 @@ > DebugUIPlugin.log(e); > } > } >- public int getNumVisibleLines() { >- return fNumVisibleLines; >- } >+ > public int getPostBuffer() { > return fPostBuffer; > } >@@ -176,4 +174,14 @@ > } > return fEndAddress; > } >+ >+ public int getNumLines() >+ { >+ return fNumLines; >+ } >+ >+ public void setNumLines(int numLines) >+ { >+ fNumLines = numLines; >+ } > } >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java,v >retrieving revision 1.9 >diff -u -r1.9 TableRenderingContentProvider.java >--- ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java 7 Apr 2005 16:23:48 -0000 1.9 >+++ ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java 7 May 2005 22:54:47 -0000 >@@ -28,6 +28,8 @@ > import org.eclipse.debug.internal.ui.DebugUIMessages; > import org.eclipse.debug.internal.ui.DebugUIPlugin; > import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; >+import org.eclipse.debug.internal.ui.memory.IMemoryRenderingUpdater; >+import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; > import org.eclipse.debug.ui.IDebugUIConstants; > import org.eclipse.jface.viewers.StructuredViewer; > import org.eclipse.jface.viewers.Viewer; >@@ -51,6 +53,8 @@ > private TableRenderingContentInput fInput; > private BigInteger fBufferEndAddress; > >+ private boolean fDynamicLoad; >+ > /** > * @param memoryBlock > * @param newTab >@@ -59,6 +63,7 @@ > { > lineCache = new Vector(); > contentCache = new Hashtable(); >+ initializeDynamicLoad(); > > DebugPlugin.getDefault().addDebugEventListener(this); > } >@@ -93,11 +98,7 @@ > } > > public void dispose() { >- >- // fTabItem disposed by view tab >- > DebugPlugin.getDefault().removeDebugEventListener(this); >- > super.dispose(); > } > >@@ -133,7 +134,7 @@ > /** > * @throws DebugException > */ >- private void loadContentForSimpleMemoryBlock() throws DebugException { >+ public void loadContentForSimpleMemoryBlock() throws DebugException { > // get as much memory as the memory block can handle > fInput.setPreBuffer(0); > fInput.setPostBuffer(0); >@@ -148,7 +149,8 @@ > /** > * @throws DebugException > */ >- private void loadContentForExtendedMemoryBlock() throws DebugException { >+ public void loadContentForExtendedMemoryBlock() throws DebugException { >+ > // calculate top buffered address > BigInteger loadAddress = fInput.getLoadAddress(); > if (loadAddress == null) >@@ -162,17 +164,34 @@ > int addressableUnitsPerLine = fInput.getMemoryRendering().getAddressableUnitPerLine(); > BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(fInput.getPreBuffer()*addressableUnitsPerLine)); > BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fInput.getPostBuffer()*addressableUnitsPerLine)); >- bufferEnd = bufferEnd.add(BigInteger.valueOf(fInput.getNumVisibleLines()*addressableUnitsPerLine)); >- >- if (bufferStart.compareTo(mbStart) < 0) >- bufferStart = mbStart; >- >- if (bufferEnd.compareTo(mbEnd) > 0) >- bufferEnd = mbEnd; >+ bufferEnd = bufferEnd.add(BigInteger.valueOf(fInput.getNumLines()*addressableUnitsPerLine)); > >- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1; >- // get stoarage to fit the memory view tab size >- getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta()); >+ if (isDynamicLoad()) >+ { >+ if (bufferStart.compareTo(mbStart) < 0) >+ bufferStart = mbStart; >+ >+ if (bufferEnd.compareTo(mbEnd) > 0) >+ bufferEnd = mbEnd; >+ >+ int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1; >+ // get stoarage to fit the memory view tab size >+ getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta()); >+ } >+ else >+ { >+ if (bufferStart.compareTo(mbStart) < 0) >+ bufferStart = mbStart; >+ >+ if (bufferEnd.compareTo(mbEnd) > 0) >+ { >+ bufferStart = mbEnd.subtract(BigInteger.valueOf((fInput.getNumLines()-1)*addressableUnitsPerLine)); >+ } >+ >+ int numLines = fInput.getNumLines(); >+ // get stoarage to fit the memory view tab size >+ getMemoryToFitTable(bufferStart, numLines, fInput.isUpdateDelta()); >+ } > } > > /** >@@ -523,6 +542,15 @@ > */ > protected void doHandleDebugEvent(DebugEvent event) { > >+ if (fInput.getMemoryRendering().isVisible()) >+ { >+ // only do this if it's visible >+ // still need to clear content cache if the rendering >+ // is not visible >+ if (isUpdateManagedByMB()) >+ return; >+ } >+ > // do nothing if the debug event did not come from a debug element comes from non-debug element > if (!(event.getSource() instanceof IDebugElement)) > return; >@@ -546,7 +574,7 @@ > } > } > >- // if the suspend evnet happens from the debug target that the blocked >+ // if the suspend evnet happens from the debug target that the > // memory block belongs to > if (event.getKind() == DebugEvent.SUSPEND && src.getDebugTarget() == fInput.getMemoryBlock().getDebugTarget()) > { >@@ -559,7 +587,7 @@ > * Update content of the view tab if the content of the memory block has changed > * or if its base address has changed > * Update will not be performed if the memory block has not been changed or >- * if the view tab is disabled. >+ * if the rendering is not visible > */ > public void updateContent() > { >@@ -571,6 +599,21 @@ > return; > } > >+ takeContentSnapshot(); >+ >+ //do not handle event if the rendering is not visible >+ if (!fInput.getMemoryRendering().isVisible()) >+ return; >+ >+ fInput.getMemoryRendering().refresh(); >+ >+ } >+ >+ /** >+ * Take a snapshot on the content, marking the lines as monitored >+ */ >+ public void takeContentSnapshot() >+ { > // cache content before getting new ones > TableRenderingLine[] lines =(TableRenderingLine[]) lineCache.toArray(new TableRenderingLine[lineCache.size()]); > if (contentCache != null) >@@ -598,8 +641,6 @@ > // This will ensure that changes will be recomputed when user scrolls > // up or down the memory view. > resetDeltas(); >- fInput.getMemoryRendering().refresh(); >- > } > > /** >@@ -703,4 +744,43 @@ > { > contentCache.clear(); > } >+ >+ /** >+ * @return if the memory block would manage its own update. >+ */ >+ private boolean isUpdateManagedByMB() >+ { >+ IMemoryBlock memoryBlock = getMemoryBlock(); >+ >+ IMemoryRenderingUpdater managedMB = null; >+ if (memoryBlock instanceof IMemoryRenderingUpdater) >+ { >+ managedMB = (IMemoryRenderingUpdater)memoryBlock; >+ } >+ >+ if (managedMB == null) >+ managedMB = (IMemoryRenderingUpdater)memoryBlock.getAdapter(IMemoryRenderingUpdater.class); >+ >+ // do not handle event if if the memory block wants to do its >+ // own update >+ if (managedMB != null && managedMB.supportsManagedUpdate(fInput.getMemoryRendering())) >+ return true; >+ >+ return false; >+ } >+ >+ public boolean isDynamicLoad() >+ { >+ return fDynamicLoad; >+ } >+ >+ private void initializeDynamicLoad() >+ { >+ fDynamicLoad = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); >+ } >+ >+ public void setDynamicLoad(boolean dynamicLoad) >+ { >+ fDynamicLoad = dynamicLoad; >+ } > } >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java,v >retrieving revision 1.1 >diff -u -r1.1 TableRenderingPropertiesPage.java >--- ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java 26 Apr 2005 16:51:52 -0000 1.1 >+++ ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java 7 May 2005 22:54:47 -0000 >@@ -19,7 +19,7 @@ > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.Text; >+import org.eclipse.swt.widgets.Label; > import org.eclipse.ui.IWorkbenchPropertyPage; > import org.eclipse.ui.dialogs.PropertyPage; > >@@ -161,9 +161,9 @@ > > private void addProperty(Composite composite, String labelStr, String contentStr) > { >- Text label = new Text(composite, SWT.READ_ONLY); >+ Label label = new Label(composite, SWT.NONE); > label.setText(labelStr); >- Text text = new Text(composite, SWT.READ_ONLY | SWT.WRAP ); >+ Label text = new Label(composite, SWT.WRAP ); > text.setText(contentStr); > } > >Index: ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java,v >retrieving revision 1.10 >diff -u -r1.10 AbstractMemoryRendering.java >--- ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java 26 Apr 2005 16:51:52 -0000 1.10 >+++ ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java 7 May 2005 22:54:47 -0000 >@@ -79,6 +79,12 @@ > */ > public void dispose() > { >+ // disconnect from memory block when rendering is disposed >+ if (fMemoryBlock instanceof IMemoryBlockExtension) >+ { >+ ((IMemoryBlockExtension)fMemoryBlock).disconnect(this); >+ } >+ > if (fPropertyListeners != null) > fPropertyListeners.clear(); > } >Index: ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java,v >retrieving revision 1.16 >diff -u -r1.16 AbstractTableRendering.java >--- ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java 26 Apr 2005 16:51:52 -0000 1.16 >+++ ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java 7 May 2005 22:54:47 -0000 >@@ -22,6 +22,7 @@ > import org.eclipse.debug.internal.ui.DebugUIMessages; > import org.eclipse.debug.internal.ui.DebugUIPlugin; > import org.eclipse.debug.internal.ui.IInternalDebugUIConstants; >+import org.eclipse.debug.internal.ui.memory.IMemoryBlockConnection; > import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; > import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil; > import org.eclipse.debug.internal.ui.views.memory.renderings.CopyTableRenderingToClipboardAction; >@@ -183,12 +184,17 @@ > private KeyAdapter fEditorKeyListener; > private SelectionAdapter fCursorSelectionListener; > private IWorkbenchAdapter fWorkbenchAdapter; >+ private IMemoryBlockConnection fConnection; > > private boolean fIsShowAddressColumn = true; > private SelectionAdapter fScrollbarSelectionListener; > > private PropertyDialogAction fPropertiesAction; > >+ private int fPageSize; >+ private NextPageAction fNextAction; >+ private PrevPageAction fPrevAction; >+ > private class EventHandleLock > { > Object fOwner; >@@ -252,6 +258,39 @@ > } > } > >+ >+ private class NextPageAction extends Action >+ { >+ private NextPageAction() >+ { >+ super(); >+ setText(DebugUIMessages.AbstractTableRendering_4); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".NextPageAction_context"); //$NON-NLS-1$ >+ } >+ >+ public void run() { >+ BigInteger address = fContentInput.getLoadAddress(); >+ address = address.add(BigInteger.valueOf(getPageSizeInUnits())); >+ handlePageStartAddressChanged(address); >+ } >+ } >+ >+ private class PrevPageAction extends Action >+ { >+ private PrevPageAction() >+ { >+ super(); >+ setText(DebugUIMessages.AbstractTableRendering_6); >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrevPageAction_context"); //$NON-NLS-1$ >+ } >+ >+ public void run() { >+ BigInteger address = fContentInput.getLoadAddress(); >+ address = address.subtract(BigInteger.valueOf(getPageSizeInUnits())); >+ handlePageStartAddressChanged(address); >+ } >+ } >+ > /** > * Constructs a new table rendering of the specified type. > * >@@ -288,6 +327,11 @@ > > Object evtSrc = event.getSource(); > >+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) { >+ // always update page size, only refresh if the table is visible >+ getPageSizeFromPreference(); >+ } >+ > // do not handle event if the rendering is displaying an error > if (isDisplayingError()) > return; >@@ -296,6 +340,20 @@ > if (!isVisible()) > return; > >+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)) { >+ handleDyanicLoadChanged(); >+ return; >+ } >+ >+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) { >+ if (!isDynamicLoad()) >+ { >+ // only refresh if in non-autoload mode >+ refresh(); >+ } >+ return; >+ } >+ > if (evtSrc == this) > return; > >@@ -324,10 +382,63 @@ > { > if (needMoreLines()) > { >- reloadTable(getTopVisibleAddress(), false); >+ if (isDynamicLoad()) >+ reloadTable(getTopVisibleAddress(), false); > } > topVisibleAddressChanged((BigInteger)value); > } >+ else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger) >+ { >+ handlePageStartAddressChanged((BigInteger)value); >+ } >+ } >+ >+ private void handleDyanicLoadChanged() { >+ >+ // if currently in dynamic load mode, update page >+ // start address >+ updateSyncPageStartAddress(); >+ >+ updateDynamicLoadProperty(); >+ if (isDynamicLoad()) >+ { >+ refresh(); >+ } >+ else >+ { >+ BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS); >+ if (pageStart == null) >+ pageStart = fTopRowAddress; >+ handlePageStartAddressChanged(pageStart); >+ } >+ } >+ >+ private void updateDynamicLoadProperty() { >+ >+ boolean value = DebugUIPlugin >+ .getDefault() >+ .getPreferenceStore() >+ .getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); >+ >+ if (value != isDynamicLoad()) >+ { >+ fContentProvider.setDynamicLoad(value); >+ >+ if (!fIsDisposed) { >+ if (isDynamicLoad()) { >+ fContentInput.setPostBuffer(20); >+ fContentInput.setPreBuffer(20); >+ fContentInput.setDefaultBufferSize(20); >+ fContentInput.setNumLines(getNumberOfVisibleLines()); >+ >+ } else { >+ fContentInput.setPostBuffer(0); >+ fContentInput.setPreBuffer(0); >+ fContentInput.setDefaultBufferSize(0); >+ fContentInput.setNumLines(fPageSize); >+ } >+ } >+ } > } > > /** >@@ -339,6 +450,12 @@ > // do not handle event if view tab is disabled > if (!isVisible()) > return; >+ >+ // do not handle event if the base address of the memory >+ // block has changed, wait for debug event to update to >+ // new location >+ if (isBaseAddressChanged()) >+ return; > > if (!address.equals(fTopRowAddress)) > { >@@ -406,12 +523,15 @@ > } > else > { >- reloadTable(address, false); >+ if (isDynamicLoad()) >+ reloadTable(address, false); >+ else >+ setTopIndex(table, index); > } > } > else if ((numInBuffer-(index+getNumberOfVisibleLines())) < 3) > { >- if (!isAtBottomLimit()) >+ if (!isAtBottomLimit() && isDynamicLoad()) > reloadTable(address, false); > else > setTopIndex(table, index); >@@ -440,12 +560,89 @@ > */ > private void selectedAddressChanged(BigInteger value) { > >+ // do not handle event if the base address of the memory >+ // block has changed, wait for debug event to update to >+ // new location >+ if (isBaseAddressChanged()) >+ return; >+ > try { >- goToAddress(value); >+ // do not handle event if the event is out of range and the >+ // rendering is in non-dynamic-load mode, otherwise, will >+ // cause rendering to continue to scroll when it shouldn't >+ if (isDynamicLoad()) >+ goToAddress(value); >+ else if (!isAddressOutOfRange(value)) >+ goToAddress(value); > } catch (DebugException e) { > // do nothing > } > } >+ >+ private void handlePageStartAddressChanged(BigInteger address) >+ { >+ // do not handle if in dynamic mode >+ if (isDynamicLoad()) >+ return; >+ >+ if (fContentInput == null) >+ return; >+ >+ if (!(getMemoryBlock() instanceof IMemoryBlockExtension)) >+ return; >+ >+ // do not handle event if the base address of the memory >+ // block has changed, wait for debug event to update to >+ // new location >+ if (isBaseAddressChanged()) >+ return; >+ >+ if(fContentProvider.getBufferTopAddress().equals(address)) >+ return; >+ >+ BigInteger start = fContentInput.getStartAddress(); >+ BigInteger end = fContentInput.getEndAddress(); >+ >+ // smaller than start address, load at start address >+ if (address.compareTo(start) < 0) >+ { >+ if (isAtTopLimit()) >+ return; >+ >+ address = start; >+ } >+ >+ // bigger than end address, no need to load, alread at top >+ if (address.compareTo(end) > 0) >+ { >+ if (isAtBottomLimit()) >+ return; >+ >+ address = end.subtract(BigInteger.valueOf(getPageSizeInUnits())); >+ } >+ >+ fContentInput.setLoadAddress(address); >+ refresh(); >+ updateSyncPageStartAddress(); >+ setTopIndex(fTableViewer.getTable(), 0); >+ fTopRowAddress = address; >+ updateSyncTopAddress(); >+ >+ BigInteger selectedAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS); >+ if (selectedAddress != null) >+ { >+ fSelectedAddress = selectedAddress; >+ if (!isAddressOutOfRange(fSelectedAddress)) >+ { >+ setCursorAtAddress(fSelectedAddress); >+ fTableCursor.setVisible(true); >+ } >+ else >+ { >+ fTableCursor.setVisible(false); >+ } >+ } >+ } > > /* (non-Javadoc) > * @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite) >@@ -480,6 +677,8 @@ > fTableViewer.setLabelProvider(labelProvider); > > fContentProvider = new TableRenderingContentProvider(); >+ fContentProvider.setDynamicLoad(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)); >+ > fTableViewer.setContentProvider(fContentProvider); > fContentProvider.setViewer(fTableViewer); > >@@ -557,7 +756,7 @@ > selectedAddress = BigInteger.valueOf(address); > } > } >- fSelectedAddress = selectedAddress; >+ setSelectedAddress(selectedAddress); > // figure out top visible address > BigInteger topVisibleAddress = (BigInteger) getSynchronizedProperty(AbstractTableRendering.PROPERTY_TOP_ADDRESS); > if (topVisibleAddress == null) >@@ -575,7 +774,23 @@ > topVisibleAddress = BigInteger.valueOf(getMemoryBlock().getStartAddress()); > } > } >- fContentInput = new TableRenderingContentInput(this, 20, 20, 20, topVisibleAddress, getNumberOfVisibleLines(), false); >+ >+ getPageSizeFromPreference(); >+ if (isDynamicLoad()) >+ fContentInput = new TableRenderingContentInput(this, 20, 20, 20, topVisibleAddress, getNumberOfVisibleLines(), false); >+ else >+ { >+ BigInteger addressToLoad = topVisibleAddress; >+ >+ // check synchronization service to see if we need to sync with another rendering >+ Object obj = getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS); >+ if (obj != null && obj instanceof BigInteger) >+ { >+ addressToLoad = (BigInteger)obj; >+ } >+ fContentInput = new TableRenderingContentInput(this, 0, 0, 0, addressToLoad, fPageSize, false); >+ } >+ > fTableViewer.setInput(fContentInput); > fCellModifier = new TableRenderingCellModifier(this); > fTableViewer.setCellModifier(fCellModifier); >@@ -637,6 +852,11 @@ > DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); > } > >+ private void getPageSizeFromPreference() >+ { >+ fPageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE); >+ } >+ > private void createCursor(Table table, BigInteger address) > { > fTableCursor = new TableCursor(table, SWT.NONE); >@@ -758,7 +978,7 @@ > // when the cursor is moved, the selected address is changed > if (selectedAddress != null && !selectedAddress.equals(fSelectedAddress)) > { >- fSelectedAddress = selectedAddress; >+ setSelectedAddress(selectedAddress); > updateSyncSelectedAddress(); > } > >@@ -773,21 +993,25 @@ > > if (row < 3) > { >- > if (!isAtTopLimit()) > { >- refresh(); >- setCursorAtAddress(fSelectedAddress); >+ if (isDynamicLoad()) >+ { >+ refresh(); >+ setCursorAtAddress(fSelectedAddress); >+ } > } > } > else if (row >= fTableViewer.getTable().getItemCount() - 3) > { > if (!isAtBottomLimit()) > { >- refresh(); >- setCursorAtAddress(fSelectedAddress); >+ if (isDynamicLoad()) >+ { >+ refresh(); >+ setCursorAtAddress(fSelectedAddress); >+ } > } >- > } > } > >@@ -1190,7 +1414,6 @@ > > private static void setTopIndex(Table table, int index) > { >- MemoryViewUtil.linuxWorkAround(table); > table.setTopIndex(index); > } > >@@ -1213,6 +1436,13 @@ > Object size =getSynchronizedProperty( AbstractTableRendering.PROPERTY_COL_SIZE); > Object topAddress =getSynchronizedProperty( AbstractTableRendering.PROPERTY_TOP_ADDRESS); > >+ if (!isDynamicLoad()) >+ { >+ Object pageStartAddress = getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS); >+ if (pageStartAddress == null) >+ updateSyncPageStartAddress(); >+ } >+ > // if info is available, some other view tab has already been > // created > // do not overwirte info int he synchronizer if that's the case >@@ -1233,7 +1463,21 @@ > * Get properties from synchronizer and synchronize settings > */ > private void synchronize() >- { >+ { >+ if (!isDynamicLoad()) >+ { >+ BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS); >+ if (pageStart != null && fContentInput != null && fContentInput.getLoadAddress() != null) >+ { >+ if (!fContentInput.getLoadAddress().equals(pageStart)) >+ handlePageStartAddressChanged(pageStart); >+ } >+ else if (pageStart != null) >+ { >+ handlePageStartAddressChanged(pageStart); >+ } >+ } >+ > Integer columnSize = (Integer) getSynchronizedProperty(AbstractTableRendering.PROPERTY_COL_SIZE); > BigInteger selectedAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_SELECTED_ADDRESS); > BigInteger topAddress = (BigInteger)getSynchronizedProperty(AbstractTableRendering.PROPERTY_TOP_ADDRESS); >@@ -1315,6 +1559,31 @@ > firePropertyChangedEvent(event); > } > >+ private void updateSyncPageStartAddress() { >+ >+ if (!fIsCreated) >+ return; >+ >+ if (isBaseAddressChanged()) >+ return; >+ >+ BigInteger pageStart; >+ if (isDynamicLoad()) >+ { >+ // if dynamic loading, the page address should be the top >+ // row address >+ pageStart = fTopRowAddress; >+ } >+ else >+ { >+ // otherwise, the address is the buffer's start address >+ pageStart = fContentProvider.getBufferTopAddress(); >+ } >+ >+ PropertyChangeEvent event = new PropertyChangeEvent(this, IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS, null, pageStart); >+ firePropertyChangedEvent(event); >+ } >+ > /** > * Fills the context menu for this rendering > * >@@ -1354,6 +1623,12 @@ > } > } > } >+ if (!isDynamicLoad()) >+ { >+ menu.add(new Separator()); >+ menu.add(fPrevAction); >+ menu.add(fNextAction); >+ } > > menu.add(new Separator()); > menu.add(fReformatAction); >@@ -1366,6 +1641,7 @@ > menu.add(new Separator()); > menu.add(fPropertiesAction); > } >+ > } > > /** >@@ -1539,11 +1815,18 @@ > if (address.compareTo(fContentProvider.getContentBaseAddress()) != 0) > { > // get to new address >- fSelectedAddress = address; >+ setSelectedAddress(address); > updateSyncSelectedAddress(); >+ > reloadTable(address, true); > >- fTopRowAddress = address; >+ if (!isDynamicLoad()) >+ { >+ updateSyncPageStartAddress(); >+ setTopIndex(fTableViewer.getTable(), 0); >+ } >+ >+ fTopRowAddress = getTopVisibleAddress(); > updateSyncTopAddress(); > > fContentInput.updateContentBaseAddress(); >@@ -1551,7 +1834,10 @@ > else > { > // reload at top of table >- address = getTopVisibleAddress(); >+ if (isDynamicLoad()) >+ address = getTopVisibleAddress(); >+ else >+ address = fContentInput.getLoadAddress(); > reloadTable(address, true); > } > } catch (DebugException e) { >@@ -1575,25 +1861,43 @@ > { > Table table = (Table)fTableViewer.getControl(); > >- TableRenderingContentInput input = new TableRenderingContentInput(this, fContentInput.getPreBuffer(), fContentInput.getPostBuffer(), fContentInput.getDefaultBufferSize(), topAddress, getNumberOfVisibleLines(), updateDelta); >+ TableRenderingContentInput input; >+ if (isDynamicLoad()) >+ input = new TableRenderingContentInput(this, fContentInput.getPreBuffer(), fContentInput.getPostBuffer(), fContentInput.getDefaultBufferSize(), topAddress, getNumberOfVisibleLines(), updateDelta); >+ else >+ input = new TableRenderingContentInput(this, fContentInput.getPreBuffer(), fContentInput.getPostBuffer(), fContentInput.getDefaultBufferSize(), topAddress, fPageSize, updateDelta); >+ > fContentInput = input; > fTableViewer.setInput(fContentInput); > >- if (getMemoryBlock() instanceof IMemoryBlockExtension) >+ if (isDynamicLoad()) > { >- int topIdx = findAddressIndex(topAddress); >+ if (getMemoryBlock() instanceof IMemoryBlockExtension) >+ { >+ int topIdx = findAddressIndex(topAddress); >+ >+ if (topIdx != -1) >+ { >+ setTopIndex(table, topIdx); >+ } >+ } > >- if (topIdx != -1) >+ // cursor needs to be refreshed after reload >+ if (isAddressVisible(fSelectedAddress)) >+ setCursorAtAddress(fSelectedAddress); >+ } >+ else >+ { >+ if (!isAddressOutOfRange(fSelectedAddress)) >+ { >+ setCursorAtAddress(fSelectedAddress); >+ fTableCursor.setVisible(true); >+ } >+ else > { >- setTopIndex(table, topIdx); >+ fTableCursor.setVisible(false); > } > } >- >- // cursor needs to be refreshed after reload >- if (isAddressVisible(fSelectedAddress)) >- setCursorAtAddress(fSelectedAddress); >- >- MemoryViewUtil.linuxWorkAround(fTableViewer.getTable()); > } > finally > { >@@ -1657,15 +1961,19 @@ > > private static int getTopVisibleIndex(Table table) > { >- MemoryViewUtil.linuxWorkAround(table); > int index = table.getTopIndex(); > > TableItem item = table.getItem(index); >+ int cnt = table.getItemCount(); > >- MemoryViewUtil.linuxWorkAround(table); > while (item.getBounds(0).y < 0) > { > index++; >+ if (index >= cnt) >+ { >+ index--; >+ break; >+ } > item = table.getItem(index); > } > >@@ -1778,7 +2086,7 @@ > // if address is within the range, highlight > if (!isAddressOutOfRange(address)) > { >- fSelectedAddress = address; >+ setSelectedAddress(address); > updateSyncSelectedAddress(); > setCursorAtAddress(fSelectedAddress); > >@@ -1817,11 +2125,15 @@ > throw e; > } > >- fSelectedAddress = address; >+ setSelectedAddress(address); > updateSyncSelectedAddress(); > >- //otherwise, reload at the address >- reloadTable(address,false); >+ reloadTable(address, false); >+ >+ if (!isDynamicLoad()) >+ { >+ updateSyncPageStartAddress(); >+ } > > // if the table is reloaded, the top address is chagned in this case > fTopRowAddress = address; >@@ -1900,6 +2212,9 @@ > { > fPropertiesAction = new PropertyDialogAction(site.getSite(),site.getSite().getSelectionProvider()); > } >+ >+ fNextAction = new NextPageAction(); >+ fPrevAction = new PrevPageAction(); > } > > /** >@@ -1927,33 +2242,37 @@ > > if (getMemoryBlock() instanceof IMemoryBlockExtension) > { >- if (!isAddressOutOfRange(address)) >+ >+ if (isDynamicLoad()) > { >- Table table = fTableViewer.getTable(); >- int numInBuffer = table.getItemCount(); >- int index = findAddressIndex(address); >- if (index < 3) >+ if (!isAddressOutOfRange(address)) > { >- if (isAtTopLimit()) >+ Table table = fTableViewer.getTable(); >+ int numInBuffer = table.getItemCount(); >+ int index = findAddressIndex(address); >+ if (index < 3) > { >- setTopIndex(table, index); >+ if (isAtTopLimit()) >+ { >+ setTopIndex(table, index); >+ } >+ else >+ { >+ reloadTable(address, false); >+ } > } >- else >+ else if ((numInBuffer-(index+getNumberOfVisibleLines())) < 3) > { >- reloadTable(address, false); >+ if (!isAtBottomLimit()) >+ reloadTable(address, false); > } > } >- else if ((numInBuffer-(index+getNumberOfVisibleLines())) < 3) >- { >- if (!isAtBottomLimit()) >- reloadTable(address, false); >+ else >+ { >+ // approaching limit, reload table >+ reloadTable(address, false); > } > } >- else >- { >- // approaching limit, reload table >- reloadTable(address, false); >- } > > if (isAddressVisible(fSelectedAddress)) > fTableCursor.setVisible(true); >@@ -1971,10 +2290,10 @@ > private boolean isAtTopLimit() > { > BigInteger startAddress = fContentInput.getStartAddress(); >- startAddress = alignDoubleWordBoundary(startAddress); >+ startAddress = MemoryViewUtil.alignDoubleWordBoundary(startAddress); > > BigInteger startBufferAddress = fContentProvider.getBufferTopAddress(); >- startBufferAddress = alignDoubleWordBoundary(startBufferAddress); >+ startBufferAddress = MemoryViewUtil.alignDoubleWordBoundary(startBufferAddress); > > if (startAddress.compareTo(startBufferAddress) == 0) > return true; >@@ -1985,10 +2304,10 @@ > private boolean isAtBottomLimit() > { > BigInteger endAddress = fContentInput.getEndAddress(); >- endAddress = alignDoubleWordBoundary(endAddress); >+ endAddress = MemoryViewUtil.alignDoubleWordBoundary(endAddress); > > BigInteger endBufferAddress = fContentProvider.getBufferEndAddress(); >- endBufferAddress = alignDoubleWordBoundary(endBufferAddress); >+ endBufferAddress = MemoryViewUtil.alignDoubleWordBoundary(endBufferAddress); > > if (endAddress.compareTo(endBufferAddress) == 0) > return true; >@@ -1996,19 +2315,6 @@ > return false; > } > >- private BigInteger alignDoubleWordBoundary(BigInteger integer) >- { >- String str =integer.toString(16); >- if (!str.endsWith("0")) //$NON-NLS-1$ >- { >- str = str.substring(0, str.length() - 1); >- str += "0"; //$NON-NLS-1$ >- integer = new BigInteger(str, 16); >- } >- >- return integer; >- } >- > private boolean needMoreLines() > { > if (getMemoryBlock() instanceof IMemoryBlockExtension) >@@ -2501,10 +2807,15 @@ > } > > super.becomesVisible(); >- >- refresh(); >- synchronize(); > >+ boolean value = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); >+ if (value != isDynamicLoad()) >+ // this call will cause a reload >+ handleDyanicLoadChanged(); >+ else >+ refresh(); >+ >+ synchronize(); > updateRenderingLabel(true); > } > >@@ -2674,15 +2985,15 @@ > public Object[] getChildren(Object o) { > return new Object[0]; > } >- >+ > public ImageDescriptor getImageDescriptor(Object object) { > return null; > } >- >+ > public String getLabel(Object o) { > return getInstance().getLabel(); > } >- >+ > public Object getParent(Object o) { > return null; > } >@@ -2691,6 +3002,69 @@ > return fWorkbenchAdapter; > } > >+ if (adapter == IMemoryBlockConnection.class) { >+ if (fConnection == null) { >+ fConnection = new IMemoryBlockConnection() { >+ public void update() { >+ try { >+ fContentProvider.takeContentSnapshot(); >+ if (getMemoryBlock() instanceof IMemoryBlockExtension) >+ { >+ BigInteger address = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress(); >+ if (address.compareTo(fContentProvider.getContentBaseAddress()) != 0) >+ { >+ // get to new address >+ setSelectedAddress(address); >+ updateSyncSelectedAddress(); >+ fTopRowAddress = address; >+ fContentInput.updateContentBaseAddress(); >+ fContentInput.setLoadAddress(address); >+ } >+ fContentProvider.loadContentForExtendedMemoryBlock(); >+ } >+ else >+ fContentProvider.loadContentForSimpleMemoryBlock(); >+ >+ // update UI asynchrounously >+ Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay(); >+ display.asyncExec(new Runnable() { >+ public void run() { >+ updateLabels(); >+ >+ if (getMemoryBlock() instanceof IMemoryBlockExtension) { >+ int topIdx = findAddressIndex(fTopRowAddress); >+ if (topIdx != -1) { >+ setTopIndex(fTableViewer.getTable(),topIdx); >+ } >+ } >+ >+ // cursor needs to be refreshed after reload >+ if (isAddressVisible(fSelectedAddress)) >+ { >+ setCursorAtAddress(fSelectedAddress); >+ fTableCursor.setVisible(true); >+ fTableCursor.redraw(); >+ } >+ else >+ { >+ fTableCursor.setVisible(false); >+ } >+ >+ if (!isDynamicLoad()) >+ updateSyncPageStartAddress(); >+ >+ updateSyncTopAddress(); >+ } >+ }); >+ } catch (DebugException e) { >+ displayError(e); >+ } >+ } >+ }; >+ } >+ return fConnection; >+ } >+ > return super.getAdapter(adapter); > } > >@@ -2708,6 +3082,25 @@ > return true; > } > >+ private boolean isBaseAddressChanged() >+ { >+ try { >+ IMemoryBlock mb = getMemoryBlock(); >+ if (mb instanceof IMemoryBlockExtension) >+ { >+ BigInteger baseAddress = ((IMemoryBlockExtension)mb).getBigBaseAddress(); >+ if (baseAddress != null) >+ { >+ if (!baseAddress.equals(fContentInput.getContentBaseAddress())) >+ return true; >+ } >+ } >+ } catch (DebugException e1) { >+ return false; >+ } >+ return false; >+ } >+ > /** > * Returns the color provider for this rendering's memory block or > * <code>null</code> if none. >@@ -2774,6 +3167,22 @@ > return (IMemoryBlockTablePresentation)getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class); > } > >+ private boolean isDynamicLoad() >+ { >+ return fContentProvider.isDynamicLoad(); >+ } >+ >+ private int getPageSizeInUnits() >+ { >+ return fPageSize * getAddressableUnitPerLine(); >+ } >+ >+ private void setSelectedAddress(BigInteger address) >+ { >+ fSelectedAddress = address; >+ } >+ >+ > /** > * Returns text for the given memory bytes at the specified address for the specified > * rendering type. This is called by the label provider for. >Index: ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java >diff -N ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/memory/IMemoryBlockConnection.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,27 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.debug.internal.ui.memory; >+ >+/** >+ * Represents a connection to a memory block. An IMemoryRenderingUpdater can call >+ * a connection to update instead of relying on a rendering to listen >+ * for CHANGE / SUSPEND debug event to trigger an update. >+ * >+ * This interface is EXPERIMENTAL. >+ * >+ */ >+public interface IMemoryBlockConnection { >+ >+ /** >+ * Update the content of a memory block in a connection. >+ */ >+ public void update(); >+} >Index: ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java >diff -N ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/memory/IMemoryRenderingUpdater.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,40 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.debug.internal.ui.memory; >+ >+import org.eclipse.debug.core.model.IMemoryBlockExtension; >+import org.eclipse.debug.ui.memory.IMemoryRendering; >+ >+ >+/** >+ * Represents an object that will manage the update of an IMemoryRendering >+ * based on connections. If the memory block implements this interface or returns >+ * an object of this type when getAdapter(...) is called, a rendering would >+ * call #supportsManagedUpdate to determine if it should handle and refresh >+ * upon a debug event. >+ * >+ * If the client wants to manage its own update, it would return true when >+ * #supportsManagedUpdate is called. The rendering will not get refreshed >+ * upon any debug events. Instead, the rendering will update when >+ * <code>IMemoryBlockConnection.update</code> is called. >+ * >+ * This interface is EXPERIMENTAL. >+ * >+ */ >+public interface IMemoryRenderingUpdater extends IMemoryBlockExtension { >+ >+ /** >+ * @return true if the updater will manage the update of a rendering >+ */ >+ public boolean supportsManagedUpdate(IMemoryRendering rendering); >+ >+} >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java >diff -N ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,60 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.debug.internal.ui.views.memory.renderings; >+ >+import org.eclipse.debug.internal.ui.DebugUIMessages; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.preference.IPreferenceNode; >+import org.eclipse.jface.preference.IPreferencePage; >+import org.eclipse.jface.preference.PreferenceDialog; >+import org.eclipse.jface.preference.PreferenceManager; >+import org.eclipse.jface.preference.PreferenceNode; >+import org.eclipse.jface.window.Window; >+import org.eclipse.swt.custom.BusyIndicator; >+import org.eclipse.ui.IViewActionDelegate; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.actions.ActionDelegate; >+ >+public class TableRenderingPrefAction extends ActionDelegate implements IViewActionDelegate { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) >+ */ >+ public void run(IAction action) { >+ IPreferencePage page = new TableRenderingPreferencePage(DebugUIMessages.TableRenderingPrefAction_0); >+ showPreferencePage("org.eclipse.debug.ui.tableRenderingPreferencepage", page); //$NON-NLS-1$ >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) >+ */ >+ public void init(IViewPart view) { >+ } >+ >+ protected void showPreferencePage(String id, IPreferencePage page) { >+ final IPreferenceNode targetNode = new PreferenceNode(id, page); >+ >+ PreferenceManager manager = new PreferenceManager(); >+ manager.addToRoot(targetNode); >+ final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager); >+ final boolean [] result = new boolean[] { false }; >+ BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() { >+ public void run() { >+ dialog.create(); >+ dialog.setMessage(targetNode.getLabelText()); >+ result[0]= (dialog.open() == Window.OK); >+ } >+ }); >+ } >+ >+} >Index: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java >=================================================================== >RCS file: ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java >diff -N ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,221 @@ >+/******************************************************************************* >+ * Copyright (c) 2005 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.debug.internal.ui.views.memory.renderings; >+ >+import org.eclipse.debug.internal.ui.DebugUIMessages; >+import org.eclipse.debug.internal.ui.DebugUIPlugin; >+import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; >+import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.jface.preference.BooleanFieldEditor; >+import org.eclipse.jface.preference.FieldEditor; >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.jface.preference.IntegerFieldEditor; >+import org.eclipse.jface.preference.PreferencePage; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Combo; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.ui.PlatformUI; >+ >+public class TableRenderingPreferencePage extends PreferencePage implements >+ IPropertyChangeListener{ >+ >+ Combo fColumnSize; >+ private int[] fColumnSizes = new int[] {1, 2, 4, 8, 16}; >+ private BooleanFieldEditor fAutoLoadPref; >+ private IntegerFieldEditor fPageSizePref; >+ private Composite fBufferComposite; >+ >+ public TableRenderingPreferencePage(String title) >+ { >+ super(title); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) >+ */ >+ protected Control createContents(Composite parent) { >+ PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".table_renderings_preference_page_context"); //$NON-NLS-1$ >+ >+ Composite composite = new Composite(parent, SWT.NONE); >+ >+ Composite columnSizeComposite = new Composite(composite, SWT.NONE); >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 2; >+ columnSizeComposite.setLayout(layout); >+ GridData data = new GridData(); >+ data.horizontalAlignment = SWT.FILL; >+ columnSizeComposite.setLayoutData(data); >+ >+ Label textLabel = new Label(columnSizeComposite, SWT.NONE); >+ textLabel.setText(DebugUIMessages.TableRenderingPreferencePage_0); >+ >+ fColumnSize = new Combo(columnSizeComposite, SWT.BORDER|SWT.READ_ONLY); >+ >+ GridData columnLayout= new GridData(); >+ fColumnSize.setLayoutData(columnLayout); >+ >+ for (int i=0; i<fColumnSizes.length; i++) >+ { >+ fColumnSize.add(String.valueOf(fColumnSizes[i])); >+ } >+ >+ int colSize = getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_COLUMN_SIZE); >+ int idx = 0; >+ >+ for (int i=0; i<fColumnSizes.length; i++) >+ { >+ if (fColumnSizes[i] == colSize) >+ { >+ idx = i; >+ break; >+ } >+ } >+ >+ fColumnSize.select(idx); >+ >+ createSpacer(composite); >+ >+ fAutoLoadPref = new BooleanFieldEditor(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM, DebugUIMessages.TableRenderingPreferencePage_1, composite); >+ fAutoLoadPref.setPreferenceStore(getPreferenceStore()); >+ fAutoLoadPref.load(); >+ >+ fBufferComposite = new Composite(composite, SWT.NONE); >+ data = new GridData(); >+ data.horizontalAlignment = SWT.FILL; >+ fBufferComposite.setLayoutData(data); >+ >+ fPageSizePref = new IntegerFieldEditor(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE, DebugUIMessages.TableRenderingPreferencePage_2, fBufferComposite); >+ fPageSizePref.setPreferenceStore(getPreferenceStore()); >+ fPageSizePref.load(); >+ >+ boolean autoLoad = getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM); >+ if (autoLoad) >+ fPageSizePref.setEnabled(false, fBufferComposite); >+ else >+ fPageSizePref.setEnabled(true, fBufferComposite); >+ >+ fAutoLoadPref.setPropertyChangeListener(this); >+ fPageSizePref.setPropertyChangeListener(this); >+ fPageSizePref.setValidRange(1, Integer.MAX_VALUE); >+ >+ return composite; >+ } >+ >+ >+ public boolean performOk() { >+ int idx = fColumnSize.getSelectionIndex(); >+ int colSize = fColumnSizes[idx]; >+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_COLUMN_SIZE, colSize); >+ fAutoLoadPref.store(); >+ fPageSizePref.store(); >+ return super.performOk(); >+ } >+ >+ protected void performDefaults() { >+ int colSize = IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT; >+ getPreferenceStore().setValue(IDebugPreferenceConstants.PREF_COLUMN_SIZE, colSize); >+ int idx = -1; >+ for (int i=0; i<fColumnSizes.length; i++) >+ { >+ if (colSize == fColumnSizes[i]) >+ { >+ idx = i; >+ break; >+ } >+ } >+ if (idx > 0) >+ fColumnSize.select(idx); >+ fAutoLoadPref.loadDefault(); >+ fPageSizePref.loadDefault(); >+ super.performDefaults(); >+ } >+ >+ protected IPreferenceStore doGetPreferenceStore() { >+ return DebugUIPlugin.getDefault().getPreferenceStore(); >+ } >+ >+ /** >+ * Adds in a spacer. >+ * >+ * @param composite the parent composite >+ */ >+ private void createSpacer(Composite composite) { >+ Label spacer = new Label(composite, SWT.NONE); >+ GridData spacerData = new GridData(); >+ spacerData.horizontalSpan = 1; >+ spacer.setLayoutData(spacerData); >+ } >+ >+ public void propertyChange(PropertyChangeEvent event) { >+ if (event.getProperty().equals(FieldEditor.VALUE)) >+ { >+ if (event.getSource().equals(fAutoLoadPref)) >+ { >+ boolean autoLoad = fAutoLoadPref.getBooleanValue(); >+ if (autoLoad) >+ { >+ fPageSizePref.setEnabled(false, fBufferComposite); >+ } >+ else >+ { >+ fPageSizePref.setEnabled(true, fBufferComposite); >+ } >+ validatePageSize(); >+ } >+ } >+ if (event.getProperty().equals(FieldEditor.VALUE)) >+ { >+ if (event.getSource().equals(fPageSizePref)) >+ { >+ validatePageSize(); >+ } >+ } >+ } >+ >+ private void validatePageSize() { >+ boolean autoLoad = fAutoLoadPref.getBooleanValue(); >+ try { >+ int bufferSize = fPageSizePref.getIntValue(); >+ if (!autoLoad && bufferSize < 1) >+ { >+ setValid(false); >+ setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_3); >+ } >+ else >+ { >+ setValid(true); >+ setErrorMessage(null); >+ >+ } >+ } catch (NumberFormatException e) { >+ if (!autoLoad) >+ { >+ setValid(false); >+ setErrorMessage(DebugUIMessages.TableRenderingPreferencePage_4); >+ } >+ } >+ } >+ >+ public void dispose() { >+ >+ fAutoLoadPref.setPropertyChangeListener(null); >+ fPageSizePref.setPropertyChangeListener(null); >+ super.dispose(); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 74559
:
16951
|
16952
|
20803
|
20804
| 20805