} else if (event.widget == colorButton) { ColorDialog colorDialog = new ColorDialog (shell, SWT.NONE); colorDialog.setRGB (rgb); RGB newRgb = colorDialog.open (); if (newRgb != null) { rgb = newRgb; updateSampleColor (); }
void handleEvent (Event event) {	if (ignoreEvents) return;	if (event.widget instanceof Combo) {		Combo combo = (Combo) event.widget;		int prevSelectIndex = ((Integer) combo.getData ()).intValue ();		String text = combo.getText ();		int newSelectIndex = combo.indexOf (text);		if (prevSelectIndex != newSelectIndex || newSelectIndex == -1) {			ignoreEvents = true;			combo.setData (new Integer (newSelectIndex));			if (combo == charSetCombo) initFaceNameCombo ();			else if (combo == faceNameCombo) initExtStyleCombo ();			else if (combo == extStyleCombo) initSizeCombo ();			else if (combo == fontSizeCombo) initStyleCombo ();			updateSampleFont ();			if (newSelectIndex != -1) {				// in case it came by typing the name				combo.select (newSelectIndex);			}			ignoreEvents = false;		}	}			else	if (event.widget == okButton) {		okSelected = true;		shell.close ();	}	else	if (event.widget == cancelButton) {		okSelected = false;		shell.close ();	}	}