Search in sources :

Example 1 with Timer

use of com.google.gwt.user.client.Timer in project che by eclipse.

the class WorkspaceEventsHandler method onWorkspaceStarting.

private void onWorkspaceStarting(final String workspaceId) {
    // TODO timer is a workaround. Is needed because for some reason after receiving of event workspace starting
    // get workspace event should contain runtime but it doesn't
    new Timer() {

        @Override
        public void run() {
            workspaceServiceClient.getWorkspace(workspaceId).then(new Operation<WorkspaceDto>() {

                @Override
                public void apply(WorkspaceDto workspace) throws OperationException {
                    String devMachineName = getDevMachineName(workspace);
                    if (devMachineName != null) {
                        subscribeOnWsAgentOutputChannel(workspace, devMachineName);
                    }
                    workspaceComponent.setCurrentWorkspace(workspace);
                    loader.show(LoaderPresenter.Phase.STARTING_WORKSPACE_RUNTIME);
                    eventBus.fireEvent(new WorkspaceStartingEvent(workspace));
                }
            });
        }
    }.schedule(1000);
}
Also used : Timer(com.google.gwt.user.client.Timer) WorkspaceDto(org.eclipse.che.api.workspace.shared.dto.WorkspaceDto) Operation(org.eclipse.che.api.promises.client.Operation) WorkspaceStartingEvent(org.eclipse.che.ide.api.workspace.event.WorkspaceStartingEvent)

Example 2 with Timer

use of com.google.gwt.user.client.Timer in project che by eclipse.

the class PopupWidget method hide.

/** Hide the popup. */
public void hide() {
    // restore previous focus state
    if (previousFocus != null) {
        previousFocus.focus();
        previousFocus = null;
    }
    popupElement.getStyle().setOpacity(0);
    new Timer() {

        @Override
        public void run() {
            if (popupElement != null) {
                // detach assist popup
                popupElement.getParentNode().removeChild(popupElement);
                popupElement = null;
            }
            // remove all items from popup element
            listElement.setInnerHTML("");
        }
    }.schedule(250);
    // remove the keyboard listener
    listElement.removeEventListener(Event.KEYDOWN, keyboardListener, false);
    // remove the mouse listener
    Elements.getDocument().removeEventListener(Event.MOUSEDOWN, popupListener);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Example 3 with Timer

use of com.google.gwt.user.client.Timer in project che by eclipse.

the class InputDialogViewImpl method show.

@Override
public void show() {
    super.show();
    value.setSelectionRange(selectionStartIndex, selectionLength);
    new Timer() {

        @Override
        public void run() {
            value.setFocus(true);
        }
    }.schedule(300);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Example 4 with Timer

use of com.google.gwt.user.client.Timer in project che by eclipse.

the class RenameViewImpl method show.

/** {@inheritDoc} */
@Override
public void show() {
    newName.getElement().setAttribute("spellcheck", "false");
    newName.addStyleName(javaResources.css().errorBorder());
    updateDelegateUpdating.setValue(false);
    updateMarkDeprecated.setValue(false);
    updateMarkDeprecated.setEnabled(false);
    super.show();
    new Timer() {

        @Override
        public void run() {
            setFocus();
        }
    }.schedule(100);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Example 5 with Timer

use of com.google.gwt.user.client.Timer in project che by eclipse.

the class NewXFileViewImpl method showDialog.

@Override
public void showDialog() {
    nameField.setText("");
    headerField.setText("");
    show();
    new Timer() {

        @Override
        public void run() {
            nameField.setFocus(true);
        }
    }.schedule(300);
}
Also used : Timer(com.google.gwt.user.client.Timer)

Aggregations

Timer (com.google.gwt.user.client.Timer)133 Command (com.google.gwt.user.client.Command)7 Element (com.google.gwt.dom.client.Element)6 ScheduledCommand (com.google.gwt.core.client.Scheduler.ScheduledCommand)4 Style (com.google.gwt.dom.client.Style)4 Request (com.google.gwt.http.client.Request)4 RequestBuilder (com.google.gwt.http.client.RequestBuilder)4 RequestCallback (com.google.gwt.http.client.RequestCallback)4 RequestException (com.google.gwt.http.client.RequestException)4 Response (com.google.gwt.http.client.Response)4 JSONString (com.google.gwt.json.client.JSONString)4 Widget (com.google.gwt.user.client.ui.Widget)4 ArrayList (java.util.ArrayList)4 ServerError (org.rstudio.studio.client.server.ServerError)4 Label (com.google.gwt.user.client.ui.Label)3 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)3 Date (java.util.Date)3 SessionInfo (org.rstudio.studio.client.workbench.model.SessionInfo)3 SliderEvent (com.extjs.gxt.ui.client.event.SliderEvent)2 Animation (com.google.gwt.animation.client.Animation)2