Search in sources :

Example 1 with List

use of org.eclipse.swt.widgets.List in project tdi-studio-se by Talend.

the class ColorCombo method createPopup.

void createPopup(String[] items, int selectionIndex) {
    // create shell and list
    popup = new Shell(getShell(), SWT.NO_TRIM | SWT.ON_TOP);
    int style = getStyle();
    int listStyle = SWT.SINGLE | SWT.V_SCROLL;
    if ((style & SWT.FLAT) != 0) {
        listStyle |= SWT.FLAT;
    }
    if ((style & SWT.RIGHT_TO_LEFT) != 0) {
        listStyle |= SWT.RIGHT_TO_LEFT;
    }
    if ((style & SWT.LEFT_TO_RIGHT) != 0) {
        listStyle |= SWT.LEFT_TO_RIGHT;
    }
    list = new List(popup, listStyle);
    if (font != null) {
        list.setFont(font);
    }
    if (foreground != null) {
        list.setForeground(foreground);
    }
    if (background != null) {
        list.setBackground(background);
    }
    int[] popupEvents = { SWT.Close, SWT.Paint, SWT.Deactivate };
    for (int i = 0; i < popupEvents.length; i++) {
        popup.addListener(popupEvents[i], listener);
    }
    int[] listEvents = { SWT.MouseUp, SWT.Selection, SWT.Traverse, SWT.KeyDown, SWT.KeyUp, SWT.FocusIn, SWT.Dispose };
    for (int i = 0; i < listEvents.length; i++) {
        list.addListener(listEvents[i], listener);
    }
    if (items != null) {
        list.setItems(items);
    }
    if (selectionIndex != -1) {
        list.setSelection(selectionIndex);
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) List(org.eclipse.swt.widgets.List) Point(org.eclipse.swt.graphics.Point)

Example 2 with List

use of org.eclipse.swt.widgets.List in project tdi-studio-se by Talend.

the class AllTypeDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    Composite createDialogArea = (Composite) super.createDialogArea(parent);
    createDialogArea.setLayout(new FillLayout());
    SashForm baseCom = new SashForm(createDialogArea, SWT.VERTICAL | SWT.BORDER);
    baseCom.setLayout(new GridLayout(1, true));
    Group group1 = new Group(baseCom, SWT.None);
    group1.setText(Messages.getString("AllTypeDialog.Group1Text"));
    group1.setLayoutData(new GridData(GridData.FILL_BOTH));
    group1.setLayout(new FillLayout());
    Font font = new Font(Display.getCurrent(), "Arial", 43, 3);
    group1.setFont(font);
    font.dispose();
    Group group2 = new Group(baseCom, SWT.None);
    group2.setText(Messages.getString("AllTypeDialog.Group2Text"));
    group2.setLayoutData(new GridData(GridData.FILL_BOTH));
    font = new Font(Display.getCurrent(), "Arial", 43, 3);
    group2.setFont(font);
    group2.setLayout(new FillLayout());
    font.dispose();
    list = new List(group1, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    list.setItems(allXMLSchemaTypeName);
    treeViewer = new TreeViewer(group2, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    tree = treeViewer.getTree();
    tree.setHeaderVisible(false);
    tree.setLinesVisible(true);
    treeViewer.setContentProvider(new WebServiceTreeContentProvider());
    treeViewer.setLabelProvider(new AllTypeLabelProvider());
    treeViewer.setInput(null);
    treeViewer.refresh();
    list.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            String selection = list.getSelection()[0];
            if (selection.contains(COMPLEXTYPE)) {
                String[] split = selection.split(":");
                String complexTypeName = split[1];
                for (XmlSchemaType xmlSchemaType : allXmlSchemaType) {
                    if (xmlSchemaType.getName().equals(complexTypeName)) {
                        ParameterInfo parameterRoot = new ParameterInfo();
                        parameterRoot.setName("parameters");
                        ParameterInfo parameterSon = new ParameterInfo();
                        parameterSon.setName(complexTypeName);
                        parameterSon.setParent(parameterRoot);
                        parameterRoot.getParameterInfos().add(parameterSon);
                        XmlSchemaComplexType xmlElementComplexType = (XmlSchemaComplexType) xmlSchemaType;
                        XmlSchemaParticle xmlSchemaParticle = xmlElementComplexType.getParticle();
                        if (xmlSchemaParticle instanceof XmlSchemaGroupBase) {
                            XmlSchemaGroupBase xmlSchemaGroupBase = (XmlSchemaGroupBase) xmlSchemaParticle;
                            XmlSchemaObjectCollection childCollection = xmlSchemaGroupBase.getItems();
                            if (childCollection != null) {
                                buildParameterFromCollection(childCollection, parameterSon);
                            }
                        }
                        treeViewer.setInput(parameterRoot);
                        treeViewer.refresh();
                        selectedParaInfo = parameterSon;
                    }
                }
            } else {
                treeViewer.setInput(null);
                treeViewer.refresh();
                selectedParaInfo = null;
            }
        }
    });
    return baseCom;
}
Also used : Group(org.eclipse.swt.widgets.Group) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) XmlSchemaParticle(org.apache.ws.commons.schema.XmlSchemaParticle) FillLayout(org.eclipse.swt.layout.FillLayout) ParameterInfo(org.talend.designer.webservice.ws.wsdlinfo.ParameterInfo) XmlSchemaType(org.apache.ws.commons.schema.XmlSchemaType) XmlSchemaGroupBase(org.apache.ws.commons.schema.XmlSchemaGroupBase) Font(org.eclipse.swt.graphics.Font) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) List(org.eclipse.swt.widgets.List) ArrayList(java.util.ArrayList) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) WebServiceTreeContentProvider(org.talend.designer.webservice.ui.tree.WebServiceTreeContentProvider) XmlSchemaObjectCollection(org.apache.ws.commons.schema.XmlSchemaObjectCollection)

