Source:
protected void createControls(Composite parent, int horizontalSpan) { GridData gd; this.parent = parent; if (inDataStrings == null) { inDataStrings = new String[] {"DATA NOT FOUND"}; } setDisplayDataStrings(); if (horizontalSpan < 2) { horizontalSpan = 2; } if (isDisplayLabel() && !getLabel().equals("")) { labelWidget = new Label(parent, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } dataCombo = new CCombo(parent, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.V_SCROLL | SWT.FLAT | SWT.BORDER); dataCombo.setItems(displayArray); dataCombo.setVisibleItemCount(Math.min(displayArray.length, 45)); dataCombo.addKeyListener(new KeyAdapter() { private String keySequence; private long tiemout = 0; @Override public void keyPressed(KeyEvent keyEvent) { if (!Character.isLetterOrDigit(keyEvent.character)) { return; } long time = System.currentTimeMillis(); if (time > tiemout) { keySequence = ""; } keySequence += Character.toLowerCase(keyEvent.character); tiemout = time + 1000; int index = 0; for (String item : displayArray) { if (item.toLowerCase().startsWith(keySequence)) { keyEvent.doit = false; dataCombo.select(index); return; } index++; } keySequence = ""; } }); gd = new GridData(); if (fillHorizontally) { gd.grabExcessHorizontalSpace = true; } if (fillVertically) { gd.grabExcessVerticalSpace = true; } gd.horizontalSpan = horizontalSpan - 1; dataCombo.setLayoutData(gd); ModifyListener dataComboListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { data = dataCombo.getText(); if (data.compareTo("--select--") == 0) { data = ""; } validate(); notifyXModifiedListeners(); } }; dataCombo.addModifyListener(dataComboListener); refresh(); dataCombo.setEnabled(isEditable()); }

Target:
protected void createControls(Composite parent, int horizontalSpan) { GridData gd; this.parent = parent; if (inDataStrings == null) { inDataStrings = new String[] {"DATA NOT FOUND"}; } setDisplayDataStrings(); if (horizontalSpan < 2) { horizontalSpan = 2; } if (isDisplayLabel() && !getLabel().equals("")) { labelWidget = new Label(parent, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } dataCombo = new CCombo(parent, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.V_SCROLL | SWT.FLAT | SWT.BORDER); dataCombo.setItems(displayArray); dataCombo.setVisibleItemCount(Math.min(displayArray.length, 45)); dataCombo.addKeyListener(new KeyAdapter() { private String keySequence; private long timeout = 0; @Override public void keyPressed(KeyEvent keyEvent) { if (!Character.isLetterOrDigit(keyEvent.character)) { return; } long time = System.currentTimeMillis(); if (time > timeout) { keySequence = ""; } keySequence += Character.toLowerCase(keyEvent.character); timeout = time + 1000; int index = 0; for (String item : displayArray) { if (item.toLowerCase().startsWith(keySequence)) { keyEvent.doit = false; dataCombo.select(index); return; } index++; } keySequence = ""; } }); gd = new GridData(); if (fillHorizontally) { gd.grabExcessHorizontalSpace = true; } if (fillVertically) { gd.grabExcessVerticalSpace = true; } gd.horizontalSpan = horizontalSpan - 1; dataCombo.setLayoutData(gd); ModifyListener dataComboListener = new ModifyListener() { @Override public void modifyText(ModifyEvent e) { data = dataCombo.getText(); if (data.compareTo("--select--") == 0) { data = ""; } validate(); notifyXModifiedListeners(); } }; dataCombo.addModifyListener(dataComboListener); refresh(); dataCombo.setEnabled(isEditable()); }