class KTextEditor.Command


abstract class

Table of contents
Modules
ktexteditor Classes
All Classes
Module ktexteditor
Namespace ktexteditor
Class KTextEditor.Command
Inherits

An Editor command line command.

Introduction

The Command class represents a command for the editor command line. A command simply consists of a string, for example find. To register a command use CommandInterface.registerCommand(). The Editor itself queries the command for a list of accepted strings/commands by calling cmds(). If the command gets invoked the function exec() is called, i.e. you have to implement the reaction in exec(). Whenever the user needs help for a command help() is called.

Command Information To provide reasonable information about a specific command there are the following accessor functions for a given command string: - name() returns a label - description() returns a descriptive text - category() returns a category into which the command fits.

These getters allow KTextEditor implementations to plug commands into menus and toolbars, so that a user can assign shortcuts.

Command Extensions

If your command needs to interactively react on changes while the user is typing text - look at the ifind command in Kate for example - you have to additionally derive your command from the class CommandExtension. The command extension provides methods to give help on flags or add a KCompletion object and process the typed text interactively.

See also KTextEditor.CommandInterface, KTextEditor.CommandExtension Author Christoph Cullmann \



methods