use of org.eclipse.swt.events.ShellAdapter in project translationstudio8 by heartsome.
the class TermDbManagerDialog method configureShell.
@Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(Messages.getString("dialog.TermDbManagerDialog.title"));
newShell.addShellListener(new ShellAdapter() {
public void shellActivated(ShellEvent e) {
if (lastShellSize == null) {
lastShellSize = getShell().getSize();
}
}
});
}
use of org.eclipse.swt.events.ShellAdapter in project translationstudio8 by heartsome.
the class ColumnStyleEditorDialog method initComponents.
@Override
protected void initComponents(final Shell shell) {
shell.setLayout(new GridLayout());
shell.setText("Customize style");
// Closing the window is the same as canceling the form
shell.addShellListener(new ShellAdapter() {
@Override
public void shellClosed(ShellEvent e) {
doFormCancel(shell);
}
});
// Tabs panel
Composite tabPanel = new Composite(shell, SWT.NONE);
tabPanel.setLayout(new GridLayout());
GridData fillGridData = new GridData();
fillGridData.grabExcessHorizontalSpace = true;
fillGridData.horizontalAlignment = GridData.FILL;
tabPanel.setLayoutData(fillGridData);
CTabFolder tabFolder = new CTabFolder(tabPanel, SWT.BORDER);
tabFolder.setLayout(new GridLayout());
tabFolder.setLayoutData(fillGridData);
CTabItem columnTab = new CTabItem(tabFolder, SWT.NONE);
columnTab.setText("Column");
columnTab.setImage(GUIHelper.getImage("column"));
columnTab.setControl(createColumnPanel(tabFolder));
try {
cellStyleEditorPanel.edit(columnStyle);
borderStyleEditorPanel.edit(columnStyle.getAttributeValue(CellStyleAttributes.BORDER_STYLE));
} catch (Exception e) {
e.printStackTrace(System.err);
}
}
use of org.eclipse.swt.events.ShellAdapter 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.ShellAdapter 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