2
* Copyright (C) 2004, 2005, 2006 Aelitis SAS, All rights Reserved
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details ( see the LICENSE file ).
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
* AELITIS, SAS au capital de 46,603.30 euros,
18
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
21
package org.gudy.azureus2.ui.swt.views.tableitems.files;
23
import org.gudy.azureus2.core3.disk.DiskManagerFileInfo;
24
import org.gudy.azureus2.plugins.ui.tables.*;
25
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
32
public class PieceCountItem
33
extends CoreTableColumn
34
implements TableCellRefreshListener
36
/** Default Constructor */
37
public PieceCountItem() {
38
super("numberofpieces", ALIGN_TRAIL, POSITION_LAST, 75, TableManager.TABLE_TORRENT_FILES);
41
public void refresh(TableCell cell) {
42
DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
43
long value = (fileInfo == null) ? 0 : fileInfo.getNbPieces();
45
if( !cell.setSortValue( value ) && cell.isValid() ) {
49
// < 0 -> unknown skeleton value
51
cell.setText( value<0?"":(""+value));
2
* Copyright (C) 2004, 2005, 2006 Aelitis SAS, All rights Reserved
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details ( see the LICENSE file ).
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
* AELITIS, SAS au capital de 46,603.30 euros,
18
* 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
21
package org.gudy.azureus2.ui.swt.views.tableitems.files;
23
import org.gudy.azureus2.core3.disk.DiskManagerFileInfo;
24
import org.gudy.azureus2.plugins.ui.tables.*;
25
import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn;
32
public class PieceCountItem
33
extends CoreTableColumn
34
implements TableCellRefreshListener
36
/** Default Constructor */
37
public PieceCountItem() {
38
super("numberofpieces", ALIGN_TRAIL, POSITION_LAST, 75, TableManager.TABLE_TORRENT_FILES);
39
setMinWidthAuto(true);
42
public void refresh(TableCell cell) {
43
DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
44
long value = (fileInfo == null) ? 0 : fileInfo.getNbPieces();
46
if( !cell.setSortValue( value ) && cell.isValid() ) {
50
// < 0 -> unknown skeleton value
52
cell.setText( value<0?"":(""+value));