Example 3 with List

use of org.eclipse.swt.widgets.List in project tdi-studio-se by Talend.

the class ImportComponentDialog method createDialogArea.

/*
     * (non-Javadoc) Method declared on Dialog.
     */
protected Control createDialogArea(Composite parent) {
    Composite composite = (Composite) super.createDialogArea(parent);
    GridLayout gl = new GridLayout(5, true);
    composite.setLayout(gl);
    if (message != null) {
        Label label = new Label(composite, SWT.WRAP);
        label.setText(message);
        GridData data = new GridData(GridData.GRAB_HORIZONTAL);
        data.horizontalSpan = 5;
        label.setLayoutData(data);
        label.setFont(parent.getFont());
    }
    Label label1 = new Label(composite, SWT.NONE);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
    gd.horizontalSpan = 2;
    label1.setLayoutData(gd);
    //$NON-NLS-1$
    label1.setText(Messages.getString("ImportComponentDialog.SelectDirectoryLabel"));
    text = new Text(composite, SWT.BORDER);
    text.setEditable(false);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    text.setLayoutData(gd);
    if (paletteComponentsPath == null) {
        //$NON-NLS-1$
        paletteComponentsPath = "";
    }
    text.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            validateInput(true);
        }
    });
    Button button = new Button(composite, SWT.NONE);
    //$NON-NLS-1$
    button.setText(Messages.getString("ImportComponentDialog.Browser"));
    gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    gd.horizontalSpan = 1;
    button.setLayoutData(gd);
    button.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog dd = new DirectoryDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
            String path = dd.open();
            if (path != null) {
                text.setText(path);
            }
        }
    });
    Button showPaletteComponents = new Button(composite, SWT.NONE);
    gd = new GridData();
    gd.horizontalSpan = 2;
    showPaletteComponents.setLayoutData(gd);
    //$NON-NLS-1$
    showPaletteComponents.setText(Messages.getString("ImportComponentDialog.ShowPaletteComponents"));
    showPaletteComponents.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
            text.setText(paletteComponentsPath);
        }
    });
    label1 = new Label(composite, SWT.LEFT);
    gd = new GridData();
    gd.horizontalSpan = 1;
    label1.setLayoutData(gd);
    //$NON-NLS-1$
    label1.setText(Messages.getString("ImportComponentDialog.Filter"));
    filterText = new Text(composite, SWT.BORDER);
    filterText.setEditable(true);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 2;
    filterText.setLayoutData(gd);
    filterText.addModifyListener(new ModifyListener() {

        public void modifyText(ModifyEvent e) {
            validateInput(false);
        }
    });
    label1 = new Label(composite, SWT.LEFT);
    gd = new GridData();
    gd.horizontalSpan = 5;
    label1.setLayoutData(gd);
    //$NON-NLS-1$
    label1.setText(Messages.getString("ImportComponentDialog.ChooseComponentsLabel"));
    componentList = new List(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 5;
    componentList.setLayoutData(gd);
    componentList.addMouseListener(new MouseListener() {

        public void mouseDoubleClick(MouseEvent e) {
        }

        public void mouseDown(MouseEvent e) {
            validateSelected();
        }

        public void mouseUp(MouseEvent e) {
            validateSelected();
        }
    });
    errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.CENTER);
    gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    gd.horizontalSpan = 5;
    label1.setLayoutData(gd);
    errorMessageText.setLayoutData(gd);
    errorMessageText.setBackground(errorMessageText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
    applyDialogFont(composite);
    //$NON-NLS-1$
    text.setText("");
    return composite;
}
Also used : MouseEvent(org.eclipse.swt.events.MouseEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) MouseListener(org.eclipse.swt.events.MouseListener) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ArrayList(java.util.ArrayList) LinkedList(java.util.LinkedList) List(org.eclipse.swt.widgets.List) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 4 with List

