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();
}
}
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();
}
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);
}
Aggregations