Skip navigation links
org.netbeans.spi.tasklist/1 1.49.0 1

Task List API
Official

See: Description

Task List API 
Package Description
org.netbeans.spi.tasklist
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.


TaskListSPI

TaskListXMLLayer

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:

<folder name="TaskList">
 <folder name="Groups">
  <file name="mygroup.instance">
   <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"/>
  </file>
 </folder>
</folder>

TaskGroups

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.

What is New (see all changes)?

Use Cases

Task Scanners

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.

Task Scanning Scope

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.

Task Groups

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.

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
TaskListSPIExportedOfficial .../spi/tasklist/package-summary.html

Group of layer interfaces
Interface NameIn/OutStabilitySpecified in What Document?
TaskListXMLLayerExportedOfficial

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:

<folder name="TaskList">
 <folder name="Groups">
  <file name="mygroup.instance">
   <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"/>
  </file>
 </folder>
</folder>

TaskGroupsExportedOfficial

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.

Implementation Details

Where are the sources for the module?

The sources for the module are in the Apache Git repositories or in the GitHub repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

no special dependency declarations

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.netbeans.spi.tasklist/1 1.49.0 1