use of org.eclipse.swt.widgets.List in project ACS by ACS-Community.

the class SourcesView method createViewWidgets.

private void createViewWidgets(final Composite parent) {
    _sash = new SashForm(parent, SWT.HORIZONTAL);
    _sash.setLayout(new FillLayout());
    /* Left pane */
    _sourcesComp = new Composite(_sash, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    _sourcesComp.setLayout(layout);
    _listGroup = new Group(_sourcesComp, SWT.SHADOW_ETCHED_IN);
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    _listGroup.setLayoutData(gd);
    GridLayout gl = new GridLayout();
    gl.numColumns = 1;
    _listGroup.setLayout(gl);
    _listGroup.setText("Sources List");
    _sourcesList = new List(_listGroup, SWT.BORDER);
    gd = new GridData();
    gd.verticalAlignment = SWT.FILL;
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.grabExcessHorizontalSpace = true;
    _sourcesList.setLayoutData(gd);
    _sourcesButtonsComp = new Composite(_sourcesComp, SWT.NONE);
    layout = new GridLayout();
    layout.numColumns = 2;
    _sourcesButtonsComp.setLayout(layout);
    _addSourceButton = new Button(_sourcesButtonsComp, SWT.None);
    _addSourceButton.setText("Add");
    _addSourceButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ADD));
    _deleteSourceButton = new Button(_sourcesButtonsComp, SWT.None);
    _deleteSourceButton.setText("Delete");
    _deleteSourceButton.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_ETOOL_DELETE));
    /* Please change this in the future when more SOURCES will be available */
    _addSourceButton.setEnabled(false);
    _deleteSourceButton.setEnabled(false);
    _sourcesList.addSelectionListener(new SelectionListener() {

        public void widgetDefaultSelected(SelectionEvent e) {
            widgetSelected(e);
        }

        public void widgetSelected(SelectionEvent e) {
            String source = _sourcesList.getSelection()[0];
            Control c = _compInitial.getChildren()[0];
            if (c instanceof Label) {
                c.dispose();
                _group.setVisible(true);
                _group.layout();
            }
            fillSource(source);
            _compInitial.layout();
        }
    });
    _addSourceButton.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            InputDialog dialog = new InputDialog(SourcesView.this.getViewSite().getShell(), "New source", "Enter the source name", null, new IInputValidator() {

                public String isValid(String newText) {
                    if (newText.trim().compareTo("") == 0)
                        return "The name is empty";
                    return null;
                }
            });
            dialog.setBlockOnOpen(true);
            dialog.open();
            int returnCode = dialog.getReturnCode();
            if (returnCode == InputDialog.OK) {
                Source newSource = new Source();
                newSource.setSourceId(dialog.getValue());
                try {
                    _sourceManager.addSource(newSource);
                } catch (IllegalOperationException e) {
                    ErrorDialog error = new ErrorDialog(SourcesView.this.getViewSite().getShell(), "Source already exist", "The source " + dialog.getValue() + " already exists in the current configuration", new Status(IStatus.ERROR, "cl.utfsm.acs.acg", e.getMessage()), IStatus.ERROR);
                    error.setBlockOnOpen(true);
                    error.open();
                    return;
                }
                refreshContents();
                if (_sourcesList.getItems().length != 0) {
                    int lenght = _sourcesList.getItems().length;
                    lenght -= 1;
                    _sourcesList.select(lenght);
                    _descriptionText.setText(_sourcesList.getItem(lenght).toString());
                }
            }
        }
    });
    _deleteSourceButton.addListener(SWT.Selection, new Listener() {

        public void handleEvent(Event event) {
            boolean choice = MessageDialog.openQuestion(SourcesView.this.getViewSite().getShell(), "Confirmation", "Are you sure you want to delete this Source");
            if (choice == true) {
                String[] tmp = _sourcesList.getSelection();
                if (tmp.length == 0) {
                    MessageBox box = new MessageBox(getViewSite().getShell(), SWT.OK | SWT.ICON_ERROR | SWT.APPLICATION_MODAL);
                    box.setText("Empty selection");
                    box.setMessage("There are no sources selected to be deleted");
                    box.open();
                    return;
                }
                String source = tmp[0];
                try {
                    _sourceManager.deleteSource(_sourceManager.getSource(source));
                } catch (IllegalOperationException e) {
                    ErrorDialog error = new ErrorDialog(SourcesView.this.getViewSite().getShell(), "Cannot delete source", "The source cannot be deleted", new Status(IStatus.ERROR, "cl.utfsm.acs.acg", e.getMessage()), IStatus.ERROR);
                    error.setBlockOnOpen(true);
                    error.open();
                }
                refreshContents();
                if (_sourcesList.getItems().length != 0) {
                    int lenght = _sourcesList.getItems().length;
                    lenght -= 1;
                    _sourcesList.select(lenght);
                    _sourceNameText.setText(_sourcesList.getItem(lenght).toString());
                }
            }
        }
    });
    /* Right pane */
    _compInitial = new Composite(_sash, SWT.NONE);
    _compInitial.setLayout(new GridLayout());
    new Label(_compInitial, SWT.NONE).setText("Select a source");
    layout = new GridLayout();
    layout.numColumns = 2;
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.grabExcessVerticalSpace = true;
    _group = new Group(_compInitial, SWT.SHADOW_ETCHED_IN);
    _group.setText("Source information");
    _group.setLayout(layout);
    _group.setLayoutData(gd);
    _sourceNameLabel = new Label(_group, SWT.NONE);
    _sourceNameLabel.setText("Source name");
    _sourceNameText = new Text(_group, SWT.BORDER);
    _descriptionLabel = new Label(_group, SWT.NONE);
    _descriptionLabel.setText("Description");
    _descriptionText = new Text(_group, SWT.BORDER);
    gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    _sourceNameText.setLayoutData(gd);
    _descriptionText.setLayoutData(gd);
    _group.setVisible(false);
    _sash.setWeights(new int[] { 3, 5 });
    /* TODO: This is temporal, since there is currently only
		 * one source defined in the AS, and it's hardcoded */
    //setEnabled(false);
    _descriptionText.addListener(SWT.Modify, new Listener() {

        public void handleEvent(Event e) {
            updateSource();
        }
    });
    _errorMessageLabel = new Label(_group, SWT.NONE);
    _errorMessageLabel.setText("");
    _errorMessageLabel.setForeground(getViewSite().getShell().getDisplay().getSystemColor(SWT.COLOR_RED));
    gd = new GridData();
    gd.grabExcessHorizontalSpace = true;
    gd.horizontalAlignment = SWT.FILL;
    gd.horizontalSpan = 2;
    _errorMessageLabel.setLayoutData(gd);
    /* Please change this in the future when more SOURCES will be available */
    _sourceNameText.setEnabled(false);
    _descriptionText.setEnabled(false);
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) Status(org.eclipse.core.runtime.Status) Group(org.eclipse.swt.widgets.Group) Listener(org.eclipse.swt.widgets.Listener) SelectionListener(org.eclipse.swt.events.SelectionListener) InputDialog(org.eclipse.jface.dialogs.InputDialog) Composite(org.eclipse.swt.widgets.Composite) Label(org.eclipse.swt.widgets.Label) ErrorDialog(org.eclipse.jface.dialogs.ErrorDialog) Text(org.eclipse.swt.widgets.Text) FillLayout(org.eclipse.swt.layout.FillLayout) IllegalOperationException(cl.utfsm.acs.acg.core.IllegalOperationException) Source(cern.laser.business.data.Source) MessageBox(org.eclipse.swt.widgets.MessageBox) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) Control(org.eclipse.swt.widgets.Control) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ArrayList(java.util.ArrayList) List(org.eclipse.swt.widgets.List) SelectionListener(org.eclipse.swt.events.SelectionListener) IInputValidator(org.eclipse.jface.dialogs.IInputValidator)

