Search in sources :

Example 6 with ShellAdapter

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();
            }
        }
    });
}
Also used : ShellAdapter(org.eclipse.swt.events.ShellAdapter) ShellEvent(org.eclipse.swt.events.ShellEvent)

Example 7 with ShellAdapter

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);
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ShellAdapter(org.eclipse.swt.events.ShellAdapter) CTabFolder(org.eclipse.swt.custom.CTabFolder) Composite(org.eclipse.swt.widgets.Composite) GridData(org.eclipse.swt.layout.GridData) ShellEvent(org.eclipse.swt.events.ShellEvent) CTabItem(org.eclipse.swt.custom.CTabItem)

Example 8 with ShellAdapter

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() });
}
Also used : Shell(org.eclipse.swt.widgets.Shell) ShellAdapter(org.eclipse.swt.events.ShellAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ShellEvent(org.eclipse.swt.events.ShellEvent) List(org.eclipse.swt.widgets.List) FillLayout(org.eclipse.swt.layout.FillLayout)

Example 9 with ShellAdapter

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;
}
Also used : Control(org.eclipse.swt.widgets.Control) ShellAdapter(org.eclipse.swt.events.ShellAdapter) ShellEvent(org.eclipse.swt.events.ShellEvent)

Aggregations

ShellAdapter (org.eclipse.swt.events.ShellAdapter)9 ShellEvent (org.eclipse.swt.events.ShellEvent)9 GridData (org.eclipse.swt.layout.GridData)3 GridLayout (org.eclipse.swt.layout.GridLayout)3 Composite (org.eclipse.swt.widgets.Composite)3 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Shell (org.eclipse.swt.widgets.Shell)2 ResourceDescriptor (aQute.bnd.service.repository.SearchableRepository.ResourceDescriptor)1 InteractionFigure (edu.cmu.cs.hcii.cogtool.view.InteractionFigure)1 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)1 CheckboxTableViewer (org.eclipse.jface.viewers.CheckboxTableViewer)1 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)1 ISelection (org.eclipse.jface.viewers.ISelection)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 CTabFolder (org.eclipse.swt.custom.CTabFolder)1 CTabItem (org.eclipse.swt.custom.CTabItem)1