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;
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;
// 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 );
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;
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;
private SourceDialogSubPage currentSubPage;
private Button updateOnStartUp;
- private Combo dataTypeCombo;
+ private CCombo dataTypeCombo;
private Tree dialogTree;
private Composite treeComposite;
private Composite dataComposite;
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);