Search in sources :

Example 1 with MenuCommand

use of com.haulmont.cuba.gui.config.MenuCommand in project cuba by cuba-platform.

the class MenuBuilder method assignCommand.

private void assignCommand(final JMenuItem jMenuItem, MenuItem item) {
    final MenuCommand command = new MenuCommand(item);
    jMenuItem.addActionListener(new ValidationAwareActionListener() {

        @Override
        public void actionPerformedAfterValidation(ActionEvent e) {
            command.execute();
            StringBuilder menuPath = new StringBuilder();
            formatMenuPath(item, menuPath);
            userActionsLog.trace("Action \"{}\" was performed using menu item {}", command.getCommandDescription(), menuPath.toString());
        }
    });
}
Also used : ValidationAwareActionListener(com.haulmont.cuba.desktop.sys.validation.ValidationAwareActionListener) ActionEvent(java.awt.event.ActionEvent) MenuCommand(com.haulmont.cuba.gui.config.MenuCommand)

Aggregations

ValidationAwareActionListener (com.haulmont.cuba.desktop.sys.validation.ValidationAwareActionListener)1 MenuCommand (com.haulmont.cuba.gui.config.MenuCommand)1 ActionEvent (java.awt.event.ActionEvent)1