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 26741 - Implement ProjectCloneableEditor and all that stuff.
Summary: Implement ProjectCloneableEditor and all that stuff.
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
Depends on:
Blocks: 26740 27144
  Show dependency tree
Reported: 2002-08-23 16:51 UTC by Jan Jancura
Modified: 2003-12-11 14:25 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Jan Jancura 2002-08-23 16:51:51 UTC
Some TopComponents (Editor, Form Editor) should
keep Project Context. We need some support to do
it. Suggested solution (by Jarda) is to implement
ProjectCloneableEditor and other stuff in Project
Module. Thanks :)
Comment 1 Torbjorn Norbye 2002-08-23 19:43:32 UTC
Can you give a little bit more information on what it is you
need? Why does the Editor need project context?
Comment 2 Pavel Buzek 2002-09-03 13:59:40 UTC
The Editor may need to access some project settings (e.g. parser database).
Comment 3 Vitezslav Stejskal 2002-10-05 00:29:45 UTC
Projects API provides two classes to support integration with editor -
ProjectEditorSupport, ProjectEditor. Modules should use them when they
provide editor features which require context of the project
containing edited file (e.g. code completion in java editor).

Projects infrastructure provides correct node as an activated node of
the editor TopComponent. When editor TopComponent needs to create its
own activated node it should provide Project on that node. It can be
obtained from ProjectEditor.getProject(), also subclasses of
ProjectEditor are notified whenever the project context of edited file
changes (see notifyProjectChanged method).

ProjectEditorSupport implementation should be always provided from
DataObject of the source file, project context is delivered to it
automaticaly when editor is opened. This ensures that source file can
be opened in editor even when there is no opened project containing
that file.

Projects infrastructure provides speacial action in the popup menu of
editor's TopComponent which allows to switch project context of edited
file in case that there is several  projects containing edited file.
The context is also switched when file is re-opened from another project.

Editor can read project from the property of Document. This property
is called 'project' and is automaticaly updated whenever the project
context of edited file changes. This property can be 'null' or not set
in case that file isn't edited in context of any project.