use of org.eclipse.swt.events.ShellEvent in project translationstudio8 by heartsome.
the class NatCombo method createDropdownControl.
private void createDropdownControl() {
dropdownShell = new Shell(getShell(), SWT.MODELESS);
dropdownShell.setLayout(new FillLayout());
dropdownList = new List(dropdownShell, SWT.V_SCROLL | HorizontalAlignmentEnum.getSWTStyle(cellStyle));
dropdownList.setBackground(cellStyle.getAttributeValue(CellStyleAttributes.BACKGROUND_COLOR));
dropdownList.setForeground(cellStyle.getAttributeValue(CellStyleAttributes.FOREGROUND_COLOR));
dropdownList.setFont(cellStyle.getAttributeValue(CellStyleAttributes.FONT));
dropdownShell.addShellListener(new ShellAdapter() {
@Override
public void shellClosed(ShellEvent event) {
text.forceFocus();
}
});
dropdownList.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
if (dropdownList.getSelectionCount() > 0) {
text.setText(dropdownList.getSelection()[0]);
}
}
});
setItems(items);
dropdownList.setSelection(new String[] { text.getText() });
}
use of org.eclipse.swt.events.ShellEvent in project cubrid-manager by CUBRID.
the class FindReplaceDialog method createContents.
/**
* Create contents.
*
* @param parent of Composite.
* @return the contents of dialog.
*/
protected Control createContents(Composite parent) {
Control result = super.createContents(parent);
readConfiguration();
this.getShell().addShellListener(new ShellAdapter() {
public void shellDeactivated(ShellEvent event) {
FindReplaceDialog.this.updateButtons();
}
public void shellActivated(ShellEvent event) {
FindReplaceDialog.this.updateButtons();
}
});
getShell().setText(Messages.findReplaceDialogTitle);
setSelectedText();
return result;
}
Aggregations