Replace deprecated org.eclipse.jface.text.rules.DefaultPartitioner with org.eclipse...
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / ui / dialog / SimpleSelectionDialog.java
index ccb1a43..6b569d7 100644 (file)
@@ -5,6 +5,8 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 
+import com.quantum.model.Displayable;
+
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -38,7 +40,11 @@ public class SimpleSelectionDialog extends Dialog {
                }
 
                public String getColumnText(Object element, int columnIndex) {
-                       return element.toString();
+                       if (element instanceof Displayable) {
+                               return ((Displayable) element).getDisplayName();
+                       } else {
+                               return element.toString();
+                       }
                }
 
                public void addListener(ILabelProviderListener listener) {
@@ -113,9 +119,9 @@ public class SimpleSelectionDialog extends Dialog {
                style |= SWT.MULTI;
         }
         this.viewer = new TableViewer(composite, style);
-        GridData full = new GridData(GridData.FILL_HORIZONTAL);
-        full.widthHint = 200;
-        full.heightHint = 50;
+        GridData full = new GridData(GridData.FILL_BOTH);
+        full.widthHint = 300;
+        full.heightHint = 100;
         this.viewer.getControl().setLayoutData(full);
         
         this.viewer.setLabelProvider(new LabelProvider());