Search in sources :

Example 61 with ArrayContentProvider

use of org.eclipse.jface.viewers.ArrayContentProvider in project tdi-studio-se by Talend.

the class SaveChartSetAsDialog method createChartSetViewer.

/**
     * Creates the chart set viewer.
     * 
     * @param parent The parent composite
     * @return The chart set viewer
     */
private TableViewer createChartSetViewer(Composite parent) {
    TableViewer viewer = new TableViewer(parent, SWT.BORDER | SWT.FULL_SELECTION);
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 300;
    viewer.getTable().setLayoutData(gridData);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new LabelProvider());
    viewer.setInput(chartSets.toArray(new String[chartSets.size()]));
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            if (ignoreSelection) {
                return;
            }
            ISelection selection = event.getSelection();
            if (selection instanceof StructuredSelection) {
                Object element = ((StructuredSelection) selection).getFirstElement();
                if (element != null) {
                    chartSetText.setText(element.toString());
                    deleteButton.setEnabled(true);
                }
            }
        }
    });
    return viewer;
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ISelection(org.eclipse.jface.viewers.ISelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) TableViewer(org.eclipse.jface.viewers.TableViewer) LabelProvider(org.eclipse.jface.viewers.LabelProvider)

Example 62 with ArrayContentProvider

use of org.eclipse.jface.viewers.ArrayContentProvider in project bndtools by bndtools.

the class JarListWizardPage method createControl.

@Override
public void createControl(final Composite parent) {
    setTitle("Select JARs");
    final Composite composite = new Composite(parent, SWT.NONE);
    Label lblHint = new Label(composite, SWT.WRAP);
    lblHint.setText("Selected files (hint: drag files from an external application into this list):");
    final Table table = new Table(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    viewer = new TableViewer(table);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new ClassPathLabelProvider());
    btnAdd = new Button(composite, SWT.PUSH);
    btnAdd.setText("Add");
    btnAddExternal = new Button(composite, SWT.PUSH);
    btnAddExternal.setText("Add External");
    btnRemove = new Button(composite, SWT.PUSH);
    btnRemove.setText("Remove");
    viewer.setInput(paths);
    update();
    // Listeners
    ViewerDropAdapter dropAdapter = new ViewerDropAdapter(viewer) {

        @Override
        public void dragEnter(DropTargetEvent event) {
            super.dragEnter(event);
            event.detail = DND.DROP_COPY;
        }

        @Override
        public boolean validateDrop(Object target, int operation, TransferData transferType) {
            return true;
        }

        @Override
        public boolean performDrop(Object data) {
            if (data instanceof String[]) {
                String[] newPaths = (String[]) data;
                List<IPath> added = new ArrayList<IPath>(newPaths.length);
                for (String path : newPaths) {
                    added.add(new Path(path));
                }
                if (!added.isEmpty()) {
                    addToPaths(added);
                    viewer.add(added.toArray());
                    update();
                }
            }
            return true;
        }
    };
    dropAdapter.setFeedbackEnabled(false);
    dropAdapter.setSelectionFeedbackEnabled(false);
    viewer.addDropSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] { FileTransfer.getInstance() }, dropAdapter);
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(final SelectionChangedEvent event) {
            update();
        }
    });
    btnAdd.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            // IResource newFile = ResourcesPlugin.getWorkspace().getRoot();
            // if(newFile != null) {
            ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
            dialog.setValidator(new ISelectionStatusValidator() {

                @Override
                public IStatus validate(Object[] selection) {
                    if (selection.length > 0 && selection[0] instanceof IFile) {
                        //$NON-NLS-1$
                        return new Status(IStatus.OK, Plugin.PLUGIN_ID, IStatus.OK, "", null);
                    }
                    //$NON-NLS-1$
                    return new Status(IStatus.ERROR, Plugin.PLUGIN_ID, IStatus.ERROR, "", null);
                }
            });
            dialog.setAllowMultiple(true);
            dialog.setTitle("JAR File Selection");
            dialog.setMessage("Select one or more JAR files.");
            //$NON-NLS-1$
            dialog.addFilter(new FileExtensionFilter("jar"));
            dialog.setInput(ResourcesPlugin.getWorkspace());
            if (dialog.open() == Window.OK) {
                Object[] files = dialog.getResult();
                List<IPath> added = new ArrayList<IPath>(files.length);
                for (Object file : files) {
                    added.add(((IResource) file).getFullPath().makeRelative());
                }
                if (!added.isEmpty()) {
                    addToPaths(added);
                    viewer.add(added.toArray());
                }
            }
            // }
            update();
        }
    });
    btnAddExternal.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(getShell(), SWT.OPEN | SWT.MULTI);
            dialog.setFilterExtensions(new String[] { //$NON-NLS-1$
            "*.jar" });
            String res = dialog.open();
            if (res != null) {
                IPath filterPath = new Path(dialog.getFilterPath());
                String[] fileNames = dialog.getFileNames();
                List<IPath> added = new ArrayList<IPath>(fileNames.length);
                for (String fileName : fileNames) {
                    added.add(filterPath.append(fileName));
                }
                if (!added.isEmpty()) {
                    addToPaths(added);
                    viewer.add(added.toArray());
                }
            }
            update();
        }
    });
    btnRemove.addSelectionListener(new SelectionAdapter() {

        @SuppressWarnings("unchecked")
        @Override
        public void widgetSelected(SelectionEvent e) {
            removeFromPaths(((IStructuredSelection) viewer.getSelection()).toList());
            viewer.remove(((IStructuredSelection) viewer.getSelection()).toArray());
            update();
        }
    });
    // Layout
    composite.setLayout(new GridLayout(2, false));
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3));
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    btnAddExternal.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    lblHint.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1));
    setControl(composite);
}
Also used : WorkbenchLabelProvider(org.eclipse.ui.model.WorkbenchLabelProvider) IFile(org.eclipse.core.resources.IFile) Label(org.eclipse.swt.widgets.Label) ArrayList(java.util.ArrayList) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ClassPathLabelProvider(bndtools.utils.ClassPathLabelProvider) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) TransferData(org.eclipse.swt.dnd.TransferData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileExtensionFilter(bndtools.utils.FileExtensionFilter) ISelectionStatusValidator(org.eclipse.ui.dialogs.ISelectionStatusValidator) List(java.util.List) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) IPath(org.eclipse.core.runtime.IPath) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) ViewerDropAdapter(org.eclipse.jface.viewers.ViewerDropAdapter) DropTargetEvent(org.eclipse.swt.dnd.DropTargetEvent) WorkbenchContentProvider(org.eclipse.ui.model.WorkbenchContentProvider) ElementTreeSelectionDialog(org.eclipse.ui.dialogs.ElementTreeSelectionDialog) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) FileDialog(org.eclipse.swt.widgets.FileDialog)

