Search in sources :

Example 66 with KeyAdapter

use of org.eclipse.swt.events.KeyAdapter in project tdi-studio-se by Talend.

the class MultiSchemasUI method addFieldsListenersGroupFileSettings.

private void addFieldsListenersGroupFileSettings() {
    // Event encodingCombo
    encodingCombo.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            getConnection().setEncoding(encodingCombo.getText());
            checkFieldsValue();
        }
    });
    // Separator Combo (field and row)
    fieldSeparatorCombo.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            // Label Custom of fieldSeparatorText
            fieldSeparatorManager();
        }
    });
    rowSeparatorCombo.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            // Label Custom of rowSeparatorText
            rowSeparatorManager();
        }
    });
    // Separator Text (field and row)
    fieldSeparatorText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            getConnection().setFieldSeparatorValue(fieldSeparatorText.getText());
            checkFieldsValue();
        }
    });
    multiSeparatorsText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            getConnection().setFieldSeparatorValue(multiSeparatorsText.getText());
            previewBtn.setEnabled(checkFieldsValue());
        }
    });
    keyIndexText.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.character > '9' || e.character < '0') {
                if (e.character != '\b' || e.keyCode == '') {
                    e.doit = false;
                }
            }
        }
    });
    keyIndexText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            boolean modify = false;
            if (keyIndexText.getText() == null || "".equals(keyIndexText.getText())) {
                multiSchemaManager.setSelectedColumnIndex(0);
                modify = true;
            } else {
                int index = 0;
                try {
                    index = Integer.parseInt(keyIndexText.getText());
                } catch (Exception ex) {
                    index = 0;
                    keyIndexText.setText(String.valueOf(index));
                }
                multiSchemaManager.setSelectedColumnIndex(index);
                modify = true;
            }
            if (modify) {
            // refreshPreview();
            }
            previewBtn.setEnabled(checkFieldsValue());
            if (previewBtn.isEnabled()) {
                refreshPreview();
            }
        }
    });
    keyValuesText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            previewBtn.setEnabled(checkFieldsValue());
        }
    });
    rowSeparatorText.addModifyListener(new ModifyListener() {

        public void modifyText(final ModifyEvent e) {
            getConnection().setRowSeparatorValue(rowSeparatorText.getText());
            checkFieldsValue();
        }
    });
    cardText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            IStructuredSelection selection = (IStructuredSelection) schemaTreeViewer.getSelection();
            Object element = selection.getFirstElement();
            if (element != null && (element instanceof SchemasKeyData)) {
                ((SchemasKeyData) element).setCard(cardText.getText());
            }
        }
    });
}
Also used : KeyEvent(org.eclipse.swt.events.KeyEvent) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) KeyAdapter(org.eclipse.swt.events.KeyAdapter) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) SchemasKeyData(org.talend.designer.filemultischemas.data.SchemasKeyData) InvocationTargetException(java.lang.reflect.InvocationTargetException) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException)

Example 67 with KeyAdapter

use of org.eclipse.swt.events.KeyAdapter in project tdi-studio-se by Talend.

the class MultiSchemasUI method addFieldListeners.

