- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.eclipse.ui.internal.WorkbenchImages
类的一些代码示例,展示了WorkbenchImages
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WorkbenchImages
类的具体详情如下:
包路径:org.eclipse.ui.internal.WorkbenchImages
类名称:WorkbenchImages
[英]This class provides convenience access to many of the resources required by the workbench. The class stores some images as descriptors, and some are stored as real Images in the registry. This is a pure speed-space tradeoff. The trick for users of this class is that images obtained from the registry (using getImage()), don't require disposal since they are shared, while images obtained using getImageDescriptor() will require disposal. Consult the declareImages method to see if a given image is declared as a registry image or just as a descriptor. If you change an image from being stored as a descriptor to a registry image, or vice-versa, make sure to check all users of the image to ensure they are calling the correct getImage... method and handling disposal correctly. Images: - use getImage(key) to access cached images from the registry. - Less common images are found by calling getImageDescriptor(key) where key can be found in IWorkbenchGraphicConstants This class initializes the image registry by declaring all of the required graphics. This involves creating image descriptors describing how to create/find the image should it be needed. The image is not actually allocated until requested. Some Images are also made available to other plugins by being placed in the descriptor table of the SharedImages class. Where are the images? The images (typically png file) are found the plugins install directory How to add a new image Place the png file into the appropriate directories. Add a constant to IWorkbenchGraphicConstants following the conventions Add the declaration to this file
[中]此类提供了对工作台所需的许多资源的方便访问。该类将一些图像存储为描述符,而一些图像则作为真实图像存储在注册表中。这是一种纯粹的速度空间权衡。此类用户的诀窍是,从注册表(使用getImage())获取的图像不需要处理,因为它们是共享的,而使用getImageDescriptor()获取的图像则需要处理。请参阅declareImages方法,查看给定图像是声明为注册表图像还是仅声明为描述符。如果将图像从作为描述符存储更改为注册表图像,或者反之亦然,请确保检查图像的所有用户,以确保他们调用的getImage是正确的。。。方法和正确处理。图像:-使用getImage(键)从注册表访问缓存的图像。-通过调用getImageDescriptor(key)可以找到不太常见的图像,其中key可以在iWorkbenchGraphic常量中找到。此类通过声明所有必需的图形来初始化图像注册表。这涉及到创建图像描述符,描述如何创建/查找需要的图像。在请求之前,不会实际分配映像。通过将一些图像放在SharedImages类的描述符表中,其他插件也可以使用这些图像。图像在哪里?图像(通常是png文件)可以在插件安装目录中找到。如何添加新图像将png文件放入适当的目录中。向iWorkbenchGraphic常量中添加一个常量按照约定将声明添加到此文件
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public ImageDescriptor getImageDescriptor() {
return WorkbenchImages
.getImageDescriptor(ISharedImages.IMG_ETOOL_DEF_PERSPECTIVE);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Retrieves the specified image from the workbench plugin's image registry.
*
* @see ISharedImages
*/
@Override
public Image getImage(String symbolicName) {
Image image = WorkbenchImages.getImage(symbolicName);
if (image != null) {
return image;
}
//if there is a descriptor for it, add the image to the registry.
ImageDescriptor desc = WorkbenchImages.getImageDescriptor(symbolicName);
if (desc != null) {
WorkbenchImages.getImageRegistry().put(symbolicName, desc);
return WorkbenchImages.getImageRegistry().get(symbolicName);
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void declareImage(String symbolicName, ImageDescriptor descriptor,
boolean shared) {
if (symbolicName == null || descriptor == null) {
throw new IllegalArgumentException();
}
WorkbenchImages.declareImage(symbolicName, descriptor, shared);
}
代码示例来源:origin: org.eclipse.mylyn.commons.repositories/ui
@Override
public Image getImage(Object object) {
if (object instanceof RepositoryCategory) {
return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Convenience Method.
* Returns an ImageDescriptor obtained from an external program.
* If there isn't any image then <code>null</code> is returned.
*
* This method is convenience and only intended for use by the workbench because it
* explicitly uses the workbench's registry for caching/retrieving images from other
* extensions -- other plugins must user their own registry.
* This convenience method is subject to removal.
*
* Note:
* This consults the plugin for extension and obtains its installation location.
* all requested images are assumed to be in a directory below and relative to that
* plugins installation directory.
*
* @param filename the file name
* @param offset the offset
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptorFromProgram(
String filename, int offset) {
Assert.isNotNull(filename);
String key = filename + "*" + offset; //use * as it is not a valid filename character//$NON-NLS-1$
ImageDescriptor desc = getImageDescriptor(key);
if (desc == null) {
desc = new ProgramImageDescriptor(filename, offset);
getDescriptors().put(key, desc);
}
return desc;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
tempDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(configurationElement.getNamespaceIdentifier(), imageFileName);
else if (command != null)
tempDescriptor = WorkbenchImages.getImageDescriptorFromProgram(command, 0);
} else
tempDescriptor = imageDesc;
imageDesc = WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
testImage = false;
return imageDesc;
tempDescriptor = WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
else
img.dispose();
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
declareImage(ISharedImages.IMG_DEC_FIELD_ERROR, PATH_OVERLAY + "error_ovr.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_DEC_FIELD_WARNING, PATH_OVERLAY + "warning_ovr.png", true); //$NON-NLS-1$
declareImage(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR, PATH_ETOOL + "pin_editor.png", false); //$NON-NLS-1$
declareImage(IWorkbenchGraphicConstants.IMG_ETOOL_PIN_EDITOR_DISABLED, PATH_DTOOL + "pin_editor.png", false); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVE_EDIT, PATH_ETOOL + "save_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVE_EDIT_DISABLED, PATH_DTOOL + "save_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVEAS_EDIT, PATH_ETOOL + "saveas_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVEAS_EDIT_DISABLED, PATH_DTOOL + "saveas_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVEALL_EDIT, PATH_ETOOL + "saveall_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_ETOOL_SAVEALL_EDIT_DISABLED, PATH_DTOOL + "saveall_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_UNDO, PATH_ETOOL + "undo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_UNDO_DISABLED, PATH_DTOOL + "undo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_REDO, PATH_ETOOL + "redo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_REDO_DISABLED, PATH_DTOOL + "redo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_CUT, PATH_ETOOL + "cut_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_CUT_DISABLED, PATH_DTOOL + "cut_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_COPY, PATH_ETOOL + "copy_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_COPY_DISABLED, PATH_DTOOL + "copy_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_PASTE, PATH_ETOOL + "paste_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_PASTE_DISABLED, PATH_DTOOL + "paste_edit.png", true); //$NON-NLS-1$
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Initialize the image registry by declaring all of the required graphics.
* This involves creating JFace image descriptors describing how to
* create/find the image should it be needed. The image is not actually
* allocated until requested.
*
* Prefix conventions Wizard Banners WIZBAN_ Preference Banners PREF_BAN_
* Property Page Banners PROPBAN_ Enable toolbar ETOOL_ Disable toolbar
* DTOOL_ Local enabled toolbar ELCL_ Local Disable toolbar DLCL_ Object
* large OBJL_ Object small OBJS_ View VIEW_ Product images PROD_ Misc
* images MISC_
*
* Where are the images? The images (typically png files) are found in the
* same location as this plugin class. This may mean the same package
* directory as the package holding this class. The images are declared
* using this.getClass() to ensure they are looked up via this plugin class.
*
* @see ImageRegistry
*/
private static void initializeImageRegistry() {
imageRegistry = new ImageRegistry();
descriptors = new HashMap<>();
declareImages();
}
代码示例来源:origin: org.eclipse.mylyn.commons/workbench
public Image getFolderImage() {
return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public ImageDescriptor getImageDescriptor() {
return WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_VIEW_DEFAULTVIEW_MISC);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private Image getImage(Object element) {
if (element instanceof ItemsListSeparator) {
return WorkbenchImages
.getImage(IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR);
}
return provider.getImage(element);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Declares all the workbench's deprecated hover images, including both "shared" ones and
* internal ones.
*
* @deprecated As of 3.0, since the workbench itself no longer uses the hover image variants
*/
@Deprecated
private static final void declareHoverImages() {
declareImage(ISharedImages.IMG_TOOL_UNDO_HOVER, PATH_ETOOL
+ "undo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_REDO_HOVER, PATH_ETOOL
+ "redo_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_CUT_HOVER, PATH_ETOOL
+ "cut_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_COPY_HOVER, PATH_ETOOL
+ "copy_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_PASTE_HOVER, PATH_ETOOL
+ "paste_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_FORWARD_HOVER, PATH_ELOCALTOOL
+ "forward_nav.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_DELETE_HOVER, PATH_ETOOL
+ "delete_edit.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_NEW_WIZARD_HOVER, PATH_ETOOL
+ "new_wiz.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_BACK_HOVER, PATH_ELOCALTOOL
+ "backward_nav.png", true); //$NON-NLS-1$
declareImage(ISharedImages.IMG_TOOL_UP_HOVER, PATH_ELOCALTOOL
+ "up_nav.png", true); //$NON-NLS-1$
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public ImageDescriptor getImageDescriptor() {
return WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_LCL_VIEW_MENU);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex == 0) {
if (element instanceof AboutBundleData) {
final AboutBundleData data = (AboutBundleData) element;
if (data.isSignedDetermined()) {
return WorkbenchImages
.getImage(data.isSigned() ? IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_YES
: IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_NO);
}
synchronized (resolveQueue) {
resolveQueue.add(data);
}
resolveJob.schedule();
return WorkbenchImages
.getImage(IWorkbenchGraphicConstants.IMG_OBJ_SIGNED_UNKNOWN);
}
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Declares a workbench image given the path of the image file (relative to
* the workbench plug-in). This is a helper method that creates the image
* descriptor and passes it to the main <code>declareImage</code> method.
*
* @param key the symbolic name of the image
* @param path the path of the image file relative to the base of the workbench
* plug-ins install directory
* @param shared <code>true</code> if this is a shared image, and
* <code>false</code> if this is not a shared image
*/
private static final void declareImage(String key, String path,
boolean shared) {
URL url = BundleUtility.find(PlatformUI.PLUGIN_ID, path);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
declareImage(key, desc, shared);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Retrieves the specified image descriptor from the workbench plugin's image registry.
*
* @see ISharedImages
*/
@Override
public ImageDescriptor getImageDescriptor(String symbolicName) {
return WorkbenchImages.getImageDescriptor(symbolicName);
}
}
代码示例来源:origin: org.eclipse.mylyn.builds/ui
@Override
public Image getImage(Object element) {
if (element instanceof ArtifactFolder) {
return WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
} else if (element instanceof IArtifact) {
return imageManager.getFileImage(((IArtifact) element).getName());
}
return null;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public ImageDescriptor getImageDescriptor() {
return WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_OBJ_NODE);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
Image getImage(QuickAccessElement element, ResourceManager resourceManager) {
Image image = findOrCreateImage(element.getImageDescriptor(),
resourceManager);
if (image == null) {
image = WorkbenchImages
.getImage(IWorkbenchGraphicConstants.IMG_OBJ_ELEMENT);
}
return image;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public ImageDescriptor getImageDescriptor() {
return WorkbenchImages
.getImageDescriptor(IWorkbenchGraphicConstants.IMG_OBJ_NODE);
}
这个问题在这里已经有了答案: How to make a property protected AND internal in C#? (8 个答案) 关闭 9 年前。 我需要声明一个既受又 内部保
我对在 Kotlin 1.3 中使用 Strings.isNullOrEmpty 导入 jdk.internal.joptsimple.internal.Strings.isNullOrEmpty 的
我有一个项目,实习生单元测试应该位于与被测源代码不同的目录树中。有点像这样: projectRoot projectRoot/src projectRoot/tests projectRoot/tes
如何在功能测试中访问浏览器的主要 JavaScript 范围?例如,我想获取对 Dojo 小部件的引用并检查它的属性。例如,在浏览器 JavaScript 控制台中,我可以运行: dijit.
public class TestClass { protected internal int FieldA; internal protected int FieldB; }
我想创建一个内部自动属性: internal bool IP { get; protected internal set; } 我认为可以使 setter protected 或 protected
java.lang.NoSuchMethodError: okhttp3.internal.Internal.initializeInstanceForTests() When creating a
我正在尝试使用 intern 来测试在 node.js 下运行的 dojo 应用程序 我的 intern.js 配置文件是这样的: define({ loader: {
我在 Raspbian wheezy 上的 nginx 1.2.1-2.2 有点问题。我认为它是在我更改站点可用/默认文件中的索引后开始的。以下是相关文件: nginx.conf user www-d
我在尝试加载 Visual studio 2012 时遇到了此错误,遇到了异常。这可能是由扩展引起的,并且在 C:\Users\~\AppData 中给出了附加信息的位置\Roaming\Micros
我正在将一个项目迁移到 Java9,在我切换到新的 Java 版本后,测试开始失败,看起来 PowerMock 正在尝试访问一些它无法访问的类。 Tests run: 1, Failures: 0,
该触发器用于检测进度中的顺序是否已更新,并有助于更新进度的概览状态和完成时间。 但是当发生内部错误时,它并不总是有效,如下所示: Error: 13 INTERNAL: An internal err
当我尝试将包含一些 JavaScript 的项目导入工作区时(使用 Eclipse 的 Neon.M6 版本),出现此错误: eclipse.buildId=4.6.0.I20160317-0200
我在尝试访问 FullContact API 服务器时收到此错误。我正在使用 okhttp 2.7.5 和 okhttp-urlconnection 2.7.5 以及改造 1.9.0。 Caused
当我试图读取一个以前版本的 pandas 保存的 pickle 文件时,它产生了一个 ImportError。 ImportError: No module named 'pandas.core.in
我正在将一个项目迁移到 Java9,在我切换到新的 Java 版本后测试开始失败,似乎 PowerMock 正在尝试访问它无法访问的一些类。 Tests run: 1, Failures: 0, Er
我正在尝试设置 Lumen - 建立在 Laravel 组件之上的“微框架”。服务器端有 nginx + php-fpm。 这是我的 nginx 配置: server { server_nam
在我们的项目中,我们决定在我们的项目中使用最新的 fmt 版本 (6.2.0) 并主要使用 printf 功能,因为我们在广泛使用 printf 的地方进行日志记录。 我使用 fmt 包中包含的 CM
我正在使用 Mockito jar 为 Groovy 编写 Junit 测试用例,但它给了我以下异常: java.lang.NoSuchMethodError: org.mockito.interna
我们的应用程序使用 Google 集合中的 MapMaker 类,并且我们遇到了以下异常,但仅限于使用 webstart 的 OS X 10.4。从应用程序包启动时以及在 OS X 10.5 和 Wi
我是一名优秀的程序员,十分优秀!