use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.
the class MachineExtension method prepareActions.
@Inject
private void prepareActions(MachineLocalizationConstant localizationConstant, ActionManager actionManager, KeyBindingAgent keyBinding, ExecuteSelectedCommandAction executeSelectedCommandAction, SelectCommandComboBox selectCommandAction, EditCommandsAction editCommandsAction, StopWorkspaceAction stopWorkspaceAction, SwitchPerspectiveAction switchPerspectiveAction, RunCommandAction runCommandAction, NewTerminalAction newTerminalAction, EditTargetsAction editTargetsAction, IconRegistry iconRegistry, MachineResources machineResources, ReRunProcessAction reRunProcessAction, StopProcessAction stopProcessAction, CloseConsoleAction closeConsoleAction, ShowConsoleTreeAction showConsoleTreeAction) {
final DefaultActionGroup workspaceMenu = (DefaultActionGroup) actionManager.getAction(GROUP_WORKSPACE);
final DefaultActionGroup runMenu = (DefaultActionGroup) actionManager.getAction(GROUP_RUN);
// register actions
actionManager.registerAction("editCommands", editCommandsAction);
actionManager.registerAction("selectCommandAction", selectCommandAction);
actionManager.registerAction("executeSelectedCommand", executeSelectedCommandAction);
actionManager.registerAction("editTargets", editTargetsAction);
actionManager.registerAction("stopWorkspace", stopWorkspaceAction);
actionManager.registerAction("runCommand", runCommandAction);
actionManager.registerAction("newTerminal", newTerminalAction);
// add actions in main menu
runMenu.add(newTerminalAction, FIRST);
runMenu.addSeparator();
runMenu.add(editCommandsAction);
runMenu.add(editTargetsAction);
workspaceMenu.add(stopWorkspaceAction);
if (centralToolbarVisible) {
// add actions on center part of toolbar
final DefaultActionGroup centerToolbarGroup = (DefaultActionGroup) actionManager.getAction(GROUP_CENTER_TOOLBAR);
final DefaultActionGroup machineToolbarGroup = new DefaultActionGroup(GROUP_MACHINE_TOOLBAR, false, actionManager);
actionManager.registerAction(GROUP_MACHINE_TOOLBAR, machineToolbarGroup);
centerToolbarGroup.add(machineToolbarGroup, FIRST);
machineToolbarGroup.add(selectCommandAction);
final DefaultActionGroup executeToolbarGroup = new DefaultActionGroup(actionManager);
executeToolbarGroup.add(executeSelectedCommandAction);
machineToolbarGroup.add(executeToolbarGroup);
}
// add group for list of machines
final DefaultActionGroup machinesList = new DefaultActionGroup(GROUP_MACHINES_DROPDOWN, true, actionManager);
actionManager.registerAction(GROUP_MACHINES_LIST, machinesList);
machinesList.add(editTargetsAction, FIRST);
// add group for list of commands
final DefaultActionGroup commandList = new DefaultActionGroup(GROUP_COMMANDS_DROPDOWN, true, actionManager);
actionManager.registerAction(GROUP_COMMANDS_LIST, commandList);
commandList.add(editCommandsAction, FIRST);
// Consoles tree context menu group
DefaultActionGroup consolesTreeContextMenu = (DefaultActionGroup) actionManager.getAction(GROUP_CONSOLES_TREE_CONTEXT_MENU);
consolesTreeContextMenu.add(reRunProcessAction);
consolesTreeContextMenu.add(stopProcessAction);
consolesTreeContextMenu.add(closeConsoleAction);
DefaultActionGroup partMenuGroup = (DefaultActionGroup) actionManager.getAction(IdeActions.GROUP_PART_MENU);
partMenuGroup.add(showConsoleTreeAction);
// Define hot-keys
keyBinding.getGlobal().addKey(new KeyBuilder().alt().charCode(KeyCodeMap.F12).build(), "newTerminal");
iconRegistry.registerIcon(new Icon("che.machine.icon", machineResources.devMachine()));
}
use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.
the class PhpExtension method prepareActions.
@Inject
private void prepareActions(CreatePhpSourceFileAction phpSourceFileAction, ActionManager actionManager, PhpResources resources, IconRegistry iconRegistry) {
DefaultActionGroup newGroup = (DefaultActionGroup) actionManager.getAction(GROUP_FILE_NEW);
actionManager.registerAction("newPhpFile", phpSourceFileAction);
newGroup.add(phpSourceFileAction, Constraints.FIRST);
iconRegistry.registerIcon(new Icon(PHP_CATEGORY + ".samples.category.icon", resources.category()));
}
use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.
the class NativeAccessExampleExtension method configureActions.
@Inject
private void configureActions(final ActionManager actionManager, final RunNativeCommandAction runNativenCommandAction) {
DefaultActionGroup mainContextMenuGroup = (DefaultActionGroup) actionManager.getAction("resourceOperation");
DefaultActionGroup naGroup = new DefaultActionGroup("Native Access Example", true, actionManager);
mainContextMenuGroup.add(naGroup);
actionManager.registerAction(runNativenCommandAction.ACTION_ID, runNativenCommandAction);
naGroup.addAction(runNativenCommandAction);
}
use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.
the class SampleWizardExtension method prepareActions.
@Inject
private void prepareActions(SampleAction sampleAction, NewXFileAction newXFileAction, ActionManager actionManager) {
DefaultActionGroup newGroup = (DefaultActionGroup) actionManager.getAction(GROUP_HELP);
DefaultActionGroup newFileGroup = (DefaultActionGroup) actionManager.getAction(GROUP_FILE_NEW);
actionManager.registerAction("sayHello", sampleAction);
actionManager.registerAction("newFileActon", newXFileAction);
newGroup.add(sampleAction, Constraints.FIRST);
newFileGroup.add(newXFileAction, Constraints.FIRST);
}
use of org.eclipse.che.ide.api.action.DefaultActionGroup in project che by eclipse.
the class HelloWorldViewExampleExtension method configureActions.
@Inject
private void configureActions(final ActionManager actionManager, final HelloWorldAction helloWorldAction) {
DefaultActionGroup mainContextMenuGroup = (DefaultActionGroup) actionManager.getAction("resourceOperation");
DefaultActionGroup jsGroup = new DefaultActionGroup("JavaScript View Example", true, actionManager);
mainContextMenuGroup.add(jsGroup);
actionManager.registerAction(helloWorldAction.ACTION_ID, helloWorldAction);
jsGroup.addAction(helloWorldAction);
}
Aggregations