Example 63 with ArrayContentProvider

use of org.eclipse.jface.viewers.ArrayContentProvider in project bndtools by bndtools.

the class AddFilesToRepositoryWizardPage method createControl.

@Override
@SuppressWarnings("unused")
public void createControl(Composite parent) {
    setTitle("Add Files to Repository");
    Composite composite = new Composite(parent, SWT.NONE);
    new Label(composite, SWT.NONE).setText("Selected files:");
    // Spacer;
    new Label(composite, SWT.NONE);
    Table table = new Table(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    table.setLinesVisible(true);
    table.setHeaderVisible(true);
    TableColumn col;
    col = new TableColumn(table, SWT.NONE);
    col.setText("Path");
    col.setWidth(300);
    col = new TableColumn(table, SWT.NONE);
    col.setText("Bundle Name/Version");
    col.setWidth(300);
    viewer = new TableViewer(table);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new StyledCellLabelProvider() {

        @Override
        public void update(ViewerCell cell) {
            File file = (File) cell.getElement();
            Pair<String, String> bundleId = bsnMap.get(file);
            int index = cell.getColumnIndex();
            if (index == 0) {
                if (bundleId == null) {
                    cell.setImage(errorImg);
                } else {
                    cell.setImage(jarImg);
                }
                StyledString label = new StyledString(file.getName());
                String parentPath = file.getParent();
                if (parentPath != null) {
                    label.append(" (" + parentPath + ")", StyledString.QUALIFIER_STYLER);
                }
                cell.setText(label.getString());
                cell.setStyleRanges(label.getStyleRanges());
            } else if (index == 1) {
                if (bundleId == null) {
                    cell.setImage(errorImg);
                    cell.setText("Not a JAR file");
                } else {
                    String bsn = bundleId.getFirst();
                    String version = bundleId.getSecond();
                    if (bsn == null) {
                        cell.setImage(warnImg);
                        cell.setText("Not a Bundle JAR");
                    } else {
                        cell.setImage(okayImg);
                        StyledString styledString = new StyledString(bsn);
                        if (version != null) {
                            styledString.append(" [" + version + "]", StyledString.COUNTER_STYLER);
                            cell.setText(styledString.getString());
                            cell.setStyleRanges(styledString.getStyleRanges());
                        }
                    }
                }
            }
        }
    });
    viewer.setInput(files);
    validate();
    final Button btnAdd = new Button(composite, SWT.PUSH);
    btnAdd.setText("Add JARs...");
    final Button btnAddExternal = new Button(composite, SWT.PUSH);
    btnAddExternal.setText("Add External JARs...");
    final Button btnRemove = new Button(composite, SWT.NONE);
    btnRemove.setText("Remove");
    btnRemove.setEnabled(false);
    // LISTENERS
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            btnRemove.setEnabled(!viewer.getSelection().isEmpty());
        }
    });
    btnAdd.addSelectionListener(new SelectionAdapter() {

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

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

        @Override
        public void widgetSelected(SelectionEvent e) {
            doRemove();
        }
    });
    // LAYOUT
    composite.setLayout(new GridLayout(2, false));
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 4));
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    btnRemove.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
    setControl(composite);
}
Also used : StyledCellLabelProvider(org.eclipse.jface.viewers.StyledCellLabelProvider) Table(org.eclipse.swt.widgets.Table) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) TableColumn(org.eclipse.swt.widgets.TableColumn) ViewerCell(org.eclipse.jface.viewers.ViewerCell) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) IFile(org.eclipse.core.resources.IFile) File(java.io.File) Pair(bndtools.types.Pair)

