|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.core.runtime.Plugin org.eclipse.ui.plugin.AbstractUIPlugin uk.ac.kcl.cch.jb.pliny.imageRes.ImageResPlugin
The main plugin class for Pliny's Image Editor to be used in the desktop. The plugin as a whole is a classic Eclipse plugin, and contains many basic Pliny elements including most of the model and UI code.
This plugin class itself, as well as supporting the usual base Eclipse functionality provides several Pliny-specific functions:
ObjectType
for
Image Resources.
Field Summary | |
static String |
EDITOR_ID
|
static String |
PLUGIN_ID
|
Fields inherited from class org.eclipse.core.runtime.Plugin |
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME |
Constructor Summary | |
ImageResPlugin()
The constructor. |
Method Summary | |
boolean |
cacheImage(URL url,
int imageNo)
fetches the image pointed to by the given URL and stores it in the image cache, with the given cache ID. |
org.eclipse.jface.resource.ImageDescriptor |
createThumbnail(org.eclipse.swt.graphics.ImageData data,
String fname)
creates a thumbnail size (120 pixels wide) version of the given imageData. |
File |
getCacheFile(URL url,
int imageNo,
String ext)
|
static ImageResPlugin |
getDefault()
Returns the shared instance. |
org.eclipse.jface.resource.ImageDescriptor |
getFromImageCache(URL url,
int imageNo,
String ext)
The main mechanism to use to fetch an image from the image Cache. |
File |
getImageCachePath()
returns the full path to the directory where images are to be cached. |
static org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor(String path)
Returns an image descriptor for the image file at the given plug-in relative path. |
static ObjectType |
getImageObjectType()
returns the ObjectType for image resources that the editor in this plugin can handle. |
String |
getLastExtension()
|
String |
getStateLocationUrl(String objectName)
|
org.eclipse.jface.resource.ImageDescriptor |
getThumbnailFromImageCache(URL url,
int imageNo,
String givenExt)
fetches a thumbnail version of the image from the Image cache. |
void |
start(org.osgi.framework.BundleContext context)
This method is called upon plug-in activation |
void |
stop(org.osgi.framework.BundleContext context)
This method is called when the plug-in is stopped |
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin |
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup |
Methods inherited from class org.eclipse.core.runtime.Plugin |
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static String EDITOR_ID
public static String PLUGIN_ID
Constructor Detail |
public ImageResPlugin()
Method Detail |
public void start(org.osgi.framework.BundleContext context) throws Exception
Exception
public void stop(org.osgi.framework.BundleContext context) throws Exception
Exception
public static ImageResPlugin getDefault()
public static org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(String path)
path
- the path
public String getStateLocationUrl(String objectName)
public File getImageCachePath()
public String getLastExtension()
public File getCacheFile(URL url, int imageNo, String ext)
public boolean cacheImage(URL url, int imageNo)
url
- a URL that points to the image to be cachedimageNo
- a number that will act as an ID for this image
in the cache in the future.public org.eclipse.jface.resource.ImageDescriptor getFromImageCache(URL url, int imageNo, String ext)
url
- the URL that points to the imageimageNo
- the Cache ID numberext
- the image extension (e.g. 'jpg' or 'png', etc.)
public org.eclipse.jface.resource.ImageDescriptor createThumbnail(org.eclipse.swt.graphics.ImageData data, String fname)
data
- ImageData of the image the thumbnail is to be created for.fname
- full file name to assign to the thumbnail image file.public org.eclipse.jface.resource.ImageDescriptor getThumbnailFromImageCache(URL url, int imageNo, String givenExt)
url
- imageNo
- givenExt
- public static ObjectType getImageObjectType()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |