DATABIND : bug fix - combo lazy rendering in Set source Dialog. 79/21779/1
authorparary <kyunghan80.park@samsung.com>
Wed, 28 May 2014 02:16:14 +0000 (11:16 +0900)
committerparary <kyunghan80.park@samsung.com>
Wed, 28 May 2014 02:16:14 +0000 (11:16 +0900)
Change-Id: I515af0d7dff32952a8d2dad362cdda7870180444
Signed-off-by: parary <kyunghan80.park@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/Helper.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/ui/views/databinding/dialog/SetSourcePage.java

index 824371e..099d392 100644 (file)
@@ -60,6 +60,7 @@ import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Label;
@@ -676,7 +677,7 @@ public class Helper {
         return result;
     }
 
-    public static CCombo addComboInTreeItem( TreeItem item, String data, final SourceDialogSubPage currentSubPage ) {
+    public static Combo addComboInTreeItem( TreeItem item, String data, final SourceDialogSubPage currentSubPage ) {
 
         TreeEditor treeEditor = new TreeEditor( item.getParent() );
         treeEditor.horizontalAlignment = SWT.CENTER;
@@ -686,9 +687,10 @@ public class Helper {
 //        treeEditor.minimumHeight = item.getParent().getItemHeight()-1;
 //        treeEditor.minimumWidth = item.getParent().getColumn( 2 ).getWidth() -1;
 
-        CCombo combo = new CCombo( item.getParent(), SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
+        Combo combo = new Combo( item.getParent(), SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY );
         treeEditor.setEditor( combo, item, 2 );
         final String[] comboItems = { "String", "Number", "Boolean", "Object", "Array" };
+        combo.setVisibleItemCount( comboItems.length );
         combo.setItems( comboItems );
         combo.select( Arrays.asList( comboItems ).indexOf( data ) );
         combo.setData( "parentItem", item );
index 2a1facd..cfadceb 100644 (file)
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
 import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.custom.StackLayout;
 import org.eclipse.swt.custom.TreeEditor;
@@ -55,7 +56,6 @@ import org.eclipse.swt.layout.FormAttachment;
 import org.eclipse.swt.layout.FormData;
 import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Dialog;
@@ -89,7 +89,7 @@ public class SetSourcePage extends Dialog {
     private SourceDialogSubPage currentSubPage;
     
     private Button updateOnStartUp;
-    private Combo dataTypeCombo;
+    private CCombo dataTypeCombo;
     private Tree dialogTree;
     private Composite treeComposite;
     private Composite dataComposite;
@@ -300,12 +300,15 @@ public class SetSourcePage extends Dialog {
         data.left = new FormAttachment(0, 5);
         typeGroup.setLayoutData(data);
 
-        dataTypeCombo = new Combo(typeGroup, SWT.READ_ONLY);
-        data = new FormData(150, 30);
+        dataTypeCombo = new CCombo(typeGroup, SWT.READ_ONLY | SWT.BORDER | SWT.SINGLE);
+        data = new FormData();
         data.top = new FormAttachment(0, 0);
         data.left = new FormAttachment(0, 0);
+        data.right = new FormAttachment(100, -5);
         dataTypeCombo.setLayoutData(data);
         
+        dataTypeCombo.setVisibleItemCount( sourceTypes.length );
+        dataTypeCombo.setBackground( Display.getCurrent().getSystemColor( SWT.COLOR_WHITE ));
         dataTypeCombo.setItems( sourceTypes );
         dataTypeCombo.select(0);