Search in sources :

Example 1 with Component

use of org.eclipse.che.ide.api.component.Component in project che by eclipse.

the class BootstrapController method startComponents.

private void startComponents(final Iterator<Map.Entry<String, Provider<Component>>> componentIterator) {
    if (componentIterator.hasNext()) {
        Map.Entry<String, Provider<Component>> entry = componentIterator.next();
        final String componentName = entry.getKey();
        try {
            Provider<Component> componentProvider = entry.getValue();
            final Component component = componentProvider.get();
            component.start(new Callback<Component, Exception>() {

                @Override
                public void onSuccess(Component result) {
                    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                        @Override
                        public void execute() {
                            startComponents(componentIterator);
                        }
                    });
                }

                @Override
                public void onFailure(Exception reason) {
                    Log.error(getClass(), "Unable to start " + componentName, reason);
                    initializationFailed(reason.getMessage());
                }
            });
        } catch (Exception e) {
            Log.error(getClass(), "Unable to start " + componentName, e);
            initializationFailed(e.getMessage());
        }
    } else {
        startExtensionsAndDisplayUI();
    }
}
Also used : ScheduledCommand(com.google.gwt.core.client.Scheduler.ScheduledCommand) WsAgentComponent(org.eclipse.che.ide.api.component.WsAgentComponent) Component(org.eclipse.che.ide.api.component.Component) Map(java.util.Map) TreeMap(java.util.TreeMap) SortedMap(java.util.SortedMap) OperationException(org.eclipse.che.api.promises.client.OperationException) Provider(com.google.inject.Provider)

Example 2 with Component

use of org.eclipse.che.ide.api.component.Component in project che by eclipse.

the class CoreGinModule method configure.