Example 64 with ArrayContentProvider

use of org.eclipse.jface.viewers.ArrayContentProvider 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)

Example 65 with ArrayContentProvider

use of org.eclipse.jface.viewers.ArrayContentProvider in project bndtools by bndtools.

the class PrivatePackagesPart method createSection.

void createSection(Section section, FormToolkit toolkit) {
    section.setText("Private Packages");
    section.setDescription("The listed packages will be included in the bundle but not exported.");
    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 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);
    Composite composite = toolkit.createComposite(section);
    section.setClient(composite);
    table = toolkit.createTable(composite, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    viewer = new TableViewer(table);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new PrivatePackageTableLabelProvider());
    // Listeners
    viewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            managedForm.fireSelectionChanged(PrivatePackagesPart.this, event.getSelection());
            removeItem.setEnabled(!viewer.getSelection().isEmpty());
        }
    });
    viewer.addDropSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] { LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance(), ResourceTransfer.getInstance() }, new PackageDropAdapter<String>(viewer) {

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

        @Override
        protected void addRows(int index, Collection<String> rows) {
            if (rows.isEmpty())
                // skip marking dirty
                return;
            if (index == -1) {
                packages.addAll(rows);
                viewer.add(rows.toArray());
            } else {
                packages.addAll(index, rows);
                viewer.refresh();
            }
            viewer.setSelection(new StructuredSelection(rows));
            markDirty();
        }

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

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

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

        @Override
        public void widgetSelected(SelectionEvent e) {
            doRemovePackages();
        }
    });
    // Layout
    GridLayout layout = new GridLayout(1, false);
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    composite.setLayout(layout);
    GridData gd;
    gd = new GridData(SWT.FILL, SWT.FILL, true, true);
    gd.heightHint = 75;
    gd.widthHint = 75;
    table.setLayoutData(gd);
}
Also used : PrivatePackageTableLabelProvider(bndtools.editor.common.PrivatePackageTableLabelProvider) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) KeyAdapter(org.eclipse.swt.events.KeyAdapter) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) ToolBar(org.eclipse.swt.widgets.ToolBar) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) TableViewer(org.eclipse.jface.viewers.TableViewer) ToolItem(org.eclipse.swt.widgets.ToolItem)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)65 GridData (org.eclipse.swt.layout.GridData)51 TableViewer (org.eclipse.jface.viewers.TableViewer)44 Composite (org.eclipse.swt.widgets.Composite)44 SelectionEvent (org.eclipse.swt.events.SelectionEvent)39 Table (org.eclipse.swt.widgets.Table)38 GridLayout (org.eclipse.swt.layout.GridLayout)35 Button (org.eclipse.swt.widgets.Button)29 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)27 Label (org.eclipse.swt.widgets.Label)26 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)24 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)22 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)22 TableColumn (org.eclipse.swt.widgets.TableColumn)20 Group (org.eclipse.swt.widgets.Group)19 Event (org.eclipse.swt.widgets.Event)16 Listener (org.eclipse.swt.widgets.Listener)16 ArrayList (java.util.ArrayList)14 Point (org.eclipse.swt.graphics.Point)13 Text (org.eclipse.swt.widgets.Text)13