private void addFieldListeners() {
    fileField.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            getConnection().setFilePath(fileField.getText());
            previewBtn.setEnabled(checkFieldsValue());
            clearPreview();
            refreshPreview();
        }
    });
    rowSeparatorText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            getConnection().setRowSeparatorValue(rowSeparatorText.getText());
            previewBtn.setEnabled(checkFieldsValue());
            clearPreview();
        }
    });
    fieldSeparatorText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            getConnection().setFieldSeparatorValue(fieldSeparatorText.getText());
            previewBtn.setEnabled(checkFieldsValue());
            clearPreview();
        }
    });
    useMultiSaparators.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            boolean selected = useMultiSaparators.getSelection();
            fieldSeparatorCombo.setEnabled(!selected);
            fieldSeparatorText.setEditable(!selected);
            multiSeparatorsText.setEditable(selected);
            keyValuesText.setEditable(selected);
            keyIndexText.setEditable(selected);
            escapeCharCombo.setEnabled(selected);
            textEnclosureCombo.setEnabled(selected);
            csvRadio.setSelection(selected);
            delimitedRadio.setSelection(!selected);
            delimitedRadio.setEnabled(!selected);
            if (selected) {
                getConnection().setFieldSeparatorValue(multiSeparatorsText.getText());
                multiSchemaManager.setSelectedColumnIndex(Integer.parseInt(keyIndexText.getText()));
            } else {
                getConnection().setFieldSeparatorValue(fieldSeparatorText.getText());
            }
            clearPreview();
            previewBtn.setEnabled(checkFieldsValue());
            if (previewBtn.isEnabled()) {
                refreshPreview();
            }
        }
    });
    schemaTreeViewer.getTree().addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            getUIManager().refreshSchemasDetailView(schemaTreeViewer, schemaDetailsViewer, getSchemaDetailModel());
        }
    });
    schemaTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        public void selectionChanged(SelectionChangedEvent event) {
            removeRow.setEnabled(true);
            editSchema.setEnabled(true);
            if (isReadOnly()) {
                leftBtn.setEnabled(false);
                rightBtn.setEnabled(false);
            } else {
                leftBtn.setEnabled(getUIManager().enableMovedRecord(schemaTreeViewer, true));
                rightBtn.setEnabled(getUIManager().enableMovedRecord(schemaTreeViewer, false));
            }
            IStructuredSelection selection = (IStructuredSelection) schemaTreeViewer.getSelection();
            Object element = selection.getFirstElement();
            if (element != null && (element instanceof SchemasKeyData) && ((SchemasKeyData) element).getTagLevel() > 0) {
                cardText.setText(((SchemasKeyData) element).getCard());
                cardText.setEnabled(true);
            } else {
                //$NON-NLS-1$
                cardText.setText("");
                cardText.setEnabled(false);
            }
        }
    });
    schemaTreeViewer.getTree().addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
        //
        }

        @Override
        public void keyReleased(KeyEvent e) {
        //
        }
    });
    schemaTreeViewer.addTreeListener(new ITreeViewerListener() {

        public void treeCollapsed(TreeExpansionEvent event) {
        // getUIManager().packSchemaTreeFirstColumn(schemaTreeViewer);
        }

        public void treeExpanded(TreeExpansionEvent event) {
        // getUIManager().packSchemaTreeFirstColumn(schemaTreeViewer);
        }
    });
}
Also used : ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) KeyAdapter(org.eclipse.swt.events.KeyAdapter) ITreeViewerListener(org.eclipse.jface.viewers.ITreeViewerListener) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) KeyEvent(org.eclipse.swt.events.KeyEvent) ModifyEvent(org.eclipse.swt.events.ModifyEvent) SelectionEvent(org.eclipse.swt.events.SelectionEvent) SchemasKeyData(org.talend.designer.filemultischemas.data.SchemasKeyData) TreeExpansionEvent(org.eclipse.jface.viewers.TreeExpansionEvent)

Example 68 with KeyAdapter

use of org.eclipse.swt.events.KeyAdapter in project bndtools by bndtools.

the class ReposPreferencePage method createContents.

