Example usage for org.eclipse.jface.viewers ListViewer getElementAt

List of usage examples for org.eclipse.jface.viewers ListViewer getElementAt

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ListViewer getElementAt.

Prototype

public Object getElementAt(int index) 

Source Link

Document

Returns the element with the given index from this list viewer.

Usage

From source file:de.thischwa.pmcms.gui.composite.UnusedImageComp.java

License:LGPL

private void move(ListViewer srcList, ListViewer destList, int[] indices) {
    List<Object> objsToMove = new ArrayList<Object>(indices.length);
    for (int index : indices) {
        objsToMove.add(srcList.getElementAt(index));
    }/* w  ww.  ja v  a  2  s .co  m*/
    for (Object obj : objsToMove) {
        destList.add(obj);
        srcList.remove(obj);
    }
}

From source file:org.eclipse.osee.framework.ui.skynet.util.email.EmailWizardPage.java

License:Open Source License

public String[] getEmails(ListViewer list) throws OseeCoreException {

    ArrayList<String> emails = new ArrayList<String>();
    for (int x = 0; x < list.getList().getItemCount(); x++) {
        Object obj = list.getElementAt(x);
        if (obj instanceof User) {
            emails.add(((User) obj).getEmail());
        } else if (obj instanceof String) {
            emails.add(((String) obj));
        } else if (obj instanceof EmailGroup) {
            emails.addAll(((EmailGroup) obj).getEmails());
        }//from   ww  w.ja v  a 2 s. com
    }
    return emails.toArray(new String[emails.size()]);
}