From 2f39cedad3537a0afee5df59707be945ae70c8de Mon Sep 17 00:00:00 2001 From: Xavier Ducrohet Date: Mon, 3 Aug 2009 14:23:16 -0700 Subject: [PATCH] Fix the DeviceChooserDialog table issues. On Linux, the gtk table seems to resize itself automatically when the layout is computed and forces the last column to resize itself at +18 pixels. This has a problematic impact on this dialog as it is not resizable and is made to match the size of the content. As the dialog is used time after time the last column grows by 18 pixels at every use up to a point where it doesn't fit the screen. Since storing the columns size is not that useful and I couldn't find a way to ignore this first resize, I'm just removing the width storage. --- .../internal/launch/DeviceChooserDialog.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java index 8b61e27dd..315f456ac 100644 --- a/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java +++ b/tools/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java @@ -36,7 +36,6 @@ import com.android.sdkuilib.internal.widgets.AvdSelector.IAvdFilter; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.ITableLabelProvider; @@ -68,12 +67,6 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener private final static int ICON_WIDTH = 16; - private final static String PREFS_COL_SERIAL = "deviceChooser.serial"; //$NON-NLS-1$ - private final static String PREFS_COL_STATE = "deviceChooser.state"; //$NON-NLS-1$ - private final static String PREFS_COL_AVD = "deviceChooser.avd"; //$NON-NLS-1$ - private final static String PREFS_COL_TARGET = "deviceChooser.target"; //$NON-NLS-1$ - private final static String PREFS_COL_DEBUG = "deviceChooser.debug"; //$NON-NLS-1$ - private Table mDeviceTable; private TableViewer mViewer; private AvdSelector mPreferredAvdSelector; @@ -334,7 +327,6 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener layout.marginLeft = 30; offsetComp.setLayout(layout); - IPreferenceStore store = AdtPlugin.getDefault().getPreferenceStore(); mDeviceTable = new Table(offsetComp, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER); GridData gd; mDeviceTable.setLayoutData(gd = new GridData(GridData.FILL_BOTH)); @@ -345,23 +337,23 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener TableHelper.createTableColumn(mDeviceTable, "Serial Number", SWT.LEFT, "AAA+AAAAAAAAAAAAAAAAAAA", //$NON-NLS-1$ - PREFS_COL_SERIAL, store); + null /* prefs name */, null /* prefs store */); TableHelper.createTableColumn(mDeviceTable, "AVD Name", - SWT.LEFT, "engineering", //$NON-NLS-1$ - PREFS_COL_AVD, store); + SWT.LEFT, "AAAAAAAAAAAAAAAAAAA", //$NON-NLS-1$ + null /* prefs name */, null /* prefs store */); TableHelper.createTableColumn(mDeviceTable, "Target", SWT.LEFT, "AAA+Android 9.9.9", //$NON-NLS-1$ - PREFS_COL_TARGET, store); + null /* prefs name */, null /* prefs store */); TableHelper.createTableColumn(mDeviceTable, "Debug", SWT.LEFT, "Debug", //$NON-NLS-1$ - PREFS_COL_DEBUG, store); + null /* prefs name */, null /* prefs store */); TableHelper.createTableColumn(mDeviceTable, "State", SWT.LEFT, "bootloader", //$NON-NLS-1$ - PREFS_COL_STATE, store); + null /* prefs name */, null /* prefs store */); // create the viewer for it mViewer = new TableViewer(mDeviceTable);