3D PLM Enterprise Architecture |
Webtop |
Creating a Workshop for a CATletThe declaration of commands of a CATlet in the Portal |
Technical Article |
AbstractThis article presents the Workshop structure and how to associate Commands to a CATlet in the Portal. |
The Workshop is a command organizer associated to a CATlet. Commands of a CATlet can appear in many places like in a toolbar, a contextual menu or a menu bar. They can also be grouped in different categories. All this is described in a Workshop description file which will be represented at runtime by a Workshop object. The Workshop object is a sort of hierarchical representation of the way the Commands are placed inside the CATlet.
[Top]
The Workshop describes all the commands of a CATlet, their graphical representations, and their location (menu bar, toolbar or contextual menu) in the CATlet.
Each command is described by its class name, its associated Command Header, its icon representation (for toolbar) and its container location (See how to program command and headers in the Portal [1]). A command can be added in 6 different containers which are the Menu bar, the (right, left, top and bottom) toolbar, and the contextual menu. Each container of command is described as a list of command and sub command container.
[Top]
The Workshop description file is a java properties file structured by predefined keywords and made of three master parts. The first part is a short description of the Workshop which contains the identity name , the title, the internationalization file, the pointers to each containers and the default command of the Workshop. The second part is a description of each command with their associated header, icons, and their representation class. The third part is the chained description of each command container.
The header Description of the Workshop:
CATWorkshop | The id of the Workshop which will be used in the file (mandatory) |
Title | The NLS name of the Workshop (mandatory) |
ResourceFile | The internationalization file which will be used by the Workshop |
TopToolbar | The top toolbar container displayed at the north of the CATlet. |
BottomToolbar | The bottom toolbar container displayed at the south of the CATlet. |
LeftToolbar | The left toolbar container displayed at the west of the CATlet |
RightToolbar | The right toolbar container displayed at the east of the CATlet |
Menubar | The menu bar container displayed at the north of the CATlet |
ContextualMenu | The contextual menu container |
DefaultHeader | The default command to start. |
A sample of header workshop:
CATWorkshop=CAAWorkshop CAAWorkshop.Title=MyCAACATlet CAAWorkshop.ResourceFile=basewidgets CAAWorkshop.BottomToolbar=BottomBar CAAWorkshop.RightToolbar=RightBar CAAWorkshop.ContextualMenu=CtxMenu CAAWorkshop.DefaultHeader=HeaderSelect |
The Command Header Description for a Command
CommandClass | The class name of the command (mandatory) |
Classname | The class name of the specific header associated to this command |
UserArgument | A string argument set to the header which can be called by the command class |
Icon | The file name of the icon associated to the command (which overrides the icon returned by the Command BeanInfo) |
IconFocus | The file name of the icon associated to the command when its representation has the focus |
IsVisible | The state visibility of the command. If not specified, the command is visible. |
ToolbarRepClass | The class name of the specific representation in a toolbar (the default is a round image button) |
MenuRepClass | The class name of the specific representation in a menu bar |
CtxMenuRepClass | The class name of the specific representation in a contextual menu |
A sample of command description in a Workshop file:
Headerxx.CommandClass=com.dassault_systemes.catweb.base.catlet.command.PropertiesCommand Headerxx.Icon=Resources/I_OptionsCATlet.gif Headerxx.IconFocus=Resources/IF_OptionsCATlet.gif |
The Description of the Chained Command Representation Container
A container of command is made of sub containers and commands.
Type | The type of the object : container, separator or command. Possible values are CmdContainer, CmdStarter and CmdSeparator (mandatory) |
Title | The NLS name of the container (mandatory) |
Child | The pointer to the first sub container. Used for container type only |
Next | The pointer to the next container |
Header | The pointer to the command header description (described in part 2). Used for command type only |
Accelerator | The accelerator keys for invoking the command. Used for
command type only. The accelerator key is described by the modifier name (control, shift, ..) followed by the name of the key in KeyEvent without "VK_" ( X, DELETE, ...) |
ToolbarRepClass | The class name of the specific representation of the toolbar. Used for container and separator type |
MenuRepClass | The class name of the specific representation of the a menu bar. Used for container and separator type |
CtxMenuRepClass | The class name of the specific representation of the contextual menu. Used for container and separator type |
PlaceBeforeMenu | The name of the menu that will be displayed after the current one. Used for container type only |
PlaceBeforeItem | The name of the menu item that will be displayed after the current one. |
A sample of chained command declaration:
... # --- Right toolbar container declaration --- RightBar.Type = CmdContainer RightBar.Title = Viewpoint Commands RightBar.Child = StarterZoomIn StarterZoomIn.Type = CmdStarter StarterZoomIn.Header = HeaderZoomIn StarterZoomIn.Accelerator = control PAGE_UP StarterZoomIn.Next = StarterZoomOut StarterZoomOut.Type = CmdStarter StarterZoomOut.Header = HeaderZoomOut StarterZoomOut.Accelerator = control PAGE_DOWN StarterZoomOut.Next = StarterReframe StarterReframe.Type = CmdStarter StarterReframe.Header = HeaderReframe # --- Contextual menu container declaration --- CtxMenu.Type = CmdContainer CtxMenu.Title = Manipulator CtxMenu.Child = StarterRotate StarterRotate.Type = CmdStarter StarterRotate.Title = Rotate StarterRotate.Header= HeaderRotate StarterRotate.Next = StarterTranslate StarterTranslate.Type = CmdStarter StarterTranslate.Title = Translate StarterTranslate.Header= HeaderTranslate StarterTranslate.Next = StarterReframeCtx StarterReframeCtx.Type = CmdStarter StarterReframeCtx.Title = Reframe StarterReframeCtx.Header= HeaderReframe StarterReframeCtx.Next = ViewpointContainer ViewpointContainer.Type = CmdContainer ViewpointContainer.Title = Viewpoints ViewpointContainer.Child = StarterPrevious StarterPrevious.Type = CmdStarter StarterPrevious.Title = Previous StarterPrevious.Header= HeaderPrevious StarterPrevious.Accelerator = alt LEFT StarterPrevious.Next = StarterNext StarterNext.Type = CmdStarter StarterNext.Title = Next StarterNext.Header = HeaderNext StarterNext.Accelerator = alt RIGHT ... |
[Top]
The association of a Workshop with a CATlet is made in the file CATletList.xml , which contains the declaration of all the CATlet recognized by the Portal (See How to declare a CATlet in the Portal [2]). The Workshop file is associated to the CATlet with the tag workshop in the CATlet tag.
<?xml version="1.0" encoding="UTF-8"?> <CATletList> <BrowserCATlets> ... </BrowserCATlets> <ViewerCATlets> <CATlet icon="Resources/I_Wk13.gif" label="Food_store" workshop="FoodStoreCATlet.workshop" url="bean://com.dassault_systemes.japplicationframe.caa.catlet.FoodStoreCATlet"> </CATlet> ... </ViewerCATlets> </CATletList> |
[Top]
[1] | How to Program Commands and Headers in the Portal |
[2] | How to Declare a CATlet in the Portal |
[Top] |
Version: 1 [Sep 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.