handle.moveItem( index, index + 2 );
handle.moveItem( index, index + 1 );
    public PropertyHandleTableViewer(Composite parent, boolean showMenus, boolean showButtons, boolean enableKeyStrokes)    {        mainControl = new Composite(parent, SWT.NONE);        GridLayout layout = new GridLayout();        layout.numColumns = 2;        mainControl.setLayout(layout);        GridData data = null;        viewer = new TableViewer(mainControl, SWT.FULL_SELECTION);        data = new GridData(GridData.FILL_BOTH);        viewer.getControl().setLayoutData(data);                viewer.getTable( ).setHeaderVisible( true );        viewer.getTable( ).setLinesVisible( true );        if(showButtons)        {            Composite btnComposite = new Composite(mainControl, SWT.NONE);            data = new GridData();            data.verticalAlignment = SWT.CENTER;            btnComposite.setLayoutData(data);            GridLayout btnLayout = new GridLayout();            layout.verticalSpacing = 20;            btnComposite.setLayout(btnLayout);                        GridData btnData = new GridData(GridData.CENTER);            btnData.widthHint = 20;            btnData.heightHint = 20;            btnUp = new Button(btnComposite, SWT.ARROW | SWT.UP);            btnUp.setLayoutData(btnData);            btnUp.addSelectionListener(new SelectionListener(){                public void widgetSelected(SelectionEvent e)                {                    //Get the current selection and delete that row                    int index = viewer.getTable( ).getSelectionIndex( );                    PropertyHandle handle = (PropertyHandle) viewer.getInput();                    if ( index > 0                            && handle.getListValue( ) != null                            && index < handle.getListValue( ).size( ))                    {                        viewer.cancelEditing();                        try                        {                            handle.moveItem( index, index -1 );                        }                        catch ( PropertyValueException e1 )                        {                            ExceptionHandler.handle( e1 );                        }                        viewer.refresh( );                        viewer.getTable( ).select( index - 1);                    }                }                public void widgetDefaultSelected(SelectionEvent e)                {                }                            });                        btnData = new GridData(GridData.CENTER);            btnData.widthHint = 20;            btnData.heightHint = 20;            btnRemove = new Button(btnComposite, SWT.PUSH);            btnRemove.setImage(PlatformUI.getWorkbench( ).getSharedImages( ).getImage( ISharedImages.IMG_TOOL_DELETE ));            btnRemove.setLayoutData(btnData);            btnRemove.addSelectionListener(new SelectionListener(){                public void widgetSelected(SelectionEvent e)                {                    removeSelectedItem();                }                public void widgetDefaultSelected(SelectionEvent e)                {                }                            });                        btnData = new GridData(GridData.CENTER);            btnData.widthHint = 20;            btnData.heightHint = 20;            btnDown = new Button(btnComposite, SWT.ARROW | SWT.DOWN);            btnDown.setLayoutData(btnData);            btnDown.addSelectionListener(new SelectionListener(){                public void widgetSelected(SelectionEvent e)                {                    //Get the current selection and delete that row                    int index = viewer.getTable( ).getSelectionIndex( );                    PropertyHandle handle = (PropertyHandle) viewer.getInput();                    if ( index > -1                            && handle.getListValue( ) != null                            && index < handle.getListValue( ).size( ) - 1)                    {                        viewer.cancelEditing();                        try                        {                            handle.moveItem( index, index + 2 );                        }                        catch ( PropertyValueException e1 )                        {                            ExceptionHandler.handle( e1 );                        }                        viewer.refresh( );                        viewer.getTable( ).select( index + 1);                    }                }                public void widgetDefaultSelected(SelectionEvent e)                {                }                            });        }                if(showMenus)        {            menu = new Menu(viewer.getTable());            menu.addMenuListener(new MenuAdapter(){                public void menuShown(MenuEvent e)                {                    viewer.cancelEditing();                }            });            itmRemove = new MenuItem(menu, SWT.NONE);            itmRemove .setText(Messages.getString("PropertyHandleTableViewer.Menu.Remove")); //$NON-NLS-1$            itmRemove .addSelectionListener(new SelectionAdapter(){                public void widgetSelected(SelectionEvent e)                {                    removeSelectedItem();                }            });            itmRemoveAll = new MenuItem(menu, SWT.NONE);            itmRemoveAll.setText(Messages.getString("PropertyHandleTableViewer.Menu.RemoveAll")); //$NON-NLS-1$            itmRemoveAll.addSelectionListener(new SelectionAdapter(){                public void widgetSelected(SelectionEvent e)                {                    try                    {                        PropertyHandle handle = (PropertyHandle) viewer.getInput();                        handle.clearValue();                        viewer.refresh();                    }                    catch (SemanticException e1)                    {                        // TODO Auto-generated catch block                        e1.printStackTrace();                    }                }            });            viewer.getTable().setMenu(menu);        }                if(enableKeyStrokes)        {            viewer.getTable().addKeyListener(new KeyListener(){                public void keyPressed(KeyEvent e)                {                }                public void keyReleased(KeyEvent e)                {                    if ( e.keyCode == SWT.DEL )                    {                        removeSelectedItem();                    }                }                            });        }    }