Skip to content

Commit

Permalink
CHE-1758 Display loading steps when booting ws from IDE
Browse files Browse the repository at this point in the history
Signed-off-by: Vitaliy Guliy <vguliy@codenvy.com>
  • Loading branch information
Vitaliy Guliy committed Sep 13, 2016
1 parent 94fcdbf commit b0fb135
Show file tree
Hide file tree
Showing 42 changed files with 761 additions and 1,135 deletions.
6 changes: 5 additions & 1 deletion assembly/assembly-ide-war/src/main/webapp/IDE.jsp
Expand Up @@ -53,9 +53,13 @@
window.alert("Unable to initialize IDE");
}
};
</script>

<script type="text/javascript" language="javascript" src="/_app/browserNotSupported.js"></script>
<script type="text/javascript" language="javascript" src="/_app/_app.nocache.js"></script>
<script type="text/javascript" language="javascript" async="true" src="/_app/_app.nocache.js"></script>
</head>

<body style="background-color: #21252b; transition: background-color 0.5s ease;" />

</html>
Expand Up @@ -28,8 +28,7 @@
import org.eclipse.che.ide.rest.AsyncRequestFactory;
import org.eclipse.che.ide.rest.RestServiceInfo;
import org.eclipse.che.ide.rest.StringUnmarshaller;
import org.eclipse.che.ide.ui.loaders.initialization.InitialLoadingInfo;
import org.eclipse.che.ide.ui.loaders.initialization.LoaderPresenter;
import org.eclipse.che.ide.ui.loaders.LoaderPresenter;
import org.eclipse.che.ide.util.loging.Log;
import org.eclipse.che.ide.websocket.MessageBus;
import org.eclipse.che.ide.websocket.MessageBusProvider;
Expand All @@ -39,16 +38,11 @@
import org.eclipse.che.ide.websocket.events.WebSocketClosedEvent;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static com.google.common.collect.Lists.newArrayList;
import static java.util.Collections.emptyList;
import static org.eclipse.che.ide.api.machine.WsAgentState.STARTED;
import static org.eclipse.che.ide.api.machine.WsAgentState.STOPPED;
import static org.eclipse.che.ide.ui.loaders.initialization.InitialLoadingInfo.Operations.WS_AGENT_BOOTING;
import static org.eclipse.che.ide.ui.loaders.initialization.OperationInfo.Status.IN_PROGRESS;
import static org.eclipse.che.ide.ui.loaders.initialization.OperationInfo.Status.SUCCESS;

