Arrays.sort( allAtNames );
final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
typeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
{
public Control createControl( Composite parent, int style )
{
Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
combo.setVisibleItemCount( 20 );
return combo;
}
} );
typeComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT, true );
typeComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
typeCombo = ( Combo ) typeComboField.getControl();
typeCombo.setItems( allAtNames );
typeCombo.setText( initialType );
// content proposal adapter
typeCPA = new ContentProposalAdapter( typeCombo, new ComboContentAdapter(),
new ListContentProposalProvider( typeCombo.getItems() ), null, null );
typeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
typeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE );
BaseWidgetUtils.createLabel( composite, SEP_VALUESIN, 1 );
valuesInComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
{
public Control createControl( Composite parent, int style )
{
Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
combo.setVisibleItemCount( 20 );