public interface IProjectWorkspacePreference<T> extends IEclipsePreference<T>
Extends the IEclipsePreference
by adding the support for a required project nature identifier. This may be
used to make the property dependent of a specific project nature
.
Defines several get
s and set
s methods to retrieve and set the value of the preference.
Modifier and Type | Method and Description |
---|---|
void |
addPreferenceChangeListenerToProject(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Registers the given listener for notification of project-level changes of this preference in specified project.
|
void |
addPreferenceChangeListenerToWorkspace(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Registers the given listener for notification of workspace-level changes of this preference.
|
T |
get(org.eclipse.core.resources.IProject project)
Returns the value of the preference.
|
T |
getDefaultValueAsObject() |
T |
getFromProject(org.eclipse.core.resources.IProject project)
Returns the value of the preference from the project.
|
T |
getFromWorkspace()
Returns the value of the preference from the workspace.
|
T |
getFromWorkspaceForProject(org.eclipse.core.resources.IProject project)
Returns the value of the preference from the workspace.
|
java.lang.String |
getRequiredProjectNatureId()
Return the identifier of the project nature that is required by the preference.
|
void |
removePreferenceChangeListenerFromProject(org.eclipse.core.resources.IProject project,
org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Unregisters the given listener from receiving notification of project-level changes of this preference in
specified project.
|
void |
removePreferenceChangeListenerFromWorkspace(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
Unregisters the given listener from receiving notification of workspace-level changes of this preference.
|
void |
setInProject(org.eclipse.core.resources.IProject project,
T valueAsObject)
Set the value of the preference in the project.
|
void |
setInWorkspace(T valueAsObject)
Sets the value of the preference in the workspace.
|
void |
setToDefaultInProject(org.eclipse.core.resources.IProject project) |
void |
setToDefaultInWorkspace() |
getDefaultValueAsString, getKey, getQualifier
java.lang.String getRequiredProjectNatureId()
T get(org.eclipse.core.resources.IProject project)
project
- the project for which the preference is to be retrievedT getDefaultValueAsObject()
T getFromProject(org.eclipse.core.resources.IProject project)
null
is returned. The behavior of this method may depend on the nature of the
project that is provided as a parameter.project
- the project for which the preference is to be retrievedIProjectPreference.get(IProject)
void setInProject(org.eclipse.core.resources.IProject project, T valueAsObject)
project
- the project for which the preference is to be retrievedvalueAsObject
- the new value of the preferenceIProjectPreference.set(IProject, Object)
void setToDefaultInProject(org.eclipse.core.resources.IProject project)
void addPreferenceChangeListenerToProject(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
null
.project
- the project in which the changes of this preference are to be observedlistener
- the preference change listener to register#removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)
,
IEclipsePreferences.IPreferenceChangeListener
void removePreferenceChangeListenerFromProject(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
null
.project
- the project in which the changes of this preference have been observedlistener
- the preference change listener to remove#addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)
,
IEclipsePreferences.IPreferenceChangeListener
T getFromWorkspace()
IWorkspacePreference.get()
T getFromWorkspaceForProject(org.eclipse.core.resources.IProject project)
project
- the project for which the preference is to be retrievedIWorkspacePreference.get()
void setInWorkspace(T valueAsObject)
valueAsObject
- the new value of the preferenceIWorkspacePreference.set(Object)
void setToDefaultInWorkspace()
void addPreferenceChangeListenerToWorkspace(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
null
.listener
- the preference change listener to register#removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)
,
IEclipsePreferences.IPreferenceChangeListener
void removePreferenceChangeListenerFromWorkspace(org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener listener)
null
.listener
- the preference change listener to remove#addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener)
,
IEclipsePreferences.IPreferenceChangeListener