@Override
protected Control createContents(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(1, false);
    layout.marginRight = 10;
    composite.setLayout(layout);
    Group group = new Group(composite, SWT.NONE);
    group.setText("Templates Repositories");
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    group.setLayout(new GridLayout(2, false));
    final Button btnEnableTemplateRepo = new Button(group, SWT.CHECK);
    btnEnableTemplateRepo.setText("Enable templates repositories");
    btnEnableTemplateRepo.setSelection(enableTemplateRepo);
    btnEnableTemplateRepo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    ControlDecoration decoration = new ControlDecoration(btnEnableTemplateRepo, SWT.RIGHT | SWT.TOP, composite);
    decoration.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION).getImage());
    decoration.setMarginWidth(3);
    decoration.setDescriptionText("These repositories are used to load\ntemplates, in addition to repositories\nconfigured in the Bnd OSGi Workspace.");
    decoration.setShowHover(true);
    decoration.setShowOnlyOnFocus(false);
    Label lblRepos = new Label(group, SWT.NONE);
    lblRepos.setText("Repository URLs:");
    lblRepos.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
    final Table tblRepos = new Table(group, SWT.BORDER | SWT.MULTI);
    vwrRepos = new TableViewer(tblRepos);
    vwrRepos.setContentProvider(ArrayContentProvider.getInstance());
    vwrRepos.setLabelProvider(new URLLabelProvider(tblRepos.getDisplay()));
    vwrRepos.setInput(templateRepos);
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gd.widthHint = 260;
    gd.heightHint = 80;
    tblRepos.setLayoutData(gd);
    tblRepos.setEnabled(enableTemplateRepo);
    final AddRemoveButtonBarPart addRemoveRepoPart = new AddRemoveButtonBarPart();
    Control addRemovePanel = addRemoveRepoPart.createControl(group, SWT.FLAT | SWT.VERTICAL);
    addRemovePanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    addRemoveRepoPart.setRemoveEnabled(false);
    addRemoveRepoPart.addListener(new AddRemoveListener() {

        @Override
        public void addSelected() {
            doAddRepo();
        }

        @Override
        public void removeSelected() {
            doRemoveRepo();
        }
    });
    vwrRepos.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            addRemoveRepoPart.setRemoveEnabled(!vwrRepos.getSelection().isEmpty());
        }
    });
    tblRepos.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == SWT.DEL && e.stateMask == 0)
                doRemoveRepo();
        }
    });
    btnEnableTemplateRepo.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent ev) {
            enableTemplateRepo = btnEnableTemplateRepo.getSelection();
            tblRepos.setEnabled(enableTemplateRepo);
            validate();
        }
    });
    return composite;
}
Also used : Group(org.eclipse.swt.widgets.Group) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) KeyAdapter(org.eclipse.swt.events.KeyAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) AddRemoveButtonBarPart(org.bndtools.utils.swt.AddRemoveButtonBarPart) KeyEvent(org.eclipse.swt.events.KeyEvent) URLLabelProvider(bndtools.shared.URLLabelProvider) GridLayout(org.eclipse.swt.layout.GridLayout) Control(org.eclipse.swt.widgets.Control) AddRemoveListener(org.bndtools.utils.swt.AddRemoveButtonBarPart.AddRemoveListener) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) ControlDecoration(org.eclipse.jface.fieldassist.ControlDecoration) SelectionEvent(org.eclipse.swt.events.SelectionEvent) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 69 with KeyAdapter

use of org.eclipse.swt.events.KeyAdapter in project bndtools by bndtools.

the class EditableParametersPart method createControl.

