List<IHookCommand> commandsList = h.getCommandsList();
int nbCommands = 0;
if (commandsList != null) {
nbCommands = commandsList.size();
for (int k = 0; k < nbCommands; k++) {
IHookCommand hc = commandsList.get(k);
boolean selected = (myContains(commandsSelected, hc));
view.addCommand(i, k, hc.getCommand());
((HookCommandModel) hc).addListener(hookCommandsActionListener);
view.setSelectedCommand(i, k, selected);
}
}