@Override
protected void configure() {
    install(new JsonRpcModule());
    install(new WebSocketModule());
    install(new ClientServerEventModule());
    install(new UiModule());
    install(new ClipboardModule());
    install(new EditorApiModule());
    install(new EditorPreferencesModule());
    install(new NotificationApiModule());
    install(new FileTypeApiModule());
    install(new ResourceApiModule());
    install(new ActionApiModule());
    install(new PartApiModule());
    install(new DebugApiModule());
    install(new ThemeApiModule());
    install(new PreferencesApiModule());
    install(new PersistenceApiModule());
    install(new MacroApiModule());
    install(new UserApiModule());
    install(new WorkspaceApiModule());
    install(new CommandApiModule());
    install(new ProjectApiModule());
    install(new ProjectImportModule());
    install(new OAuthApiModule());
    install(new FactoryApiModule());
    // configure miscellaneous core components
    bind(StandardComponentInitializer.class).in(Singleton.class);
    GinMapBinder<String, Component> componentsBinder = GinMapBinder.newMapBinder(binder(), String.class, Component.class);
    componentsBinder.addBinding("Standard components").to(StandardComponent.class);
    bind(DynaProvider.class).to(DynaProviderImpl.class);
    GinMapBinder.newMapBinder(binder(), String.class, FqnProvider.class);
    bind(EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
    //TODO: don't remove binding until not fix Codenvy and other packaging  
    bind(String.class).annotatedWith(RestContext.class).toProvider(RestContextProvider.class).in(Singleton.class);
    install(new GinFactoryModuleBuilder().build(LoaderFactory.class));
    install(new GinFactoryModuleBuilder().build(PopupLoaderFactory.class));
    bind(ExtensionRegistry.class).in(Singleton.class);
    bind(AppContext.class).to(AppContextImpl.class);
    install(new GinFactoryModuleBuilder().build(FindResultNodeFactory.class));
    // clients for the REST services
    bind(GitServiceClient.class).to(GitServiceClientImpl.class).in(Singleton.class);
    bind(SshServiceClient.class).to(SshServiceClientImpl.class).in(Singleton.class);
    bind(RecipeServiceClient.class).to(RecipeServiceClientImpl.class).in(Singleton.class);
    // IDE agents
    bind(SelectionAgent.class).to(SelectionAgentImpl.class).asEagerSingleton();
    bind(KeyBindingAgent.class).to(KeyBindingManager.class).in(Singleton.class);
    bind(WorkspaceAgent.class).to(WorkspacePresenter.class).in(Singleton.class);
    // Exec agent
    bind(ExecAgentCommandManager.class).to(JsonRpcExecAgentCommandManager.class);
    bind(ExecAgentEventManager.class).to(JsonRpcExecAgentEventManager.class);
    bind(ConnectedEventHandler.class).asEagerSingleton();
}
Also used : ActionApiModule(org.eclipse.che.ide.actions.ActionApiModule) DebugApiModule(org.eclipse.che.ide.debug.DebugApiModule) PreferencesApiModule(org.eclipse.che.ide.preferences.PreferencesApiModule) ConnectedEventHandler(org.eclipse.che.ide.api.machine.execagent.ConnectedEventHandler) ResourceApiModule(org.eclipse.che.ide.resources.ResourceApiModule) FileTypeApiModule(org.eclipse.che.ide.filetypes.FileTypeApiModule) PopupLoaderFactory(org.eclipse.che.ide.ui.loaders.PopupLoaderFactory) EditorPreferencesModule(org.eclipse.che.ide.editor.preferences.EditorPreferencesModule) ThemeApiModule(org.eclipse.che.ide.theme.ThemeApiModule) PersistenceApiModule(org.eclipse.che.ide.statepersistance.PersistenceApiModule) ExtensionRegistry(org.eclipse.che.ide.api.extension.ExtensionRegistry) GitServiceClientImpl(org.eclipse.che.ide.api.git.GitServiceClientImpl) SelectionAgentImpl(org.eclipse.che.ide.selection.SelectionAgentImpl) RecipeServiceClientImpl(org.eclipse.che.ide.api.machine.RecipeServiceClientImpl) ExecAgentEventManager(org.eclipse.che.ide.api.machine.ExecAgentEventManager) JsonRpcExecAgentEventManager(org.eclipse.che.ide.api.machine.execagent.JsonRpcExecAgentEventManager) MacroApiModule(org.eclipse.che.ide.macro.MacroApiModule) SshServiceClientImpl(org.eclipse.che.ide.api.ssh.SshServiceClientImpl) ProjectImportModule(org.eclipse.che.ide.projectimport.ProjectImportModule) Component(org.eclipse.che.ide.api.component.Component) FactoryApiModule(org.eclipse.che.ide.factory.FactoryApiModule) WorkspacePresenter(org.eclipse.che.ide.workspace.WorkspacePresenter) WorkspaceApiModule(org.eclipse.che.ide.workspace.WorkspaceApiModule) AppContext(org.eclipse.che.ide.api.app.AppContext) GinFactoryModuleBuilder(com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder) ProjectApiModule(org.eclipse.che.ide.project.ProjectApiModule) CommandApiModule(org.eclipse.che.ide.command.CommandApiModule) ClipboardModule(org.eclipse.che.ide.clipboard.ClipboardModule) OAuthApiModule(org.eclipse.che.ide.oauth.OAuthApiModule) PartApiModule(org.eclipse.che.ide.part.PartApiModule) NotificationApiModule(org.eclipse.che.ide.notification.NotificationApiModule) JsonRpcExecAgentCommandManager(org.eclipse.che.ide.api.machine.execagent.JsonRpcExecAgentCommandManager) ExecAgentCommandManager(org.eclipse.che.ide.api.machine.ExecAgentCommandManager) SimpleEventBus(com.google.web.bindery.event.shared.SimpleEventBus) RestContextProvider(org.eclipse.che.ide.rest.RestContextProvider) PopupLoaderFactory(org.eclipse.che.ide.ui.loaders.PopupLoaderFactory) LoaderFactory(org.eclipse.che.ide.ui.loaders.request.LoaderFactory) FindResultNodeFactory(org.eclipse.che.ide.search.factory.FindResultNodeFactory) KeyBindingManager(org.eclipse.che.ide.keybinding.KeyBindingManager) EditorApiModule(org.eclipse.che.ide.editor.EditorApiModule) DynaProvider(org.eclipse.che.providers.DynaProvider) UserApiModule(org.eclipse.che.ide.user.UserApiModule)

Example 3 with Component

use of org.eclipse.che.ide.api.component.Component in project che by eclipse.

the class UiModule method configure.

@Override
protected void configure() {
    bind(IconRegistry.class).to(IconRegistryImpl.class).in(Singleton.class);
    GinMapBinder<String, Component> componentsBinder = GinMapBinder.newMapBinder(binder(), String.class, Component.class);
    componentsBinder.addBinding("DefaultIconsComponent").to(DefaultIconsComponent.class);
    componentsBinder.addBinding("FontAwesomeInjector").to(FontAwesomeInjector.class);
    // core UI components
    install(new GinFactoryModuleBuilder().implement(WorkBenchPartController.class, WorkBenchPartControllerImpl.class).build(WorkBenchControllerFactory.class));
    bind(WorkspaceView.class).to(WorkspaceViewImpl.class).in(Singleton.class);
    bind(MainMenuView.class).to(MainMenuViewImpl.class).in(Singleton.class);
    bind(ToolbarView.class).to(ToolbarViewImpl.class);
    bind(ToolbarPresenter.class).annotatedWith(MainToolbar.class).to(ToolbarPresenter.class).in(Singleton.class);
    // dialog factory
    bind(MessageDialogFooter.class);
    bind(MessageDialogView.class).to(MessageDialogViewImpl.class);
    bind(ConfirmDialogFooter.class);
    bind(ConfirmDialogView.class).to(ConfirmDialogViewImpl.class);
    bind(ChoiceDialogFooter.class);
    bind(ChoiceDialogView.class).to(ChoiceDialogViewImpl.class);
    bind(InputDialogFooter.class);
    bind(InputDialogView.class).to(InputDialogViewImpl.class);
    install(new GinFactoryModuleBuilder().implement(MessageDialog.class, MessageDialogPresenter.class).implement(ConfirmDialog.class, ConfirmDialogPresenter.class).implement(ChoiceDialog.class, ChoiceDialogPresenter.class).implement(InputDialog.class, InputDialogPresenter.class).build(DialogFactory.class));
    // drop down list widget
    install(new GinFactoryModuleBuilder().implement(DropDownWidget.class, DropDownWidgetImpl.class).build(DropDownListFactory.class));
    // multi-split panel
    install(new GinFactoryModuleBuilder().implement(SubPanel.class, SubPanelPresenter.class).build(SubPanelFactory.class));
    install(new GinFactoryModuleBuilder().implement(SubPanelView.class, SubPanelViewImpl.class).build(SubPanelViewFactory.class));
    install(new GinFactoryModuleBuilder().implement(Tab.class, TabWidget.class).build(TabItemFactory.class));
    // miscellaneous UI components
    install(new GinFactoryModuleBuilder().implement(ConsoleButton.class, ConsoleButtonImpl.class).build(ConsoleButtonFactory.class));
    bind(StatusPanelGroupView.class).to(StatusPanelGroupViewImpl.class).in(Singleton.class);
}
Also used : IconRegistryImpl(org.eclipse.che.ide.icon.IconRegistryImpl) ToolbarPresenter(org.eclipse.che.ide.ui.toolbar.ToolbarPresenter) ChoiceDialogView(org.eclipse.che.ide.ui.dialogs.choice.ChoiceDialogView) ToolbarView(org.eclipse.che.ide.ui.toolbar.ToolbarView) ChoiceDialog(org.eclipse.che.ide.api.dialogs.ChoiceDialog) InputDialogView(org.eclipse.che.ide.ui.dialogs.input.InputDialogView) ConfirmDialogView(org.eclipse.che.ide.ui.dialogs.confirm.ConfirmDialogView) WorkspaceViewImpl(org.eclipse.che.ide.workspace.WorkspaceViewImpl) MessageDialog(org.eclipse.che.ide.api.dialogs.MessageDialog) DefaultIconsComponent(org.eclipse.che.ide.icon.DefaultIconsComponent) Component(org.eclipse.che.ide.api.component.Component) SubPanelViewFactory(org.eclipse.che.ide.ui.multisplitpanel.panel.SubPanelViewFactory) MessageDialogPresenter(org.eclipse.che.ide.ui.dialogs.message.MessageDialogPresenter) MessageDialogView(org.eclipse.che.ide.ui.dialogs.message.MessageDialogView) StatusPanelGroupViewImpl(org.eclipse.che.ide.menu.StatusPanelGroupViewImpl) SubPanelFactory(org.eclipse.che.ide.ui.multisplitpanel.SubPanelFactory) GinFactoryModuleBuilder(com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder) TabItemFactory(org.eclipse.che.ide.ui.multisplitpanel.tab.TabItemFactory) DialogFactory(org.eclipse.che.ide.api.dialogs.DialogFactory) DropDownListFactory(org.eclipse.che.ide.ui.dropdown.DropDownListFactory) WorkBenchControllerFactory(org.eclipse.che.ide.workspace.WorkBenchControllerFactory) ChoiceDialogPresenter(org.eclipse.che.ide.ui.dialogs.choice.ChoiceDialogPresenter) ConsoleButtonFactory(org.eclipse.che.ide.ui.button.ConsoleButtonFactory) MainMenuViewImpl(org.eclipse.che.ide.menu.MainMenuViewImpl)

Aggregations

Component (org.eclipse.che.ide.api.component.Component)3 GinFactoryModuleBuilder (com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder)2 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)1 Provider (com.google.inject.Provider)1 SimpleEventBus (com.google.web.bindery.event.shared.SimpleEventBus)1 Map (java.util.Map)1 SortedMap (java.util.SortedMap)1 TreeMap (java.util.TreeMap)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1 ActionApiModule (org.eclipse.che.ide.actions.ActionApiModule)1 AppContext (org.eclipse.che.ide.api.app.AppContext)1 WsAgentComponent (org.eclipse.che.ide.api.component.WsAgentComponent)1 ChoiceDialog (org.eclipse.che.ide.api.dialogs.ChoiceDialog)1 DialogFactory (org.eclipse.che.ide.api.dialogs.DialogFactory)1 MessageDialog (org.eclipse.che.ide.api.dialogs.MessageDialog)1 ExtensionRegistry (org.eclipse.che.ide.api.extension.ExtensionRegistry)1 GitServiceClientImpl (org.eclipse.che.ide.api.git.GitServiceClientImpl)1 ExecAgentCommandManager (org.eclipse.che.ide.api.machine.ExecAgentCommandManager)1 ExecAgentEventManager (org.eclipse.che.ide.api.machine.ExecAgentEventManager)1 RecipeServiceClientImpl (org.eclipse.che.ide.api.machine.RecipeServiceClientImpl)1