Task List is a window that shows problems or tasks - error/warnings/todos etc - associated with files and folder under selected scope.
IMPORTANT: Since NB 7.2 the Tasks window has been renamed to Action Items window. Labels in UI now refer to "action items" but the code terms used in Task List API refer to "tasks".
This is a framework for Task List window that shows tasks (errors, warnings, todos) generated by plugable modules for selected files/folders.
Task List framework defines the following folders in XML layer:
/TaskList/Scanners - register your instances of task scanners here
/TaskList/ScanningScopes - here you can add additional scanning scopes
/TaskList/Groups - here you can define additional task groups, for example:
<attr name="instanceCreate" methodvalue="org.netbeans.spi.tasklist.Task.createGroup"/>
<attr name="localizingBundle" stringvalue="org.mymodule.resources.Bundle"/>
<attr name="groupName" stringvalue="my-unique-group-name"/>
<attr name="diplayNameKey" stringvalue="LBL_my_group"/>
<attr name="descriptionKey" stringvalue="HINT_my_group"/>
<attr name="iconKey" stringvalue="ICON_my_group"/>
Tasks are organized into groups according
to their importance (error/warning/todo etc). The task group is specified when the Task is created.
Each group is identified by its unique name. The Task List framework provides the following groups:
"nb-tasklist-error" - for error-type tasks
"nb-tasklist-warning" - for warning-type tasks
Additional task groups can be specified in xml layers, see above.
PushTaskScanner.Callback provides information whether the framework is observed and whether the current editor scope is set. Both these methods are needed for performance improvements of NB PushTaskScanners.
Task List API and user interface has been extended to support a generic URL as the resource the task is associated with. This allows for example bug tracking issues to be displayed in Task List window.
Task List implementation uses Indexing API to persist tasks created by FileTaskScanners. If a file hasn't changed since the last scan then the tasks associated with that file are loaded from cache to improve Task List performance. Therefore task's ActionListener isn't available when the task is restored from cache. Task providers must switch to PushTaskScanner if ActionListener is required to be available at all times.
API has changed due to the results of API inception review.
The main feature of the Task List SPI is the ability to 'plug-in' additional task providing modules that generate tasks for the task list window.
The plugable task scanners can either push new Tasks to the Task List window whenever they want - PushTaskScanner - or they can inherit from FileTaskScanner and the Task List framework will actively poll them for new tasks for each file under the current scanning scope (see below).
Scanner instances are registered in XML layer in folder "/TaskList/Scanners". The framework keeps track of modified files and notifies the scanners whenever a file under the scanning scope needs to be rescanned.
Scanning scope defines which files/folders will be scanned for tasks. The default implementation includes scopes for currently edited file, scope for files and folders in the main project and projects that depend on it and scope for all opened projects.
Additional scopes may be provided by extending TaskScanningScope class and registering instances in folder "/TaskList/ScanningScopes" in XML layer.
Tasks are organized into Groups according to their importance. Each task can be in one group only. The default implementation includes "Error", "Warning" and "TODO" groups. Additional groups can be registered in XML layer in folder "/TaskList/Groups". Each task group is identified by its unique name.
The sources for the module are in the NetBeans Mercurial repositories.
no special dependency declarations
Read more about the implementation in the answers to architecture questions.
Built on January 9 2021. | Copyright © 2017-2021 Apache Software Foundation. All Rights Reserved.