mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Move away of deprecated imageDescriptorFromPlugin.
Change-Id: I855682065fe6b40deeedc6cd7b5cb419848caac0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
4477ea013a
commit
d0d6f57a50
21 changed files with 56 additions and 78 deletions
|
@ -15,6 +15,7 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
@ -66,7 +67,7 @@ public class ControlFlowGraphPlugin extends AbstractUIPlugin {
|
|||
ImageRegistry registry = getImageRegistry();
|
||||
ImageDescriptor descriptor = registry.getDescriptor(key);
|
||||
if (descriptor == null) {
|
||||
descriptor = imageDescriptorFromPlugin(PLUGIN_ID, key);
|
||||
descriptor = ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, key).get();
|
||||
registry.put(key, descriptor);
|
||||
}
|
||||
return descriptor;
|
||||
|
@ -76,7 +77,7 @@ public class ControlFlowGraphPlugin extends AbstractUIPlugin {
|
|||
ImageRegistry registry = getImageRegistry();
|
||||
Image image = registry.get(key);
|
||||
if (image == null) {
|
||||
ImageDescriptor descriptor = imageDescriptorFromPlugin(PLUGIN_ID, key);
|
||||
ImageDescriptor descriptor = ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, key).get();
|
||||
registry.put(key, descriptor);
|
||||
image = registry.get(key);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.core.runtime.preferences.InstanceScope;
|
|||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.ui.ISharedImages;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
@ -67,18 +68,6 @@ public class CodanUIActivator extends AbstractUIPlugin {
|
|||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given plug-in
|
||||
* relative path
|
||||
*
|
||||
* @param path
|
||||
* the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param key - key is usually plug-in relative path to image like icons/xxx.gif
|
||||
|
@ -88,7 +77,7 @@ public class CodanUIActivator extends AbstractUIPlugin {
|
|||
ImageRegistry registry = getImageRegistry();
|
||||
Image image = registry.get(key);
|
||||
if (image == null) {
|
||||
ImageDescriptor descriptor = imageDescriptorFromPlugin(PLUGIN_ID, key);
|
||||
ImageDescriptor descriptor = ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, key).get();
|
||||
if (descriptor == null) {
|
||||
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
|
||||
return sharedImages.getImage(key);
|
||||
|
|
|
@ -19,6 +19,7 @@ import org.eclipse.core.runtime.IExtension;
|
|||
import org.eclipse.core.runtime.IExtensionPoint;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.jface.wizard.IWizardPage;
|
||||
import org.eclipse.jface.wizard.Wizard;
|
||||
import org.eclipse.jface.wizard.WizardPage;
|
||||
|
@ -30,7 +31,6 @@ import org.eclipse.swt.layout.GridLayout;
|
|||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Table;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public class NewToolChainWizardSelectionPage extends WizardPage {
|
||||
|
||||
|
@ -62,8 +62,8 @@ public class NewToolChainWizardSelectionPage extends WizardPage {
|
|||
|
||||
String iconFile = element.getAttribute("icon"); //$NON-NLS-1$
|
||||
if (iconFile != null) {
|
||||
ImageDescriptor desc = CUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(),
|
||||
iconFile);
|
||||
ImageDescriptor desc = ResourceLocator
|
||||
.imageDescriptorFromBundle(element.getNamespaceIdentifier(), iconFile).get();
|
||||
if (desc != null) {
|
||||
item.setImage(desc.createImage());
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ public class NewToolChainWizardSelectionPage extends WizardPage {
|
|||
if (descImage == null) {
|
||||
return null;
|
||||
}
|
||||
return AbstractUIPlugin.imageDescriptorFromPlugin(element.getNamespaceIdentifier(), descImage);
|
||||
return ResourceLocator.imageDescriptorFromBundle(element.getNamespaceIdentifier(), descImage).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,17 +24,17 @@ import org.eclipse.core.resources.IFile;
|
|||
import org.eclipse.core.resources.IProject;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.jface.viewers.IDecoration;
|
||||
import org.eclipse.jface.viewers.ILabelProviderListener;
|
||||
import org.eclipse.jface.viewers.ILightweightLabelDecorator;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
/**
|
||||
* A label provider that marks all translation units that are currently part of the index.
|
||||
*/
|
||||
public class IndexedFilesLabelProvider implements ILightweightLabelDecorator {
|
||||
private static final ImageDescriptor INDEXED = AbstractUIPlugin.imageDescriptorFromPlugin(CUIPlugin.PLUGIN_ID,
|
||||
"$nl$/icons/ovr16/indexedFile.gif"); //$NON-NLS-1$
|
||||
private static final ImageDescriptor INDEXED = ResourceLocator
|
||||
.imageDescriptorFromBundle(CUIPlugin.PLUGIN_ID, "$nl$/icons/ovr16/indexedFile.gif").get(); //$NON-NLS-1$
|
||||
|
||||
public IndexedFilesLabelProvider() {
|
||||
}
|
||||
|
|
|
@ -71,6 +71,7 @@ import org.eclipse.jface.operation.IRunnableWithProgress;
|
|||
import org.eclipse.jface.preference.IPreferencePageContainer;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.jface.util.IPropertyChangeListener;
|
||||
import org.eclipse.jface.util.PropertyChangeEvent;
|
||||
import org.eclipse.swt.SWT;
|
||||
|
@ -100,7 +101,6 @@ import org.eclipse.ui.IWorkbenchPartReference;
|
|||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation;
|
||||
import org.eclipse.ui.dialogs.PropertyPage;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
/**
|
||||
* It is a parent for all standard CDT property pages
|
||||
|
@ -1199,9 +1199,9 @@ public abstract class AbstractPage extends PropertyPage implements IPreferencePa
|
|||
URL url = null;
|
||||
String iconName = config.getAttribute(IMAGE_NAME);
|
||||
if (iconName != null) {
|
||||
idesc = AbstractUIPlugin.imageDescriptorFromPlugin(
|
||||
idesc = ResourceLocator.imageDescriptorFromBundle(
|
||||
Platform.getBundle(config.getDeclaringExtension().getContributor().getName()).getSymbolicName(),
|
||||
iconName);
|
||||
iconName).get();
|
||||
}
|
||||
if (idesc == null)
|
||||
return null;
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ui
|
||||
Bundle-SymbolicName: org.eclipse.cdt.launch.serial.ui;singleton:=true
|
||||
Bundle-Version: 1.0.100.qualifier
|
||||
Bundle-Version: 1.0.200.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.13.0",
|
||||
org.eclipse.ui;bundle-version="3.109.0",
|
||||
|
|
|
@ -12,6 +12,7 @@ package org.eclipse.cdt.launch.serial.ui.internal;
|
|||
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
@ -35,7 +36,7 @@ public class Activator extends AbstractUIPlugin {
|
|||
protected void initializeImageRegistry(ImageRegistry reg) {
|
||||
super.initializeImageRegistry(reg);
|
||||
|
||||
reg.put(IMG_CDT_LOGO, imageDescriptorFromPlugin(PLUGIN_ID, "icons/cdt_logo_16.png")); //$NON-NLS-1$
|
||||
reg.put(IMG_CDT_LOGO, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/cdt_logo_16.png").get()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public static Image getImage(String key) {
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.application;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
|
@ -54,15 +53,4 @@ public class Activator extends AbstractUIPlugin {
|
|||
public static Activator getDefault() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given
|
||||
* plug-in relative path
|
||||
*
|
||||
* @param path the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
|
|||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.jface.text.source.ISharedTextColors;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
|
@ -362,7 +363,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
|
|||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
return ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, path).get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -374,7 +375,7 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
|
|||
ImageRegistry registry = getImageRegistry();
|
||||
Image image = registry.get(key);
|
||||
if (image == null) {
|
||||
ImageDescriptor descriptor = imageDescriptorFromPlugin(PLUGIN_ID, key);
|
||||
ImageDescriptor descriptor = ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, key).get();
|
||||
if (descriptor == null) {
|
||||
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
|
||||
return sharedImages.getImage(key);
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
|
|||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
|
@ -265,7 +266,7 @@ public class GdbUIPlugin extends AbstractUIPlugin {
|
|||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
return ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, path).get();
|
||||
}
|
||||
|
||||
public static Image getImage(String key) {
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.eclipse.cdt.dsf.gdb.internal.ui.console.ConsoleMessages;
|
|||
import org.eclipse.cdt.dsf.gdb.internal.ui.console.IConsoleImagesConst;
|
||||
import org.eclipse.jface.action.Action;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.custom.BusyIndicator;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
@ -40,8 +41,8 @@ public class ConsoleSaveAction extends Action {
|
|||
public ConsoleSaveAction(TextConsole console) {
|
||||
super();
|
||||
setToolTipText(ConsoleMessages.ConsoleMessages_save_action_tooltip);
|
||||
setImageDescriptor(
|
||||
GdbUIPlugin.imageDescriptorFromPlugin(GdbUIPlugin.PLUGIN_ID, IConsoleImagesConst.IMG_SAVE_CONSOLE));
|
||||
setImageDescriptor(ResourceLocator
|
||||
.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID, IConsoleImagesConst.IMG_SAVE_CONSOLE).get());
|
||||
fConsole = console;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.dsf.gdb.internal.ui.tracepoints.TraceControlView.FailedTr
|
|||
import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITraceVariableDMData;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.DisposeEvent;
|
||||
import org.eclipse.swt.events.DisposeListener;
|
||||
|
@ -43,7 +44,6 @@ import org.eclipse.swt.widgets.Table;
|
|||
import org.eclipse.swt.widgets.TableColumn;
|
||||
import org.eclipse.swt.widgets.TableItem;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public final class TraceVarDetailsDialog extends Dialog {
|
||||
|
||||
|
@ -163,8 +163,8 @@ public final class TraceVarDetailsDialog extends Dialog {
|
|||
warningIconLabel = new Label(createButtonComposite, SWT.NONE);
|
||||
warningIconLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||
|
||||
warningImage = AbstractUIPlugin.imageDescriptorFromPlugin(GdbUIPlugin.PLUGIN_ID, "icons/full/obj16/warning.gif") //$NON-NLS-1$
|
||||
.createImage();
|
||||
warningImage = ResourceLocator.imageDescriptorFromBundle(GdbUIPlugin.PLUGIN_ID, "icons/full/obj16/warning.gif") //$NON-NLS-1$
|
||||
.get().createImage();
|
||||
warningIconLabel.setImage(warningImage);
|
||||
warningIconLabel.setVisible(false);
|
||||
|
||||
|
|
|
@ -106,6 +106,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
|
|||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.preference.PreferenceConverter;
|
||||
import org.eclipse.jface.resource.JFaceResources;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.jface.text.BadLocationException;
|
||||
import org.eclipse.jface.text.BadPositionCategoryException;
|
||||
import org.eclipse.jface.text.IFindReplaceTarget;
|
||||
|
@ -175,7 +176,6 @@ import org.eclipse.ui.handlers.IHandlerActivation;
|
|||
import org.eclipse.ui.handlers.IHandlerService;
|
||||
import org.eclipse.ui.ide.IGotoMarker;
|
||||
import org.eclipse.ui.part.WorkbenchPart;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
|
||||
import org.eclipse.ui.texteditor.AnnotationPreference;
|
||||
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
|
||||
|
@ -1340,7 +1340,7 @@ public abstract class DisassemblyPart extends WorkbenchPart
|
|||
fActionToggleSource = new ActionToggleSource();
|
||||
fStateDependentActions.add(fActionToggleSource);
|
||||
fActionToggleSource.setImageDescriptor(
|
||||
AbstractUIPlugin.imageDescriptorFromPlugin(DsfUIPlugin.PLUGIN_ID, "icons/source.gif")); //$NON-NLS-1$
|
||||
ResourceLocator.imageDescriptorFromBundle(DsfUIPlugin.PLUGIN_ID, "icons/source.gif").get()); //$NON-NLS-1$
|
||||
fVerticalRuler.getControl().addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mouseDoubleClick(final MouseEvent e) {
|
||||
|
|
|
@ -17,6 +17,7 @@ package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.actions;
|
|||
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
|
||||
import org.eclipse.jface.action.ContributionItem;
|
||||
import org.eclipse.jface.action.IAction;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
|
@ -42,7 +43,6 @@ import org.eclipse.swt.widgets.Event;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.ToolBar;
|
||||
import org.eclipse.swt.widgets.ToolItem;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
||||
public class AddressBarContributionItem extends ContributionItem {
|
||||
private Combo addressBox;
|
||||
|
@ -185,8 +185,8 @@ public class AddressBarContributionItem extends ContributionItem {
|
|||
|
||||
warningLabel = new Label(top, SWT.NONE);
|
||||
|
||||
warningImage = AbstractUIPlugin.imageDescriptorFromPlugin(DsfUIPlugin.PLUGIN_ID, "icons/address_warning.gif") //$NON-NLS-1$
|
||||
.createImage();
|
||||
warningImage = ResourceLocator.imageDescriptorFromBundle(DsfUIPlugin.PLUGIN_ID, "icons/address_warning.gif") //$NON-NLS-1$
|
||||
.get().createImage();
|
||||
warningLabel.setImage(warningImage);
|
||||
warningLabel.setToolTipText(warningText);
|
||||
setWarningIconVisible(false);
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
@ -106,7 +107,7 @@ public class DsfUIPlugin extends AbstractUIPlugin {
|
|||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
return ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, path).get();
|
||||
}
|
||||
|
||||
public static SourceDocumentProvider getSourceDocumentProvider() {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.examples.dsf;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
|
@ -47,10 +47,11 @@ public class DsfExamplesPlugin extends AbstractUIPlugin {
|
|||
public void start(BundleContext context) throws Exception {
|
||||
fgBundleContext = context;
|
||||
super.start(context);
|
||||
getImageRegistry().put(IMG_ALARM, imageDescriptorFromPlugin(PLUGIN_ID, IMG_ALARM));
|
||||
getImageRegistry().put(IMG_ALARM_TRIGGERED, imageDescriptorFromPlugin(PLUGIN_ID, IMG_ALARM_TRIGGERED));
|
||||
getImageRegistry().put(IMG_TIMER, imageDescriptorFromPlugin(PLUGIN_ID, IMG_TIMER));
|
||||
getImageRegistry().put(IMG_REMOVE, imageDescriptorFromPlugin(PLUGIN_ID, IMG_REMOVE));
|
||||
getImageRegistry().put(IMG_ALARM, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, IMG_ALARM).get());
|
||||
getImageRegistry().put(IMG_ALARM_TRIGGERED,
|
||||
ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, IMG_ALARM_TRIGGERED).get());
|
||||
getImageRegistry().put(IMG_TIMER, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, IMG_TIMER).get());
|
||||
getImageRegistry().put(IMG_REMOVE, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, IMG_REMOVE).get());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -73,15 +74,4 @@ public class DsfExamplesPlugin extends AbstractUIPlugin {
|
|||
return fgBundleContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an image descriptor for the image file at the given
|
||||
* plug-in relative path
|
||||
*
|
||||
* @param path the path
|
||||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.internal.docker.launcher.ConnectionListener;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
|
@ -143,6 +144,6 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
|
|||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
return ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, path).get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
|
@ -67,7 +68,7 @@ public class MemoryBrowserPlugin extends AbstractUIPlugin {
|
|||
* @return the image descriptor
|
||||
*/
|
||||
public static ImageDescriptor getImageDescriptor(String path) {
|
||||
return imageDescriptorFromPlugin(PLUGIN_ID, path);
|
||||
return ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, path).get();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.cdt.qt.ui;singleton:=true
|
||||
Bundle-Version: 2.0.1.qualifier
|
||||
Bundle-Version: 2.0.100.qualifier
|
||||
Bundle-Activator: org.eclipse.cdt.internal.qt.ui.Activator
|
||||
Bundle-Vendor: %providerName
|
||||
Bundle-Localization: plugin
|
||||
|
|
|
@ -20,6 +20,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
@ -52,7 +53,7 @@ public class Activator extends AbstractUIPlugin {
|
|||
plugin = this;
|
||||
|
||||
ImageRegistry imageRegistry = getImageRegistry();
|
||||
imageRegistry.put(IMG_QT_16, imageDescriptorFromPlugin(PLUGIN_ID, "icons/qt16.png")); //$NON-NLS-1$
|
||||
imageRegistry.put(IMG_QT_16, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/qt16.png").get()); //$NON-NLS-1$
|
||||
|
||||
// Use a save participant to grab any changed resources while this
|
||||
// plugin was inactive
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.resource.ImageRegistry;
|
||||
import org.eclipse.jface.resource.ResourceLocator;
|
||||
import org.eclipse.ui.plugin.AbstractUIPlugin;
|
||||
import org.osgi.framework.BundleContext;
|
||||
import org.osgi.framework.ServiceReference;
|
||||
|
@ -49,10 +50,11 @@ public class Activator extends AbstractUIPlugin {
|
|||
@Override
|
||||
protected ImageRegistry createImageRegistry() {
|
||||
ImageRegistry registry = super.createImageRegistry();
|
||||
registry.put(IMG_ARDUINO, imageDescriptorFromPlugin(PLUGIN_ID, "icons/cprojects.gif")); //$NON-NLS-1$
|
||||
registry.put(IMG_CONNECTION_TYPE, imageDescriptorFromPlugin(PLUGIN_ID, "icons/arduino.png")); //$NON-NLS-1$
|
||||
registry.put(IMG_ADD, imageDescriptorFromPlugin(PLUGIN_ID, "icons/list-add.gif")); //$NON-NLS-1$
|
||||
registry.put(IMG_DELETE, imageDescriptorFromPlugin(PLUGIN_ID, "icons/list-delete.gif")); //$NON-NLS-1$
|
||||
registry.put(IMG_ARDUINO, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/cprojects.gif").get()); //$NON-NLS-1$
|
||||
registry.put(IMG_CONNECTION_TYPE,
|
||||
ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/arduino.png").get()); //$NON-NLS-1$
|
||||
registry.put(IMG_ADD, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/list-add.gif").get()); //$NON-NLS-1$
|
||||
registry.put(IMG_DELETE, ResourceLocator.imageDescriptorFromBundle(PLUGIN_ID, "icons/list-delete.gif").get()); //$NON-NLS-1$
|
||||
return registry;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue