public class PreferenceOperation extends Object
PreferenceEditor
or a PreferenceModel
can
execute, e.g. "reset value to default". This class does not contain any code to
perform the operation, it just serves as key for the operation. The actual implementation
is part of the editor or the model.Modifier and Type | Field and Description |
---|---|
static PreferenceOperation |
DEFAULT
Operation for setting a property to its default value
|
static PreferenceOperation |
DELETE
Operation for deleting a property.
|
Constructor and Description |
---|
PreferenceOperation(String key)
Creates a new operation.
|
PreferenceOperation(String key,
Icon icon,
String description)
Creates a new operation.
|
Modifier and Type | Method and Description |
---|---|
PreferenceOperationView |
create(PreferenceModel model)
Creates and returns a view of this
PreferenceOperation for
model . |
boolean |
equals(Object obj) |
String |
getDescription()
Gets a short human readable description of this operation.
|
Icon |
getIcon()
Gets an icon for this operation.
|
String |
getIconId()
Gets the current identifier for the icon of this operation.
|
int |
hashCode() |
void |
setDescription(String description)
Sets a human readable description of this operation.
|
void |
setDescriptionId(String descriptionId)
Sets the unique identifier of the description.
|
void |
setIcon(Icon icon)
Sets an icon for this operation.
|
void |
setIconId(String iconId)
Sets the identifier for the icon, the identifier will be used to read an icon
from the
IconManager . |
public static final PreferenceOperation DELETE
public static final PreferenceOperation DEFAULT
public PreferenceOperation(String key)
key
- the unique identifier of this operationpublic PreferenceOperationView create(PreferenceModel model)
PreferenceOperation
for
model
.model
- the model using the operationpublic Icon getIcon()
public void setIcon(Icon icon)
icon
- the new icon, can be null
public String getIconId()
setIconId(String)
public void setIconId(String iconId)
IconManager
.iconId
- the new id, can not be null
public String getDescription()
public void setDescriptionId(String descriptionId)
TextManager
.descriptionId
- the identifier, not null
public void setDescription(String description)
description
- the description