Example 5 with List

use of org.eclipse.swt.widgets.List in project cubrid-manager by CUBRID.

the class GroupSettingDialog method createGroupList.

/**
	 * Create group list.
	 * 
	 * @param parentComp parent composite.
	 */
private void createGroupList(Composite parentComp) {
    Composite groupLabel = new Composite(parentComp, SWT.NONE);
    {
        groupLabel.setLayout(new GridLayout());
        groupLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        Label label = new Label(groupLabel, SWT.LEFT);
        label.setText(Messages.labelManagerGroups);
    }
    Composite group1 = new Composite(parentComp, SWT.NONE);
    {
        group1.setLayout(new GridLayout(2, false));
        group1.setLayoutData(new GridData(GridData.FILL_BOTH));
        groupList = new List(group1, SWT.BORDER | SWT.V_SCROLL);
        {
            groupList.setLayoutData(new GridData(GridData.FILL_BOTH));
            groupList.addSelectionListener(new SelectionAdapter() {

                /**
					 * selection change event
					 * 
					 * @param event SelectionEvent
					 */
                public void widgetSelected(SelectionEvent event) {
                    setButtonStatus();
                }
            });
        }
        Composite btnCom = new Composite(group1, SWT.NONE);
        {
            btnCom.setLayout(new GridLayout());
            btnCom.setLayoutData(new GridData(GridData.FILL_VERTICAL));
        }
        btnTop = new Button(btnCom, SWT.NONE);
        btnTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        btnTop.setText(Messages.btnTop);
        btnTop.addSelectionListener(new SelectionAdapter() {

            /**
				 * push button event
				 * 
				 * @param event SelectionEvent
				 */
            public void widgetSelected(SelectionEvent event) {
                String current = groupList.getSelection()[0];
                int index = groupList.getSelectionIndex();
                groupList.remove(index);
                groupList.add(current, 0);
                groupList.setSelection(0);
                setButtonStatus();
            }
        });
        btnUp = new Button(btnCom, SWT.NONE);
        btnUp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        btnUp.setText(Messages.btnUp);
        btnUp.addSelectionListener(new SelectionAdapter() {

            /**
				 * push button event
				 * 
				 * @param event SelectionEvent
				 */
            public void widgetSelected(SelectionEvent event) {
                String current = groupList.getSelection()[0];
                int index = groupList.getSelectionIndex();
                groupList.remove(index);
                groupList.add(current, index - 1);
                groupList.setSelection(index - 1);
                setButtonStatus();
            }
        });
        btnDown = new Button(btnCom, SWT.NONE);
        btnDown.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        btnDown.setText(Messages.btnDown);
        btnDown.addSelectionListener(new SelectionAdapter() {

            /**
				 * push button event
				 * 
				 * @param event SelectionEvent
				 */
            public void widgetSelected(SelectionEvent event) {
                String current = groupList.getSelection()[0];
                int index = groupList.getSelectionIndex();
                groupList.remove(index);
                groupList.add(current, index + 1);
                groupList.setSelection(index + 1);
                setButtonStatus();
            }
        });
        btnBottom = new Button(btnCom, SWT.NONE);
        btnBottom.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        btnBottom.setText(Messages.btnBottom);
        btnBottom.addSelectionListener(new SelectionAdapter() {

            /**
				 * push button event
				 * 
				 * @param event SelectionEvent
				 */
            public void widgetSelected(SelectionEvent event) {
                String current = groupList.getSelection()[0];
                int index = groupList.getSelectionIndex();
                groupList.remove(index);
                groupList.add(current);
                groupList.setSelection(groupList.getItemCount() - 1);
                setButtonStatus();
            }
        });
    }
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) SelectionEvent(org.eclipse.swt.events.SelectionEvent) ArrayList(java.util.ArrayList) List(org.eclipse.swt.widgets.List)

Aggregations

List (org.eclipse.swt.widgets.List)103 Button (org.eclipse.swt.widgets.Button)58 SelectionEvent (org.eclipse.swt.events.SelectionEvent)57 Composite (org.eclipse.swt.widgets.Composite)57 Label (org.eclipse.swt.widgets.Label)56 GridData (org.eclipse.swt.layout.GridData)50 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)48 GridLayout (org.eclipse.swt.layout.GridLayout)43 Text (org.eclipse.swt.widgets.Text)37 ArrayList (java.util.ArrayList)34 Shell (org.eclipse.swt.widgets.Shell)27 FormAttachment (org.eclipse.swt.layout.FormAttachment)25 FormData (org.eclipse.swt.layout.FormData)25 FormLayout (org.eclipse.swt.layout.FormLayout)25 Group (org.eclipse.swt.widgets.Group)25 Point (org.eclipse.swt.graphics.Point)21 SelectionListener (org.eclipse.swt.events.SelectionListener)19 Display (org.eclipse.swt.widgets.Display)18 Listener (org.eclipse.swt.widgets.Listener)18 ModifyListener (org.eclipse.swt.events.ModifyListener)17