use of org.eclipse.jface.resource.ImageRegistry in project tmdm-studio-se by Talend.
the class RepositoryResourceUtilTest method setUp.
@Before
public void setUp() throws Exception {
ResourceBundle rb = mock(ResourceBundle.class);
// $NON-NLS-1$
stub(method(ResourceBundle.class, "getBundle", String.class)).toReturn(rb);
PowerMockito.mockStatic(JFaceResources.class);
ImageRegistry registry = mock(ImageRegistry.class);
when(JFaceResources.getImageRegistry()).thenReturn(registry);
PowerMockito.mockStatic(DefaultMessagesImpl.class);
// $NON-NLS-1$
when(DefaultMessagesImpl.getString(anyString())).thenReturn("anyString()");
IRepositoryResourceUtilExAdapter mockAdapter = PowerMockito.mock(IRepositoryResourceUtilExAdapter.class);
PowerMockito.mockStatic(ExAdapterManager.class);
PowerMockito.when(ExAdapterManager.getAdapter(new RepositoryResourceUtil(), IRepositoryResourceUtilExAdapter.class)).thenReturn(mockAdapter);
PowerMockito.mockStatic(CoreRuntimePlugin.class);
CoreRuntimePlugin coreRuntimePlugin = mock(CoreRuntimePlugin.class);
when(CoreRuntimePlugin.getInstance()).thenReturn(coreRuntimePlugin);
PowerMockito.mockStatic(RepositoryNodeProviderRegistryReader.class);
RepositoryNodeProviderRegistryReader reader = mock(RepositoryNodeProviderRegistryReader.class);
PowerMockito.when(RepositoryNodeProviderRegistryReader.getInstance()).thenReturn(reader);
}
use of org.eclipse.jface.resource.ImageRegistry in project liferay-ide by liferay.
the class LiferayServerUI method createImageRegistry.
protected ImageRegistry createImageRegistry() {
final ImageRegistry registry = new ImageRegistry();
final String[] pluginTypes = new String[] { "portlet", "hook", "ext", "layouttpl", "theme", "web" };
for (String type : pluginTypes) {
registerImage(registry, type, "/icons/e16/" + type + ".png");
}
registerImage(registry, IMG_WIZ_RUNTIME, "wizban/liferay_wiz.png");
registerImage(registry, IMG_NOTIFICATION, "e16/liferay_logo_16.png");
return registry;
}
use of org.eclipse.jface.resource.ImageRegistry in project liferay-ide by liferay.
the class PortalImages method create.
// public static final Image IMG_WORKFLOW_DEFINITION = createImage( "e16/workflow_16x16.png" );
// public static final Image IMG_WORKFLOW_DEFINITION_WIZBAN = createImage( "wizban/workflow_definition_16x16.png" );
// public static final Image IMG_WORKFLOW_DEFINITIONS_FOLDER = createImage( "e16/definitions_16x16.png" );
private static ImageDescriptor create(String key) {
try {
ImageDescriptor imageDescriptor = createDescriptor(key);
ImageRegistry imageRegistry = getImageRegistry();
if (imageRegistry != null) {
imageRegistry.put(key, imageDescriptor);
}
return imageDescriptor;
} catch (Exception ex) {
PortalUI.logError(ex);
return null;
}
}
use of org.eclipse.jface.resource.ImageRegistry in project liferay-ide by liferay.
the class PortalImages method createImage.
private static Image createImage(String key) {
create(key);
ImageRegistry imageRegistry = getImageRegistry();
return imageRegistry == null ? null : imageRegistry.get(key);
}
use of org.eclipse.jface.resource.ImageRegistry in project liferay-ide by liferay.
the class Plugin method getImage.
public Image getImage(String key) {
ImageRegistry imageRegistry = getImageRegistry();
Image image = imageRegistry.get(key);
if (image == null || image.isDisposed()) {
ImageDescriptor descriptor = getImageDescriptor(key);
if (descriptor != null) {
image = descriptor.createImage();
imageRegistry.put(key, image);
}
}
return image;
}
Aggregations