本文整理匯總了Java中org.eclipse.ui.ISharedImages.IMG_OBJ_FOLDER屬性的典型用法代碼示例。如果您正苦於以下問題:Java ISharedImages.IMG_OBJ_FOLDER屬性的具體用法?Java ISharedImages.IMG_OBJ_FOLDER怎麽用?Java ISharedImages.IMG_OBJ_FOLDER使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.ui.ISharedImages
的用法示例。
在下文中一共展示了ISharedImages.IMG_OBJ_FOLDER屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImage
public Image getImage(Object element) {
final String s;
switch (((PreviewFile)element).type) {
case IResource.PROJECT:
s= SharedImages.IMG_OBJ_PROJECT; break;
case IResource.FOLDER:
s= ISharedImages.IMG_OBJ_FOLDER; break;
default:
s= ISharedImages.IMG_OBJ_FILE; break;
}
final Image baseImage= PlatformUI.getWorkbench().getSharedImages().getImage(s);
final ImageDescriptor overlay = getOverlay(element);
if (overlay == null)
return baseImage;
try {
return fImageCache.createImage(new OverlayIcon(baseImage, new ImageDescriptor[] {overlay}, new int[] {OverlayIcon.BOTTOM_RIGHT}, new Point(baseImage.getBounds().width, baseImage.getBounds().height)));
} catch (Exception e) {
SVNUIPlugin.log(e.getMessage());
}
return null;
}
示例2: getImage
public Image getImage(Object obj) {
String imageKey = null;
if (obj instanceof GroupItem) {
imageKey = ISharedImages.IMG_OBJ_FOLDER;
} else {
String imgName = obj.getClass().getSimpleName().replace("Item", "").toLowerCase();
Image image = imageCache.get(imgName);
if(image==null) {
ImageDescriptor imageDesc = UIActivator.getImageDescriptor("icons/" + imgName + ".png");
if(imageDesc!=null) {
image = imageDesc.createImage();
imageCache.put(imgName, image);
return image;
}
} else {
return image;
}
// use the shared image as a default
imageKey = ISharedImages.IMG_OBJ_ELEMENT;
}
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
}
示例3: getImage
@Override
public Image getImage(Object obj) {
if (obj instanceof TreePlugin) {
return pluginImage;
}
if (obj instanceof TreePackage) {
return packageImage;
}
if (obj instanceof TreeFeature) {
return featureImage;
}
if (obj instanceof TreeProblem) {
TreeProblem tp = (TreeProblem) obj;
Problem p = tp.getProblem();
return p.isError()? errorImage : warningImage;
}
String imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
}
示例4: getImage
public Image getImage(Object obj) {
String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
if (obj instanceof TreeParent)
imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
}
示例5: getImage
@Override
public Image getImage(Object element) {
String imageKey = null;
if(element instanceof Chunk) {
imageKey = ISharedImages.IMG_OBJ_FOLDER;
}
else if(element instanceof Row) {
imageKey = ISharedImages.IMG_OBJ_FILE;
}
if(imageKey != null) {
return Helper.getSharedImage(imageKey);
}
return null;
}
示例6: getImage
public Image getImage(Object obj) {
String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
if (obj instanceof String || obj instanceof SearchList || obj instanceof ReportInfo) // TODO: provide better images
imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
}
示例7: getImageDescriptor
@Override
public ImageDescriptor getImageDescriptor(Context context, Bookmark bookmark) {
String imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(imageKey);
}