API / geotoolkit / controls / tools / ToolsContainer / ToolsContainer
tools.ToolsContainer.ToolsContainer
The tools container class is a container of tools AbstractTool connecting tools to their plot. It can hold several tools using a composite tool as a root.
Constructors
- [new ToolsContainer(plot)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.controls.tools.toolscontainer.toolscontainer.md#new toolscontainer(plot))
Methods
Methods
▸ add(tool): ToolsContainer
Add tool or array of tools to container
this
▸ dispose(disposeTool?): void
Dispose tool container
| Name | Type | Description |
|---|---|---|
Optional disposeTool | boolean | dispose tool flag |
void
▸ getClassName(): string
string
▸ getNode(): Node
▸ getTool(): CompositeTool
Get tool
instance of composite tool
▸ getToolByName(toolName): ITool
Returns the tool matching the given name.<br> This function also accepts tool 'path' instead of absolute name.<br> For example:<br> getToolByName("compositeTool.panningTools.trackPanning.TrackPanning")<br> Would return the same tool as <br> getToolByName("TrackPanning")<br> As long as there is only one tool named "TrackPanning" in this composite<br> See listToolsNames()<br>
| Name | Type | Description |
|---|---|---|
toolName | string | The tool name or path |
▸ getToolByType(toolType): ITool
Returns the tool matching the given type. or null if nothing is matching the tool type<br> For example:<br> getToolByType(geotoolkit.controls.tools.Selection)<br> Would return the same tool as<br> getToolByName("pick")<br>
| Name | Type | Description |
|---|---|---|
toolType | ClassType<any> | toolType of the tool |
▸ insert(index, tool): ToolsContainer
Insert tool or array of tools to container at specified index.
| Name | Type | Description |
|---|---|---|
index | number | index to insert the tool or array of tools |
tool | AbstractTool | AbstractTool[] | tool or array of tools |
▸ isDisposed(): boolean
Returns whether this tool container has been disposed
boolean
▸ isEnabled(): boolean
returns enable state
boolean
state
▸ listToolsNames(): string[]
List all the tools contained in this composite. Prepend their parent tools parent using a '.'.
string[]
▸ remove(tool): ToolsContainer
Remove tool from container
| Name | Type | Description |
|---|---|---|
tool | ITool | tool to remove |
this
▸ setEnabled(enabled): ToolsContainer
set enable state
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
▸ Static getClassName(): string
string