/**
* @author Roman Nikitenko
Expand All @@ -59,10 +53,9 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti

private final EventBus eventBus;
private final MessageBusProvider messageBusProvider;
private final InitialLoadingInfo initialLoadingInfo;
private final LoaderPresenter loader;
private final AsyncRequestFactory asyncRequestFactory;
private DevMachine devMachine;
private final LoaderPresenter loader;

//not used now added it for future if it we will have possibility check that service available for client call
private final List<RestServiceInfo> availableServices;
Expand All @@ -74,22 +67,20 @@ public class WsAgentStateController implements ConnectionOpenedHandler, Connecti

@Inject
public WsAgentStateController(EventBus eventBus,
LoaderPresenter loader,
MessageBusProvider messageBusProvider,
AsyncRequestFactory asyncRequestFactory,
InitialLoadingInfo initialLoadingInfo) {
this.loader = loader;
LoaderPresenter loader) {
this.eventBus = eventBus;
this.messageBusProvider = messageBusProvider;
this.asyncRequestFactory = asyncRequestFactory;
this.initialLoadingInfo = initialLoadingInfo;
this.availableServices = new ArrayList<>();
this.loader = loader;
}

public void initialize(DevMachine devMachine) {
this.devMachine = devMachine;
this.state = STOPPED;
initialLoadingInfo.setOperationStatus(WS_AGENT_BOOTING.getValue(), IN_PROGRESS);
loader.setProgress(LoaderPresenter.Phase.STARTING_WORKSPACE_AGENT, LoaderPresenter.Status.LOADING);
checkHttpConnection();
}

Expand Down Expand Up @@ -128,8 +119,7 @@ public void run() {

private void started() {
state = STARTED;
initialLoadingInfo.setOperationStatus(WS_AGENT_BOOTING.getValue(), SUCCESS);
loader.hide();
loader.setProgress(LoaderPresenter.Phase.STARTING_WORKSPACE_AGENT, LoaderPresenter.Status.SUCCESS);

for (AsyncCallback<MessageBus> callback : messageBusCallbacks) {
callback.onSuccess(messageBus);
Expand Down Expand Up @@ -161,7 +151,6 @@ public void makeCall(AsyncCallback<MessageBus> callback) {
});
}


public Promise<DevMachine> getDevMachine() {
return AsyncPromiseHelper.createFromAsyncRequest(new AsyncPromiseHelper.RequestCall<DevMachine>() {
@Override
Expand All @@ -175,7 +164,6 @@ public void makeCall(AsyncCallback<DevMachine> callback) {
});
}


/**
* Goto checking HTTP connection via getting all registered REST Services
*/
Expand Down Expand Up @@ -234,4 +222,5 @@ private void checkWsConnection() {
messageBus.addOnErrorHandler(this);
messageBus.addOnOpenHandler(this);
}

}
Expand Up @@ -25,11 +25,14 @@
*/
public interface Perspective {

/** Restores editor parts state with saving of parts sizes. */
void expandParts();
/** Maximizes central part */
void maximizeCentralPart();

/** Hides editor parts. */
void collapseParts();
/** Maximizes bottom part */
void maximizeBottomPart();

/** Restores parts to their states before maximizing */
void restoreParts();

/** Store perspective state before changing. */
void storeState();
Expand Down
Expand Up @@ -29,6 +29,13 @@ public interface Theme {
*/
String getDescription();

/**
* Global background color.
*
* @return the color
*/
String backgroundColor();

/**
* return the logo color
*/
Expand Down Expand Up @@ -1519,4 +1526,14 @@ public interface Theme {
********************************************************************************************/
String resourceMonitorBarBackground();

/********************************************************************************************
*
* Popup Loader
*
********************************************************************************************/
String popupLoaderBackgroundColor();
String popupLoaderBorderColor();
String popupLoaderShadowColor();
String popupLoaderTitleColor();

}
Expand Up @@ -102,20 +102,22 @@ public void onMouseOver(MouseOverEvent event) {
* Expands or restores the editor.
*/
public void toggleExpand() {
Perspective activePerspective = perspectiveManager.getActivePerspective();
if (activePerspective != null) {
expanded = !expanded;

if (expanded) {
activePerspective.collapseParts();
if (button != null) {
button.getElement().setInnerHTML(FontAwesome.COMPRESS);
}
} else {
activePerspective.expandParts();
if (button != null) {
button.getElement().setInnerHTML(FontAwesome.EXPAND);
}
Perspective perspective = perspectiveManager.getActivePerspective();
if (perspective == null) {
return;
}

expanded = !expanded;

if (expanded) {
perspective.maximizeCentralPart();
if (button != null) {
button.getElement().setInnerHTML(FontAwesome.COMPRESS);
}
} else {
perspective.restoreParts();
if (button != null) {
button.getElement().setInnerHTML(FontAwesome.EXPAND);
}
}
}
Expand Down

This file was deleted.

Expand Up @@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.che.ide.client;

import elemental.client.Browser;
import com.google.gwt.dom.client.Document;

import com.google.gwt.core.client.Callback;
import com.google.gwt.core.client.Scheduler;
Expand All @@ -37,6 +37,7 @@
import org.eclipse.che.ide.api.machine.DevMachine;
import org.eclipse.che.ide.api.machine.WsAgentStateController;
import org.eclipse.che.ide.api.machine.WsAgentURLModifier;
import org.eclipse.che.ide.api.theme.Style;
import org.eclipse.che.ide.api.workspace.WorkspaceServiceClient;
import org.eclipse.che.ide.api.workspace.event.WorkspaceStartedEvent;
import org.eclipse.che.ide.context.AppContextImpl;
Expand Down Expand Up @@ -171,6 +172,11 @@ public void onFailure(Exception reason) {
}

private void startExtensionsAndDisplayUI() {
// Change background color according to the current theme
if (Style.theme != null) {
Document.get().getBody().getStyle().setBackgroundColor(Style.theme.backgroundColor());
}

appStateManagerProvider.get();

extensionInitializer.startExtensions();
Expand Down Expand Up @@ -212,8 +218,6 @@ public void onClose(CloseEvent<Window> event) {
}
});

elemental.html.Window window = Browser.getWindow();

Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
Expand Down
Expand Up @@ -64,6 +64,7 @@
import org.eclipse.che.ide.api.machine.MachineServiceClientImpl;
import org.eclipse.che.ide.api.machine.RecipeServiceClient;
import org.eclipse.che.ide.api.machine.RecipeServiceClientImpl;
import org.eclipse.che.ide.ui.loaders.PopupLoaderFactory;
import org.eclipse.che.ide.api.notification.NotificationManager;
import org.eclipse.che.ide.api.oauth.OAuth2Authenticator;
import org.eclipse.che.ide.api.oauth.OAuth2AuthenticatorRegistry;
Expand Down Expand Up @@ -237,8 +238,6 @@
import org.eclipse.che.ide.ui.dropdown.DropDownListFactory;
import org.eclipse.che.ide.ui.dropdown.DropDownWidget;
import org.eclipse.che.ide.ui.dropdown.DropDownWidgetImpl;
import org.eclipse.che.ide.ui.loaders.initialization.LoaderView;
import org.eclipse.che.ide.ui.loaders.initialization.LoaderViewImpl;
import org.eclipse.che.ide.ui.loaders.request.LoaderFactory;
import org.eclipse.che.ide.ui.multisplitpanel.SubPanel;
import org.eclipse.che.ide.ui.multisplitpanel.SubPanelFactory;
Expand Down Expand Up @@ -322,6 +321,8 @@ protected void configure() {

bind(AppContext.class).to(AppContextImpl.class);

install(new GinFactoryModuleBuilder().build(PopupLoaderFactory.class));

install(new GinFactoryModuleBuilder().build(LoaderFactory.class));
install(new GinFactoryModuleBuilder().implement(PartStackView.class, PartStackViewImpl.class).build(PartStackViewFactory.class));
install(new GinFactoryModuleBuilder().implement(PartStack.class, PartStackPresenter.class).build(PartStackPresenterFactory.class));
Expand Down Expand Up @@ -569,8 +570,6 @@ protected void configureCoreUI() {
bind(AppearanceView.class).to(AppearanceViewImpl.class).in(Singleton.class);
bind(FindActionView.class).to(FindActionViewImpl.class).in(Singleton.class);

bind(LoaderView.class).to(LoaderViewImpl.class).in(Singleton.class);

bind(HotKeysDialogView.class).to(HotKeysDialogViewImpl.class).in(Singleton.class);

bind(RecentFileList.class).to(RecentFileStore.class).in(Singleton.class);
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.eclipse.che.ide.actions.GoIntoAction;
import org.eclipse.che.ide.actions.HotKeysListAction;
import org.eclipse.che.ide.actions.ImportProjectAction;
import org.eclipse.che.ide.actions.LoaderAction;
import org.eclipse.che.ide.actions.NavigateToFileAction;
import org.eclipse.che.ide.actions.OpenFileAction;
import org.eclipse.che.ide.actions.ProjectConfigurationAction;
Expand Down Expand Up @@ -264,9 +263,6 @@ public interface ParserResource extends ClientBundle {
@Inject
private SwitchNextEditorAction switchNextEditorAction;

@Inject
private LoaderAction loaderAction;

@Inject
private HotKeysListAction hotKeysListAction;

Expand Down Expand Up @@ -627,12 +623,6 @@ public void initialize() {
actionManager.registerAction("splitHorizontally", splitHorizontallyAction);
editorTabContextMenu.add(splitHorizontallyAction);

final DefaultActionGroup loaderToolbarGroup = new DefaultActionGroup("loader", false, actionManager);
actionManager.registerAction("loader", loaderToolbarGroup);
actionManager.registerAction("loaderAction", loaderAction);
centerToolbarGroup.add(loaderToolbarGroup);
loaderToolbarGroup.add(loaderAction);

actionManager.registerAction("noOpAction", new NoOpAction());

// Define hot-keys
Expand Down

0 comments on commit b0fb135

Please sign in to comment.