public class StructureDependency extends Dependency
Preferences
,
Workspace
s, or Project
s. These containers store properties
in HashStructure
s which use slash-separated
compound names to identify properties.
Most Audit dependencies on properties target one or a very few properties.
For example, Java code analysis depends on the project JDK version which is a
property of the project compiler settings. While it would be expedient to
to invalidate after any project setting changes, it could result in a lot
of wasted Java analysis if the user changes a JavaScript setting.
It can be a bit difficult to identify the actual name corresponding to a
specific property. One option is to identify it in the saved XML file, since
the names used in the XML are typically somewhat self-explanatory. Another
option is to attach a StructureChangeListener
to the project hash structure, manually change the
property, and extract the information from the received event. Yet another
option, if available, is to read source for the HashStructureAdapter
typically provided as a facade for related groups of properties, for example,
BuildSystemConfiguration
for compile properties.
For projects and workspaces, a property can be identified by its full
property name, for example:
new StructureDependency(project, "oracle.jdeveloper.compiler.OjcConfiguration/source")
It can also be identified by an appropriate HashStructureAdapter
instance and a name relative to the HashStructure
to which it corresponds, for example:
new StructureDependency(project, BuildSystemConfiguration.getInstance(project), "source")
The supplied property names are prefix matched, so all the project compile
properties could be depended on with either of the following:
new StructureDependency(project, "oracle.jdeveloper.compiler.OjcConfiguration")
new StructureDependency(project, BuildSystemConfiguration.getInstance(project))
Constructor and Description |
---|
StructureDependency(Preferences preferences,
HashStructureAdapter scope,
java.lang.String... properties)
Creates a dependency on properties of a
HashStructureAdapter of
Preferences . |
StructureDependency(Preferences preferences,
java.lang.String... properties)
Creates a dependency on properties of
Preferences . |
StructureDependency(Project project,
HashStructureAdapter scope,
java.lang.String... properties)
Creates a dependency on properties of a
HashStructureAdapter of a
Project . |
StructureDependency(Project project,
java.lang.String... properties)
Creates a dependency on properties of a
Project . |
StructureDependency(PropertyStorage container,
HashStructureAdapter scope,
java.lang.String... properties)
Creates a dependency on properties of a
HashStructureAdapter of a
Project . |
StructureDependency(Workspace workspace,
HashStructureAdapter scope,
java.lang.String... properties)
Creates a dependency on properties of a
HashStructureAdapter of a
Workspace . |
StructureDependency(Workspace workspace,
java.lang.String... properties)
Creates a dependency on properties of a
Workspace . |
Modifier and Type | Method and Description |
---|---|
protected void |
attach()
Attach this dependency to its target.
|
protected void |
detach()
Detach this dependency from its target.
|
protected java.lang.String |
getLongDescription()
Gets a translated long description of the target of this dependency.
|
protected java.lang.String |
getShortDescription()
Gets a translated short description of the target of this dependency.
|
addChangeListener, fireDependencyChanged, getChangeListener, isAttached, listenerDescription, removeChangeListener, toString
public StructureDependency(Preferences preferences, java.lang.String... properties)
Preferences
.preferences
- the preferences on which to depend.properties
- fully-qualified property names or name prefixes.public StructureDependency(Preferences preferences, HashStructureAdapter scope, java.lang.String... properties)
HashStructureAdapter
of
Preferences
.preferences
- preferences on which to depend.scope
- a HashStructureAdapter
scoping the properties.properties
- adapter-relative property names or name prefixes.public StructureDependency(Workspace workspace, java.lang.String... properties)
Workspace
.workspace
- the workspace on which to depend.properties
- fully-qualified property names or name prefixes.public StructureDependency(Workspace workspace, HashStructureAdapter scope, java.lang.String... properties)
HashStructureAdapter
of a
Workspace
.workspace
- the workspace on which to depend.scope
- a HashStructureAdapter
scoping the properties.properties
- adapter-relative property names or name prefixes.public StructureDependency(Project project, java.lang.String... properties)
Project
.project
- the project on which to depend.properties
- project-relative full names or prefixes of properties.public StructureDependency(Project project, HashStructureAdapter scope, java.lang.String... properties)
HashStructureAdapter
of a
Project
.project
- the workspace on which to depend.scope
- a HashStructureAdapter
scoping the properties.properties
- adapter-relative property names or name prefixes.public StructureDependency(PropertyStorage container, HashStructureAdapter scope, java.lang.String... properties)
HashStructureAdapter
of a
Project
.container
- the workspace on which to depend.scope
- a HashStructureAdapter
scoping the properties, null if none.properties
- relative property names or name prefixes.protected void attach()
Dependency
attach
in class Dependency
protected void detach()
Dependency
detach
in class Dependency
protected java.lang.String getShortDescription()
Dependency
getShortDescription
in class Dependency
protected java.lang.String getLongDescription()
Dependency
getLongDescription
in class Dependency