public class TemplatePersistenceData extends Object
Clients may use this class, although this is not usually needed except when implementing a custom template preference page or template store. This class is not intended to be subclassed.
Constructor and Description |
---|
TemplatePersistenceData(Template template,
boolean enabled)
Creates a new, user-added instance that is not linked to a contributed
template.
|
TemplatePersistenceData(Template template,
boolean enabled,
String id)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getId()
Returns the id of this template store, or
null if there is none. |
Template |
getTemplate()
Returns the template encapsulated by the receiver.
|
boolean |
isCustom()
Returns whether the receiver represents a custom template, i.e. is either
a user-added template or a contributed template that has been modified.
|
boolean |
isDeleted()
Returns the deletion state of the stored template.
|
boolean |
isEnabled()
Returns the enablement state of the contained template.
|
boolean |
isModified()
Returns whether the receiver represents a modified template, i.e. a
contributed template that has been changed.
|
boolean |
isUserAdded()
Returns
true if the contained template was added by a
user, i.e. does not reference a contributed template. |
void |
revert()
Reverts the template to its original setting.
|
void |
setDeleted(boolean isDeleted)
Sets the deletion state of the stored template.
|
void |
setEnabled(boolean isEnabled)
Sets the enablement state of the contained template.
|
void |
setTemplate(Template template)
Sets the template encapsulated by the receiver.
|
public TemplatePersistenceData(Template template, boolean enabled)
template
- the template which is stored by the new instanceenabled
- whether the template is enabledpublic TemplatePersistenceData(Template template, boolean enabled, String id)
id
is not null
,
the instance is represents a template that is contributed and can be
identified via its id.template
- the template which is stored by the new instanceenabled
- whether the template is enabledid
- the id of the template, or null
if a user-added
instance should be createdpublic String getId()
null
if there is none.public boolean isDeleted()
public void setDeleted(boolean isDeleted)
isDeleted
- the deletion state of the stored templatepublic Template getTemplate()
public void setTemplate(Template template)
template
- the new templatepublic boolean isCustom()
true
if the contained template is a custom
template and cannot be reconstructed from the contributed
templatespublic boolean isModified()
true
if the contained template is contributed but has been modified, false
otherwisepublic boolean isUserAdded()
true
if the contained template was added by a
user, i.e. does not reference a contributed template.true
if the contained template was added by a user, false
otherwisepublic void revert()
public boolean isEnabled()
public void setEnabled(boolean isEnabled)
isEnabled
- the new enablement state of the contained template
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.