posts - 6, comments - 1, trackbacks - 0, articles - 0

2008年9月19日

public class NameManager implements INameManager {
       private Set namePool = new HashSet();
      

    public String generateName(String nameType) {

        if (!namePool.contains(nameType)) {
       namePool.add(nameType);
        return nameType;
  }

  int i = 1;
  while (namePool.contains(nameType + i)) {
   i++;
  }
  namePool.add(nameType + i);
  return nameType + i;
 }


posted @ 2008-09-23 11:44 jr4e 阅读(127) | 评论 (0)编辑 收藏

 ImageDescriptor temp = ImageDescriptor.createFromURL(url);

 org.eclipse.swt.graphics.Image image = temp.createImage();

posted @ 2008-09-19 12:38 jr4e 阅读(141) | 评论 (0)编辑 收藏