|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpl.edu.agh.cast.resource.VisualResource
public class VisualResource
Default implementation of IVisualResource.
| Field Summary |
|---|
| Fields inherited from interface pl.edu.agh.cast.resource.IVisualResource |
|---|
NAME_SEPARATOR |
| Constructor Summary | |
|---|---|
VisualResource(String id,
String label,
String description)
Constructor with all required parameters. |
|
VisualResource(String id,
String label,
String description,
List<String> tags,
String groupId,
Type type)
Constructor. |
|
| Method Summary | |
|---|---|
void |
dispose()
Disposes the resource. |
String |
getDescription()
Gets localized resource description. |
String |
getGroupId()
Returns group id. |
String |
getId()
Gets resource id. |
org.eclipse.swt.graphics.Image |
getImage()
Gets default image associated with the resource. |
org.eclipse.swt.graphics.Image |
getImage(ImageSize size)
Gets default image associated with this resource with specified size. |
org.eclipse.swt.graphics.Image |
getImage(String variant)
Gets a given variant of image in default size (see IVisualResource.getImage() method java doc for more details about how
default size is chosen). |
org.eclipse.swt.graphics.Image |
getImage(String variant,
ImageSize size)
Gets a given variant of image in specified size. |
String |
getLabel()
Gets localized resource label. |
List<String> |
getTags()
Returns tags associated with the resource. |
Type |
getType()
Returns type of element represented by the resource. |
org.eclipse.jface.resource.ImageDescriptor |
registerDefaultImageDesriptor(ImageSize size,
org.eclipse.jface.resource.ImageDescriptor descriptor)
Registers image descriptor for default image with specified size. |
org.eclipse.jface.resource.ImageDescriptor |
registerVariantImageDescriptor(String variant,
ImageSize size,
org.eclipse.jface.resource.ImageDescriptor descriptor)
Registers image descriptor for variant with specified size. |
protected void |
setDescription(String description)
|
protected void |
setGroupId(String groupId)
|
protected void |
setId(String id)
|
protected void |
setLabel(String label)
|
protected void |
setTags(List<String> tags)
|
protected void |
setType(Type type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VisualResource(String id,
String label,
String description)
id - resource idlabel - resource labeldescription - resource description
public VisualResource(String id,
String label,
String description,
List<String> tags,
String groupId,
Type type)
id - resource idlabel - resource labeldescription - resource descriptiontags - resource tagsgroupId - resource group idtype - type of described element or data set| Method Detail |
|---|
public org.eclipse.jface.resource.ImageDescriptor registerDefaultImageDesriptor(ImageSize size,
org.eclipse.jface.resource.ImageDescriptor descriptor)
throws ResourceException
null. If an image descriptor has been already registered, it is overridden with a new one.
size - image sizedescriptor - image descriptor
null if
there was no such image
ResourceException - when image cannot be created
IllegalArgumentException - when at least one of the given arguments is null
public org.eclipse.jface.resource.ImageDescriptor registerVariantImageDescriptor(String variant,
ImageSize size,
org.eclipse.jface.resource.ImageDescriptor descriptor)
throws ResourceException
null. If an
image descriptor has been already registered, it is overridden with a new one.
variant - id of image variantsize - image sizedescriptor - image descriptor
null if there was no such image
ResourceException - when image cannot be created
IllegalArgumentException - when at least one of the given arguments is nullpublic String getDescription()
getDescription in interface IVisualResourceIVisualResource.getDescription()public String getGroupId()
getGroupId in interface IVisualResourcenull if the resource has no group.IVisualResource.getGroupId()public String getId()
Type.toString(). In other cases the id should be unique string in Java package style.
getId in interface IVisualResourceIVisualResource.getId()public org.eclipse.swt.graphics.Image getImage()
ImageSize.getDefaultSize() is searched and
returned, if not found null is returned
getImage in interface IVisualResourcenull if image not existsIVisualResource.getImage()public org.eclipse.swt.graphics.Image getImage(ImageSize size)
getImage in interface IVisualResourcesize - image size
null if image not existsIVisualResource.getImage(pl.edu.agh.cast.resource.ImageSize)public org.eclipse.swt.graphics.Image getImage(String variant)
IVisualResource.getImage() method java doc for more details about how
default size is chosen).
getImage in interface IVisualResourcevariant - image variant
null if variant of image not existsIVisualResource.getImage(java.lang.String)
public org.eclipse.swt.graphics.Image getImage(String variant,
ImageSize size)
getImage in interface IVisualResourcevariant - image variantsize - image size
null if image not existsIVisualResource.getImage(java.lang.String, pl.edu.agh.cast.resource.ImageSize)public String getLabel()
getLabel in interface IVisualResourceIVisualResource.getLabel()public List<String> getTags()
getTags in interface IVisualResourceIVisualResource.getTags()public Type getType()
getType in interface IVisualResourcenull if the resource is not associated with any elementIVisualResource.getType()public void dispose()
dispose in interface IVisualResourceIVisualResource.dispose()protected void setId(String id)
id - the id to setprotected void setLabel(String label)
label - the label to setprotected void setDescription(String description)
description - the description to setprotected void setTags(List<String> tags)
tags - the tags to setprotected void setGroupId(String groupId)
groupId - the groupId to setprotected void setType(Type type)
type - the type to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||