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