}
}
else {
button = createCommandButton(action);
if(context.hasChildren(context.getCurrentPath())) {
StructurePath path = context.getCurrentPath();
((JCommandButton)button).setPopupCallback(getPopupPanelCallBack(path, context));
((JCommandButton)button).setCommandButtonKind(CommandButtonKind.ACTION_AND_POPUP_MAIN_ACTION);
KeyStroke ks = context.getBuilder().getAcceleratorManager().getAccelerator(actionKey);
updateRichTooltip(button, action, ks);
updateActionState(action, button);
}
}
button.putClientProperty(ACTION_KEY_PROPERTY, action);
KeyStroke ks = context.getBuilder().getAcceleratorManager().getAccelerator(actionKey);
if(ks != null) {
button.putClientProperty(ACTION_ACCELERATOR, ks);
updateRichTooltip(button, action, ks);
}
getAccelChangeListener().addAction(actionKey, button);
builder.getMapChangeAdapter().addListener(new ActionChangeListener(action, button));
parent.addChild(button, childProps);
}
}
else {
final String name = attributes.getProperty("name");
if(name != null) {
AFreeplaneAction action = ActionUtils.getDummyAction(name);
final JCommandButton button = new JCommandButton(ActionUtils.getActionTitle(action), ActionUtils.getActionIcon(action));
button.putClientProperty(ACTION_NAME_PROPERTY, action);
updateRichTooltip(button, action, null);
if(context.hasChildren(context.getCurrentPath())) {
StructurePath path = context.getCurrentPath();
button.setPopupCallback(getPopupPanelCallBack(path, context));
button.setCommandButtonKind(CommandButtonKind.POPUP_ONLY);
}
button.setFocusable(false);
parent.addChild(button, childProps);