ArrayList retValue = new ArrayList(list); boolean hasRowOrColumn = false; int size = list.size( ); for ( int i = 0; i < size; i++ ) { Object obj = list.get(i); if (obj instanceof TableEditPart.DummyColumnEditPart || obj instanceof TableEditPart.DummyRowEditPart) { hasRowOrColumn = true; break; } } if (hasRowOrColumn) { for ( int i = 0; i < size; i++ ) { Object obj = list.get(i); if (obj instanceof TableCellEditPart) { retValue.remove(obj); } } }
List retValue = filletCellModel(list);
	public static ISelection filletCellInSelectionEditorpart(ISelection selection)	{		if ( selection == null || !( selection instanceof IStructuredSelection ) )			return new StructuredSelection( Collections.EMPTY_LIST );		List list = ( (IStructuredSelection) selection ).toList( );		ArrayList retValue = new ArrayList(list); 		boolean hasRowOrColumn = false;		int size = list.size( );		for ( int i = 0; i < size; i++ )		{			Object obj = list.get(i);			if (obj instanceof TableEditPart.DummyColumnEditPart					|| obj instanceof TableEditPart.DummyRowEditPart)			{				hasRowOrColumn = true;				break;			}		}		if (hasRowOrColumn)		{			for ( int i = 0; i < size; i++ )			{				Object obj = list.get(i);				if (obj instanceof TableCellEditPart)				{					retValue.remove(obj);				}			}		}		return new StructuredSelection(retValue);	}