/*
* Created on 2004/07/15
* Author aki@www.xucker.jpn.org
* License Apache2.0 or Common Public License
*/
package org.jpn.xucker.findsame;
import java.util.Vector;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
/**
*
*
*/
public class Result implements CompositeListItem{
private Vector list=new Vector();
private String md5;
private int width;
private int height;
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public Result(String md5){
this.md5=md5;
}
public void add(String path){
list.add(path);
}
public int size(){
return list.size();
}
public String getMd5() {
return md5;
}
public void setMd5(String md5) {
this.md5 = md5;
}
public String[] getPaths(){
return (String[])list.toArray(new String[list.size()]);
}
/**
* @return
*/
/* (non-Javadoc)
* @see org.jpn.xucker.filesame.CompositeListItem#createItem(org.eclipse.swt.widgets.Composite)
*/
public Composite createItem(Composite composite) {
Group gp=new Group(composite,SWT.NULL);
gp.setLayout(new GridLayout());
gp.setText(getMd5());
String[] paths=getPaths();
for (int i = 0; i < paths.length; i++) {
Label label=new Label(gp,SWT.NULL);
label.setText(paths[i]);
}
gp.pack();
//System.out.println(gp.getSize().x+","+gp.getSize().y);
return gp;
}
}
|