This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 26993 - ContextSettings.NULL_VALUE
Summary: ContextSettings.NULL_VALUE
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-09-03 21:39 UTC by Jan Pokorsky
Modified: 2003-12-11 14:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Pokorsky 2002-09-03 21:39:26 UTC
First, it is undocumented API.
Second, this is realy ugly IMO :-(

We have talket about using DirContext several times. Is not the time to start using it for stuff 
like that?
Comment 1 Vitezslav Stejskal 2002-09-04 08:27:32 UTC
The DirContext could be more elegant. Svato, what are exact requirements:

1. decide whether the value is inherited or not
2. be able to iterate over all values in inheritance tree
3. iterate over the inheritance tree (even through layers where value
isn't defined)

Anything else? Is #3 realy required?
Comment 2 Svata Dedic 2002-09-04 09:35:23 UTC
IMHO it is sufficient to have 1 & 2. Note that (1) and (2) are
specific applications of (3).
If we don't want to support context-specific settings processing, (1)
and (2) could be sufficient. 
Comment 3 Jan Pokorsky 2002-11-01 17:34:19 UTC
I am working on this.

I will remove ContextSettings.NULL_VALUE and extend ProxyContext to
implement DirContext. In order to be able to find out if a setting is
inherited or not I will introduce an operational attribute
inherit=[Boolean.TRUE|Boolean.FALSE].

Usage will be following:

 ContextSettings.isPropertyDefined(name)
 
corresponds to

 DirContext.getAttributes(name).get("inherit").get();

Moreover it will be possible to enumerate non-inherited settings with

 DirContext.search(nameOfContext, new BasicAttributes("inherit",
Boolean.FALSE));

BTW does anyone know purpose of the inherit param in
ContextSettings.isPropertyDefined? I would propose to remove it and
rename method to isValueInhereted(name).
Comment 4 Jan Pokorsky 2002-11-06 18:55:53 UTC
Prepared for integration.

Incompatible API changes:
in org.netbeans.spi.projects.ContextSettings:
* NULL_VALUE removed
* isPropertyDefined(String name, boolean inherit) changed to
  boolean isPropertyInhereted(String name)

Compatible API changes:
in org.netbeans.modules.projects.settings.ProxyContext:
* implements DirContext, namely methods getAtributes(...)
* introduced an operational attribute
  inherit=[Boolean.TRUE|Boolean.FALSE]
Comment 5 Jan Pokorsky 2002-11-08 00:15:53 UTC
integrated in

projects/core/src/org/netbeans/api/projects/settings/Contexts.java;
new revision: 1.1.2.7; previous revision: 1.1.2.6
projects/core/src/org/netbeans/modules/projects/settings/ProxyContext.java
new revision: 1.1.2.4; previous revision: 1.1.2.3
projects/core/src/org/netbeans/spi/projects/Contexts.java
new revision: 1.1.2.2; previous revision: 1.1.2.1
projects/core/src/org/netbeans/spi/projects/ContextSettings.java;
new revision: 1.1.2.2; previous revision: 1.1.2.1
Comment 6 Jan Pokorsky 2003-07-15 14:47:33 UTC
verified
Comment 7 Jan Becicka 2003-11-25 14:21:13 UTC
As described in
http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the
current work on projects prototype has been stopped.

Marking issue as CLOSED.