use of org.eclipse.tracecompass.internal.tmf.ui.Activator in project tracecompass by tracecompass.
the class TmfAnalysisOutputElement method getIcon.
@Override
public Image getIcon() {
if (fOutput instanceof TmfAnalysisViewOutput) {
IViewDescriptor descr = PlatformUI.getWorkbench().getViewRegistry().find(((TmfAnalysisViewOutput) fOutput).getViewId());
if (descr != null) {
Activator bundle = Activator.getDefault();
String key = descr.getId();
Image icon = bundle.getImageRegistry().get(key);
if (icon == null) {
icon = descr.getImageDescriptor().createImage();
bundle.getImageRegistry().put(key, icon);
}
if (icon != null) {
return icon;
}
}
}
return TmfProjectModelIcons.DEFAULT_VIEW_ICON;
}
use of org.eclipse.tracecompass.internal.tmf.ui.Activator in project tracecompass by tracecompass.
the class TmfUITestPlugin method loadIcon.
/**
* Loads icons into the bundle's image registry
*
* @param bundle
* the bundle
* @param url
* the icon url
* @return the image
*/
@Nullable
public static Image loadIcon(Bundle bundle, String url) {
if (bundle == null) {
return null;
}
Activator plugin = Activator.getDefault();
// $NON-NLS-1$
String key = bundle.getSymbolicName() + "/" + url;
Image icon = plugin.getImageRegistry().get(key);
if (icon == null) {
URL imageURL = bundle.getResource(url);
ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL);
if (descriptor != null) {
icon = descriptor.createImage();
plugin.getImageRegistry().put(key, icon);
}
}
return icon;
}
use of org.eclipse.tracecompass.internal.tmf.ui.Activator in project tracecompass by tracecompass.
the class TmfProjectModelIcons method loadIcon.
@Nullable
public static Image loadIcon(Bundle bundle, String url) {
if (bundle == null) {
return null;
}
Activator plugin = Activator.getDefault();
// $NON-NLS-1$
String key = bundle.getSymbolicName() + "/" + url;
Image icon = plugin.getImageRegistry().get(key);
if (icon == null) {
URL imageURL = bundle.getResource(url);
ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL);
if (descriptor != null) {
icon = descriptor.createImage();
plugin.getImageRegistry().put(key, icon);
}
}
return icon;
}
Aggregations