public Control createControl(Composite parent) {
    this.parent = parent;
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout(2, false);
    composite.setLayout(layout);
    Label titleLabel = new Label(composite, SWT.NONE);
    titleLabel.setText(title);
    titleLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
    Table table = new Table(composite, SWT.BORDER | SWT.MULTI);
    viewer = new TableViewer(table);
    viewer.setContentProvider(ArrayContentProvider.getInstance());
    final Image iconImg = imageDescriptor.createImage(parent.getDisplay());
    viewer.setLabelProvider(new StyledCellLabelProvider() {

        @Override
        public void update(ViewerCell cell) {
            @SuppressWarnings("unchecked") Pair<String, Attrs> entry = (Pair<String, Attrs>) cell.getElement();
            StyledString label = new StyledString(entry.getFirst(), BoldStyler.INSTANCE_DEFAULT);
            for (Entry<String, String> attribEntry : entry.getSecond().entrySet()) {
                label.append("; " + attribEntry.getKey() + "=", StyledString.QUALIFIER_STYLER);
                label.append(attribEntry.getValue());
            }
            cell.setText(label.toString());
            cell.setStyleRanges(label.getStyleRanges());
            cell.setImage(iconImg);
        }
    });
    viewer.setInput(entries);
    GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false);
    gd.widthHint = 280;
    gd.heightHint = 80;
    table.setLayoutData(gd);
    final AddRemoveButtonBarPart buttonBarPart = new AddRemoveButtonBarPart();
    ToolBar buttonBar = buttonBarPart.createControl(composite, SWT.FLAT | SWT.VERTICAL);
    buttonBar.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    final Image imgEdit = ImageDescriptor.createFromURL(BUNDLE.getEntry("icons/edit.gif")).createImage(parent.getDisplay());
    final Image imgEditDisabled = ImageDescriptor.createFromURL(BUNDLE.getEntry("icons/edit-disabled.gif")).createImage(parent.getDisplay());
    final ToolItem btnEdit = new ToolItem(buttonBar, SWT.PUSH);
    btnEdit.setImage(imgEdit);
    btnEdit.setDisabledImage(imgEditDisabled);
    buttonBarPart.setRemoveEnabled(false);
    btnEdit.setEnabled(false);
    buttonBarPart.addListener(new AddRemoveListener() {

        @Override
        public void addSelected() {
            doAdd();
        }

        @Override
        public void removeSelected() {
            doRemove();
        }
    });
    btnEdit.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doEdit();
        }
    });
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            boolean enabled = !viewer.getSelection().isEmpty();
            buttonBarPart.setRemoveEnabled(enabled);
            btnEdit.setEnabled(enabled);
        }
    });
    viewer.addOpenListener(new IOpenListener() {

        @Override
        public void open(OpenEvent event) {
            doEdit();
        }
    });
    table.addKeyListener(new KeyAdapter() {

        @Override
        public void keyPressed(KeyEvent e) {
            if (e.keyCode == SWT.DEL && e.stateMask == 0)
                doRemove();
        }
    });
    composite.addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent ev) {
            iconImg.dispose();
            imgEdit.dispose();
            imgEditDisabled.dispose();
        }
    });
    return composite;
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Label(org.eclipse.swt.widgets.Label) Attrs(aQute.bnd.header.Attrs) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) StyledString(org.eclipse.jface.viewers.StyledString) Image(org.eclipse.swt.graphics.Image) DisposeEvent(org.eclipse.swt.events.DisposeEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) Entry(java.util.Map.Entry) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ToolItem(org.eclipse.swt.widgets.ToolItem) Pair(aQute.libg.tuple.Pair) StyledCellLabelProvider(org.eclipse.jface.viewers.StyledCellLabelProvider) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StyledString(org.eclipse.jface.viewers.StyledString) ViewerCell(org.eclipse.jface.viewers.ViewerCell) AddRemoveButtonBarPart(org.bndtools.utils.swt.AddRemoveButtonBarPart) AddRemoveListener(org.bndtools.utils.swt.AddRemoveButtonBarPart.AddRemoveListener) IOpenListener(org.eclipse.jface.viewers.IOpenListener) GridData(org.eclipse.swt.layout.GridData) ToolBar(org.eclipse.swt.widgets.ToolBar) TableViewer(org.eclipse.jface.viewers.TableViewer) OpenEvent(org.eclipse.jface.viewers.OpenEvent)

Example 70 with KeyAdapter

use of org.eclipse.swt.events.KeyAdapter in project bndtools by bndtools.

the class PkgPatternsListPart method createSection.

