Opened 13 years ago
Closed 13 years ago
#718 closed (fixed)
Menu items below View > Trash should be inactivated if they are empty
Reported by: | Gregory Vincic | Owned by: | olle |
---|---|---|---|
Milestone: | Proteios SE 2.14.0 | Keywords: | |
Cc: |
Description
Also if there is nothing in the trash, the main View -> Trash should be deactivated.
Change History (4)
comment:1 Changed 13 years ago by
Status: | new → assigned |
---|
comment:2 Changed 13 years ago by
Design discussion:
- The menu is managed by class
MainMenu
. - A leaf menu item in the Trash hierarchical menu (cascade menu) will have its action link disabled, if no items of the corresponding class have been marked as deleted. This will make the menu item being disabled and appear dimmed.
- If no items of the classes managed by the trash can have been marked as deleted, the root "Trash" menu item will be set to a dummy action link, that is later disabled. This will make the root menu item being disabled and appear dimmed. In this case the leaf nodes in hierarchical menu will therefore not be visible.
- In order to simplify finding the total number of items of the classes managed by the trash can that have been marked as deleted, code calculating this quantity will be moved from private method
Node createEmptyTrashNode()
to a new private convenience methodint getTotalNumberOfTrashItems()
.
comment:3 Changed 13 years ago by
(In [3967]) Refs #718. Class/file gui/MainMenu.java in client/servlet/ updated to disable uninteresting trash menu items:
- Private method
Node createViewTrashNode()
updated to call new
private method int getTotalNumberOfTrashItems()
to check if
any items exists in the trash can, in which case the "Trash"
menu node in the "View" drop-down menu is created as previously.
If the trash can is empty, the "Trash" menu node will be disabled
(achieved by coupling it to a dummy action link, that is disabled).
- Private method
<D extends BasicItem> Node createViewTrashItemNode( String tableName, Class<D> itemClass)
updated to disable action link to leaf menu node if no items of the
corresponding class have been marked as deleted.
- New private convenience method
int getTotalNumberOfTrashItems()
added. It returns the total number of items in the trash can.
comment:4 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The ticket is closed, as the desired functionality has been added. Should problems with the current solution appear, this ticket may be reopened, or a new ticket created.
Ticket accepted.