protected int findBucketsIndex(S3Bucket bucket) { return Collections.binarySearch( bucketList, new S3BucketAndDistributionFlag(bucket, false), new Comparator() { public int compare(Object o1, Object o2) { String b1Name = ((S3BucketAndDistributionFlag)o1).getS3Bucket().getName(); String b2Name = ((S3BucketAndDistributionFlag)o2).getS3Bucket().getName(); int result = b1Name.compareTo(b2Name); return result; } } ); }
public S3Bucket getBucket(int row) { return ((S3BucketAndDistributionFlag)bucketList.get(row)).getS3Bucket(); }
public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 1 && distributionActiveIcon != null) { if (((S3BucketAndDistributionFlag)bucketList.get(rowIndex)).hasDistribution()) { return distributionActiveIcon; } } return super.getValueAt(rowIndex, columnIndex); }
public int addBucket(S3Bucket bucket, boolean hasDistributions) { int insertRow = findBucketsIndex(bucket); if (insertRow >= 0) { // We already have an item with this key, replace it. bucketList.remove(insertRow); this.removeRow(insertRow); } else { insertRow = (-insertRow) - 1; } // New object to insert. bucketList.add(insertRow, new S3BucketAndDistributionFlag(bucket, hasDistributions)); if (this.includeDistributions) { Boolean flag = hasDistributions ? Boolean.TRUE : Boolean.FALSE; this.insertRow(insertRow, new Object[] {bucket.getName(), flag}); } else { this.insertRow(insertRow, new Object[] {bucket.getName()}); } return insertRow; }
public int addBucket(S3Bucket bucket, boolean hasDistributions) { int insertRow = findBucketsIndex(bucket); if (insertRow >= 0) { // We already have an item with this key, replace it. bucketList.remove(insertRow); this.removeRow(insertRow); } else { insertRow = (-insertRow) - 1; } // New object to insert. bucketList.add(insertRow, new S3BucketAndDistributionFlag(bucket, hasDistributions)); if (this.includeDistributions) { Boolean flag = hasDistributions ? Boolean.TRUE : Boolean.FALSE; this.insertRow(insertRow, new Object[] {bucket.getName(), flag}); } else { this.insertRow(insertRow, new Object[] {bucket.getName()}); } return insertRow; }
public S3Bucket getBucket(int row) { return ((S3BucketAndDistributionFlag)bucketList.get(row)).getS3Bucket(); }
protected int findBucketsIndex(S3Bucket bucket) { return Collections.binarySearch( bucketList, new S3BucketAndDistributionFlag(bucket, false), new Comparator() { public int compare(Object o1, Object o2) { String b1Name = ((S3BucketAndDistributionFlag)o1).getS3Bucket().getName(); String b2Name = ((S3BucketAndDistributionFlag)o2).getS3Bucket().getName(); int result = b1Name.compareTo(b2Name); return result; } } ); }
public Object getValueAt(int rowIndex, int columnIndex) { if (columnIndex == 1 && distributionActiveIcon != null) { if (((S3BucketAndDistributionFlag)bucketList.get(rowIndex)).hasDistribution()) { return distributionActiveIcon; } } return super.getValueAt(rowIndex, columnIndex); }
public int compare(Object o1, Object o2) { String b1Name = ((S3BucketAndDistributionFlag)o1).getS3Bucket().getName(); String b2Name = ((S3BucketAndDistributionFlag)o2).getS3Bucket().getName(); int result = b1Name.compareTo(b2Name); return result; } }
public int compare(Object o1, Object o2) { String b1Name = ((S3BucketAndDistributionFlag)o1).getS3Bucket().getName(); String b2Name = ((S3BucketAndDistributionFlag)o2).getS3Bucket().getName(); int result = b1Name.compareTo(b2Name); return result; } }