| 44 | Since this is a redesign task with critical priority, the design will be described briefly: |
| 45 | |
| 46 | == Naming convention == |
| 47 | * All enum classes that implement OperationDef should end in Logic. |
| 48 | * Examples: PlainTextLogic, ResourcePaletteLogic, etc. |
| 49 | * The name should be self-descriptive about what kind of operations this logic contains. |
| 50 | * Each operation should start with ON_ |
| 51 | * Then follows the user action that this operation handles. This should also be self-descriptive. |
| 52 | * Examples: ON_SET_SCREEN_MODE, ON_ADD_AUDIO_FRAME, etc. |
| 53 | * The EventIds enum should be an inner class of the class that fires the event when possible and should all be with the same name. |
| 54 | * The event ids themselves should clearly describe the operation they represent. |
| 55 | * It should be clear from how the event id is referred (via the wrapper class name) what event it represents. |
| 56 | * Examples: MainWindow.EventIds.SET_SCREEN_MODE, AllAnnotationsPalette.EventIds.IMPORT_ANNOTATIONS, etc. |
| 57 | * There might be some cases when these rules cannot be applied (e.g. TextEventIds) but this is the convention that we will try to follow. |
| 58 | |
| 59 | == Duplicate code == |
| 60 | The following places have been identified to contain unnecessary code: |
| 61 | * The clicked() method of the menu items. It should be made final, firing an event with a MenuItem.EventIds.CLICKED id. Subclasses do not need to override this method. |
| 62 | * The submitData() method of the bound controls. It should be made final, firing an event with a BoundControl.EventIds.SUBMIT id. Subclasses do not need to override this method. |
| 63 | * The situation is similar with the AlignElementsButton. Here's mitex's solution: |
| 64 | ---- |