本文整理汇总了Java中org.eclipse.nebula.widgets.gallery.GalleryItem.setExpanded方法的典型用法代码示例。如果您正苦于以下问题:Java GalleryItem.setExpanded方法的具体用法?Java GalleryItem.setExpanded怎么用?Java GalleryItem.setExpanded使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.nebula.widgets.gallery.GalleryItem
的用法示例。
在下文中一共展示了GalleryItem.setExpanded方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGalleryItems
import org.eclipse.nebula.widgets.gallery.GalleryItem; //导入方法依赖的package包/类
private void createGalleryItems(){
//add text
if(group.getItemCount() > 0){
return;
}
for (int i=0; i<urls.size(); ++i) {
final GalleryItem item = new GalleryItem(group, SWT.MULTI);
// item.setText(0, "String 0\nString2");
// item.setText(1, "String 1");
item.setExpanded(true);
item.setImage(Images.LOADING_IMG);
item.setData("doNotScaleImage", new Object());
String transcribedLinesText = determineItemColor(item, transcripts.get(i));
setItemText(item, i, transcribedLinesText);
}
}
示例2: createGalleryItems
import org.eclipse.nebula.widgets.gallery.GalleryItem; //导入方法依赖的package包/类
public void createGalleryItems(){
//add text
if(group.getItemCount() > 0){
return;
}
for (int i=0; i<urls.size(); ++i) {
final GalleryItem item = new GalleryItem(group, SWT.MULTI);
// item.setText(0, "String 0\nString2");
// item.setText(1, "String 1");
item.setExpanded(true);
item.setImage(Images.LOADING_IMG);
item.setData("doNotScaleImage", new Object());
String transcribedLinesText = thumbsWidget.determineItemColor(item, transcripts.get(i));
totalLinesTranscribed += transcripts.get(i).getNrOfTranscribedLines();
setItemText(item, i, transcribedLinesText);
}
}
示例3: handleEvent
import org.eclipse.nebula.widgets.gallery.GalleryItem; //导入方法依赖的package包/类
@Override
public void handleEvent(Event event) {
if(doc == null) {
return;
}
// logger.debug("setting data: " + event);
// logger.debug("item: " + event.item);
final GalleryItem item = (GalleryItem) event.item;
int index;
if (item.getParentItem() != null) { // if this is a leaft item
// -> set nr of items to 0!
index = item.getParentItem().indexOf(item);
item.setItemCount(0);
} else {
index = gallery.indexOf(item);
item.setItemCount(doc.getThumbUrls().size());
}
//logger.debug("setData index " + index); //$NON-NLS-1$
item.setExpanded(true);
try {
Image thumbImg = ImgLoader.load(doc.getPages().get(index).getThumbUrl());
if(DO_SCALE_THUMBS) {
thumbImg = Images.resize(thumbImg, itemWidth, itemHeight);
}
item.setImage(thumbImg);
} catch (IOException e) {
// Most likely happens because thumbnail image is not yet available!
// e.printStackTrace();
if (false) { // loading thumbs on the fly all the time is f****** slow
try {
// ---->Try to generate thumbnail on the fly from actual page image.
FimgStoreGetClient imgStoreClient;
imgStoreClient = new FimgStoreGetClient(doc.getPages().get(index).getUrl());
URL url = imgStoreClient.getImgXyScaled(doc.getPages().get(index).getKey(), 82, 120, false).getUri().toURL();
item.setImage(ImageDescriptor.createFromURL(url).createImage());
} catch (IOException e1) {
// If everything fails display an error thumbnail
item.setImage(Images.ERROR_IMG);
e1.printStackTrace();
}
} else {
item.setImage(Images.ERROR_IMG);
// e.printStackTrace();
}
}
//FIXME WTF does this do?
item.setData("doNotScaleImage", new Object());
setItemTextAndBackground(item, index);
}