protected void createSection(Section section, FormToolkit toolkit) {
    Composite composite = toolkit.createComposite(section);
    section.setClient(composite);
    ToolBar toolbar = new ToolBar(section, SWT.FLAT);
    section.setTextClient(toolbar);
    final ToolItem addItem = new ToolItem(toolbar, SWT.PUSH);
    addItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
    addItem.setToolTipText("Add");
    final ToolItem insertItem = new ToolItem(toolbar, SWT.PUSH);
    insertItem.setImage(imgInsert);
    insertItem.setToolTipText("Insert");
    insertItem.setEnabled(false);
    final ToolItem removeItem = new ToolItem(toolbar, SWT.PUSH);
    removeItem.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE));
    removeItem.setDisabledImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE_DISABLED));
    removeItem.setToolTipText("Remove");
    removeItem.setEnabled(false);
    Table table = toolkit.createTable(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
    viewer = new TableViewer(table);
    viewer.setUseHashlookup(false);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(labelProvider);
    toolbar = new ToolBar(composite, SWT.FLAT | SWT.HORIZONTAL | SWT.RIGHT);
    final ToolItem btnMoveUp = new ToolItem(toolbar, SWT.PUSH);
    btnMoveUp.setText("Up");
    btnMoveUp.setImage(imgUp);
    btnMoveUp.setEnabled(false);
    final ToolItem btnMoveDown = new ToolItem(toolbar, SWT.PUSH);
    btnMoveDown.setText("Down");
    btnMoveDown.setImage(imgDown);
    btnMoveDown.setEnabled(false);
    // Listeners
    table.addFocusListener(new FocusAdapter() {

        @Override
        public void focusGained(FocusEvent e) {
            ISelection selection = viewer.getSelection();
            if (!selection.isEmpty())
                managedForm.fireSelectionChanged(PkgPatternsListPart.this, selection);
        }
    });
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            List<C> oldSelection = selection;
            IStructuredSelection structSel = (IStructuredSelection) event.getSelection();
            @SuppressWarnings("unchecked") List<C> newSelection = structSel.toList();
            selection = newSelection;
            propChangeSupport.firePropertyChange(PROP_SELECTION, oldSelection, selection);
            managedForm.fireSelectionChanged(PkgPatternsListPart.this, event.getSelection());
            boolean enabled = !viewer.getSelection().isEmpty();
            insertItem.setEnabled(enabled);
            removeItem.setEnabled(enabled);
            btnMoveUp.setEnabled(enabled);
            btnMoveDown.setEnabled(enabled);
        }
    });
    viewer.addDropSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] { LocalSelectionTransfer.getTransfer(), ResourceTransfer.getInstance(), TextTransfer.getInstance() }, new PackageDropAdapter<C>(viewer) {

        @Override
        protected C createNewEntry(String packageName) {
            return newHeaderClause(packageName);
        }

        @Override
        protected void addRows(int index, Collection<C> rows) {
            doAddClauses(rows, index, true);
        }

        @Override
        protected int indexOf(Object object) {
            return clauses.indexOf(object);
        }
    });
    table.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(KeyEvent e) {
            if (e.character == SWT.DEL) {
                doRemoveSelectedClauses();
            } else if (e.character == '+') {
                doAddClausesAfterSelection(generateClauses());
            }
        }
    });
    addItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doAddClausesAfterSelection(generateClauses());
        }
    });
    insertItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doInsertClausesAtSelection(generateClauses());
        }
    });
    removeItem.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doRemoveSelectedClauses();
        }
    });
    btnMoveUp.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doMoveUp();
        }
    });
    btnMoveDown.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            doMoveDown();
        }
    });
    // Layout
    GridLayout layout;
    layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    composite.setLayout(layout);
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.widthHint = 75;
    gd.heightHint = 75;
    table.setLayoutData(gd);
    toolbar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
}
Also used : FocusAdapter(org.eclipse.swt.events.FocusAdapter) KeyAdapter(org.eclipse.swt.events.KeyAdapter) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) FocusEvent(org.eclipse.swt.events.FocusEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ISelection(org.eclipse.jface.viewers.ISelection) SelectionEvent(org.eclipse.swt.events.SelectionEvent) List(java.util.List) ArrayList(java.util.ArrayList) ToolItem(org.eclipse.swt.widgets.ToolItem) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ToolBar(org.eclipse.swt.widgets.ToolBar) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

KeyAdapter (org.eclipse.swt.events.KeyAdapter)80 KeyEvent (org.eclipse.swt.events.KeyEvent)80 GridData (org.eclipse.swt.layout.GridData)50 GridLayout (org.eclipse.swt.layout.GridLayout)40 Composite (org.eclipse.swt.widgets.Composite)39 SelectionEvent (org.eclipse.swt.events.SelectionEvent)33 Text (org.eclipse.swt.widgets.Text)30 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)28 Label (org.eclipse.swt.widgets.Label)24 Button (org.eclipse.swt.widgets.Button)20 TableViewer (org.eclipse.jface.viewers.TableViewer)18 ModifyEvent (org.eclipse.swt.events.ModifyEvent)17 ModifyListener (org.eclipse.swt.events.ModifyListener)16 FocusEvent (org.eclipse.swt.events.FocusEvent)15 Point (org.eclipse.swt.graphics.Point)15 Table (org.eclipse.swt.widgets.Table)14 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)12 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)12 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)12 FocusAdapter (org.eclipse.swt.events.FocusAdapter)11