use of com.google.gwt.user.client.Timer in project che by eclipse.
the class Window method hide.
/**
* Hides the {@link Window} popup. The popup will animate out of view.
*/
public void hide() {
if (blocked) {
return;
}
if (!isShowing) {
return;
}
isShowing = false;
// Animate the popup out of existence.
view.setShowing(false);
// Remove the popup when the animation completes.
new Timer() {
@Override
public void run() {
if (blocked) {
return;
}
// The popup may have been shown before this timer executes.
if (!isShowing) {
view.removeFromParent();
Style style = view.contentContainer.getElement().getStyle();
style.clearPosition();
style.clearLeft();
style.clearTop();
}
}
}.schedule(view.getAnimationDuration());
}
use of com.google.gwt.user.client.Timer in project che by eclipse.
the class PopupLoaderImpl method setSuccess.
@Override
public void setSuccess() {
// Stop animation timer
playTimer.cancel();
// Start hide animation
getElement().addClassName("outDown");
// Remove from the parent
new Timer() {
@Override
public void run() {
removeFromParent();
}
}.schedule(1000);
}
use of com.google.gwt.user.client.Timer in project che by eclipse.
the class NewJavaSourceFileViewImpl method showDialog.
@Override
public void showDialog() {
nameField.setText("");
hideErrorHint();
show();
btnOk.setEnabled(false);
new Timer() {
@Override
public void run() {
nameField.setFocus(true);
}
}.schedule(300);
}
use of com.google.gwt.user.client.Timer in project che by eclipse.
the class MainPagePresenter method loadImporters.
private void loadImporters() {
final Map<String, Set<ProjectImporterDescriptor>> importersByCategory = new LinkedHashMap<>();
final Unmarshallable<ProjectImporterData> unmarshaller = dtoUnmarshallerFactory.newUnmarshaller(ProjectImporterData.class);
AsyncRequestCallback<ProjectImporterData> callback = new AsyncRequestCallback<ProjectImporterData>(unmarshaller) {
@Override
protected void onSuccess(ProjectImporterData data) {
List<ProjectImporterDescriptor> result = data.getImporters();
String defaultImporterId = data.getConfiguration().get(DEFAULT_PROJECT_IMPORTER);
Iterator<ProjectImporterDescriptor> itr = result.iterator();
while (itr.hasNext()) {
ProjectImporterDescriptor importer = itr.next();
if (importer.getId().equals(defaultImporterId)) {
Set<ProjectImporterDescriptor> importersSet = new LinkedHashSet<>();
importersSet.add(importer);
importersByCategory.put(importer.getCategory(), importersSet);
itr.remove();
}
}
ProjectImporterDescriptor defaultImporter = null;
for (ProjectImporterDescriptor importer : result) {
if (importer.isInternal() || importer.getCategory() == null || importWizardRegistry.getWizardRegistrar(importer.getId()) == null) {
continue;
}
if (importersByCategory.containsKey(importer.getCategory())) {
importersByCategory.get(importer.getCategory()).add(importer);
} else {
Set<ProjectImporterDescriptor> importersSet = new LinkedHashSet<>();
importersSet.add(importer);
importersByCategory.put(importer.getCategory(), importersSet);
}
if (importer.getId().equals(defaultImporterId)) {
defaultImporter = importer;
}
}
setImporters(defaultImporter);
}
private void setImporters(final ProjectImporterDescriptor defaultImporter) {
new Timer() {
@Override
public void run() {
view.setImporters(importersByCategory);
view.selectImporter(defaultImporter != null ? defaultImporter : importersByCategory.get(importersByCategory.keySet().iterator().next()).iterator().next());
}
}.schedule(300);
}
@Override
protected void onFailure(Throwable exception) {
notificationManager.notify(locale.failedToImportProject(), FAIL, FLOAT_MODE);
}
};
projectImportersService.getProjectImporters(appContext.getDevMachine(), callback);
}
use of com.google.gwt.user.client.Timer in project rstudio by rstudio.
the class ModalDialogBase method showModal.
public void showModal() {
if (mainWidget_ == null) {
mainWidget_ = createMainWidget();
// get the main widget to line up with the right edge of the buttons.
mainWidget_.getElement().getStyle().setMarginRight(2, Unit.PX);
mainPanel_.insert(mainWidget_, 0);
}
originallyActiveElement_ = DomUtils.getActiveElement();
if (originallyActiveElement_ != null)
originallyActiveElement_.blur();
// position the dialog
positionAndShowDialog(new Command() {
@Override
public void execute() {
// defer shown notification to allow all elements to render
// before attempting to interact w/ them programatically (e.g. setFocus)
Timer timer = new Timer() {
public void run() {
onDialogShown();
}
};
timer.schedule(100);
}
});
}
Aggregations