close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2110

Table Of Contents

4.8 Program Own Commands

In this chapter, you will learn how to extend the Site Manager with buttons and menu entries which call commands on the current selection. A command is called with a target as a parameter and it executes an operation on this target following the Command Pattern. Therefore, you need to register your command at a CommandManager.

Interface to implement

All commands implement the Command interface. You need to implement (or overwrite) the execute and the isExecutable methods. The execute method gets the Context and target as parameters (see Editor API for details).

Classes to subclass

There are a different predefined commands for different tasks. You can subclass each of them (or its subclasses) for your needs. Please refer to the Editor API for details.

Name Description
CommandSequence A command which consists of a sequence of simple commands.
CreateProcessInstance A command which creates a new WfProcessInstance from a WfProcess.
EnumerationCommand A command which operations on enumerations and executes the given Command.
GlobalCommand A GlobalCommand works on global, that is, application wide targets. It provides convenience methods to allow small and simple Commands.
MapCommand A generic command which works on a map.
ResourceCommand A command which works on resources.
ResourceEnumerationCommand A command which works on a set of resources.
ResourceHolderCommand A command which works on resource holders.
SearchText A command which searches for the text in text components.
StringSelectionCommand A command which acts on string selections.
TextActionCommand A command which bridges from commands to actions on text components.
WfInstanceCommand A command which works on a WfInstance.

Table 4.6. Commands to subclass from


Integrate your command into the Site Manager using editor.xml

There are no elements in the editor.xml to integrate the commands directly. You need to subclass an editor or view class.

  • Integrate the command into the document view

  • In this case you need to extend the hox.corem.editor.generic.GenericDocumentView class. The class can be added to the editor.xml file using the attribute viewClass of the element Document. See Section 4.8.3, “Add Command to Document View” for an example.

  • Integrate the command into the explorer view

  • You simply need to set your own explorer view using the attribute explorerViewClass of the element FrameFactory in the editor.xml file. See Section 4.8.4, “Add Command to Explorer View” for an example.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.