• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RunAsyncCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.gwt.core.client.RunAsyncCallback的典型用法代码示例。如果您正苦于以下问题:Java RunAsyncCallback类的具体用法?Java RunAsyncCallback怎么用?Java RunAsyncCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RunAsyncCallback类属于com.google.gwt.core.client包,在下文中一共展示了RunAsyncCallback类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initPageAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public void initPageAsync(final String page) {
	GWT.runAsync(new RunAsyncCallback() {
		public void onSuccess() {
			init(page);
			LoadingWidget.getInstance().hide();
		}
		public void onFailure(Throwable reason) {
			Label error = new Label(MESSAGES.failedToLoadPage(reason.getMessage()));
			error.setStyleName("unitime-ErrorMessage");
			RootPanel loading = RootPanel.get("UniTimeGWT:Loading");
			if (loading != null) loading.setVisible(false);
			RootPanel.get("UniTimeGWT:Body").add(error);
			LoadingWidget.getInstance().hide();
			UniTimeNotifications.error(MESSAGES.failedToLoadPage(reason.getMessage()), reason);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:18,代码来源:Client.java


示例2: init

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
private void init() {
       logger.info("Init...");

	addMetaElements();

	// Disable Back Button
	setupHistory();
	setupBootbox();

	GWT.runAsync(new RunAsyncCallback() {
		@Override
		public void onFailure(Throwable reason) {
			logger.info("Error on Async!");
		}

		@Override
		public void onSuccess() {
			createViews();
			removeLoadingImage();

               // Example calling JavaScript with JSNI - old style
               // alert("Lofi Old Style...");
		}
	});
}
 
开发者ID:interseroh,项目名称:demo-gwt-springboot,代码行数:26,代码来源:DemoGwtWebApp.java


示例3: getClassesToImport

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
String[] getClassesToImport() {
  return new String[] { com.mvp4g.client.history.PlaceService.class.getName(),
                        GWT.class.getName(),
                        com.google.gwt.user.client.History.class.getName(),
                        ServiceDefTarget.class.getName(),
                        PresenterInterface.class.getName(),
                        EventBus.class.getName(),
                        Mvp4gException.class.getName(),
                        HistoryConverter.class.getName(),
                        Mvp4gEventPasser.class.getName(),
                        Mvp4gModule.class.getName(),
                        GinModules.class.getName(),
                        Ginjector.class.getName(),
                        BaseEventBus.class.getName(),
                        EventFilter.class.getName(),
                        EventHandlerInterface.class.getName(),
                        List.class.getName(),
                        NavigationEventCommand.class.getName(),
                        NavigationConfirmationInterface.class.getName(),
                        RunAsyncCallback.class.getName(),
                        Mvp4gRunAsync.class.getName(),
                        Command.class.getName(),
                        HistoryProxyProvider.class.getName(),
                        DefaultHistoryProxy.class.getName() };
}
 
开发者ID:mvp4g,项目名称:mvp4g,代码行数:26,代码来源:Mvp4gGenerator.java


示例4: loadTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void loadTests(final boolean forReal) {
  GWT.runAsync(JUnit4Runner.class, new RunAsyncCallback() {

    @Override
    public void onSuccess() {
      if (forReal) {
        displayTests();
        runTests();
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      X_Log.error(JUnitUi.class, "RunAsync Failed", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:18,代码来源:JUnitUi.java


示例5: loadTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void loadTests(final boolean forReal) {
  GWT.runAsync(JUnit4Executor.class, new RunAsyncCallback() {

    @Override
    public void onSuccess() {
      if (forReal) {
        displayTests();
        runTests();
      }
    }

    @Override
    public void onFailure(final Throwable reason) {

    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:18,代码来源:TestEntryPoint.java


示例6: addAnnotationTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void addAnnotationTests() {
  GWT.runAsync(AnnotationTests.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      magicClass(AnnotationTests.class);
      try {
        addTests(AnnotationTests.class);
      } catch (final Throwable e) {
        print("Error adding AnnotationTests", e);
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      print("Error loading AnnotationTests", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:19,代码来源:TestEntryPoint.java


示例7: addArrayTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void addArrayTests() {
  GWT.runAsync(ArrayTests.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      magicClass(ArrayTests.class);
      try {
        addTests(ArrayTests.class);
      } catch (final Throwable e) {
        print("Error adding ArrayTests", e);
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      print("Error loading ArrayTests", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:19,代码来源:TestEntryPoint.java


示例8: addConstructorTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void addConstructorTests() {
  GWT.runAsync(ConstructorTests.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      magicClass(ConstructorTests.class);
      try {
        addTests(ConstructorTests.class);
      } catch (final Throwable e) {
        print("Error adding ConstructorTests", e);
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      print("Error loading ConstructorTests", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:19,代码来源:TestEntryPoint.java


示例9: addFieldTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void addFieldTests() {
  GWT.runAsync(FieldTests.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      magicClass(FieldTests.class);
      try {
        addTests(FieldTests.class);
      } catch (final Throwable e) {
        print("Error adding FieldTests", e);
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      print("Error loading FieldTests", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:19,代码来源:TestEntryPoint.java


示例10: addMethodTests

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
protected void addMethodTests() {
  GWT.runAsync(MethodTests.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      magicClass(MethodTests.class).getMethods();
      try {
        addTests(MethodTests.class);
      } catch (final Throwable e) {
        print("Error adding MethodTests", e);
      }
    }

    @Override
    public void onFailure(final Throwable reason) {
      print("Error loading MethodTests", reason);
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:19,代码来源:TestEntryPoint.java


示例11: test

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public void test(Runnable onDone) {
  SplitPointTest.onDone = onDone;
  // start with a regular gwt code split, which forces all our code into split points
  // this makes it more difficult for the auto-generated code splitting to make clean cuts
  InstanceInterface instance = X_Inject.instance(InstanceInterface.class);
  instance.test();
  com.google.gwt.core.client.GWT.runAsync(X_Inject.class, new RunAsyncCallback() {
    @Override
    public void onSuccess() {
      X_Inject.singletonAsync(LogService.class, StartTest.class);
      X_Inject.singletonAsync(ImportTestInterface.class, ImportTestReceiver.class);
      X_Inject.singletonAsync(ImportTestInterface.class, ImportTestCallback.class);
      X_Inject.singletonAsync(ServiceTestInterface.class, ServiceTestCallback.class);
    }

    @Override
    public void onFailure(Throwable reason) {
    }
  });
}
 
开发者ID:WeTheInternet,项目名称:xapi,代码行数:21,代码来源:SplitPointTest.java


示例12: junitRunAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public static void junitRunAsync(final RunAsyncCallback callback)
{
    new Thread()
    {
        @Override
        public void run()
        {
            if (RUN_ASYNC_DELAY > 0)
            {
                try
                {
                    Thread.sleep(RUN_ASYNC_DELAY);
                }
                catch (InterruptedException e)
                {
                    LOG.error("Could not wait", e);
                }
            }
            callback.onSuccess();
        }
    }.start();

}
 
开发者ID:Doloops,项目名称:arondor-common-reflection,代码行数:24,代码来源:TestAsyncInstantiator.java


示例13: runAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
@Override
public void runAsync(AsyncTask asyncTask) {
    GWT.runAsync(new RunAsyncCallback() {
        @Override
        public void onFailure(Throwable reason) {
            asyncTask.onFailed(reason);
        }

        @Override
        public void onSuccess() {
            asyncTask.onSuccess();
        }
    });
}
 
开发者ID:GwtDomino,项目名称:domino,代码行数:15,代码来源:GwtAsyncRunner.java


示例14: onModuleLoadDeferred

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public void onModuleLoadDeferred() {
	// register triggers
	GWT.runAsync(new RunAsyncCallback() {
		@Override
		public void onSuccess() {
			for (Triggers t: Triggers.values())
				t.register();
			callGwtOnLoadIfExists();
		}
		@Override
		public void onFailure(Throwable reason) {
		}
	});
	
	// load page
	if (RootPanel.get("UniTimeGWT:Body") != null) {
		LoadingWidget.getInstance().show(MESSAGES.waitLoadingPage());
		Scheduler.get().scheduleDeferred(new ScheduledCommand() {
			@Override
			public void execute() {
				initPageAsync(Window.Location.getParameter("page"));
			}
		});
	}
	
	// load components
	for (final Components c: Components.values()) {
		final RootPanel p = RootPanel.get(c.id());
		if (p != null) {
			Scheduler.get().scheduleDeferred(new ScheduledCommand() {
				@Override
				public void execute() {
					initComponentAsync(p, c);
				}
			});
		}
		if (p == null && c.isMultiple()) {
			NodeList<Element> x = getElementsByName(c.id());
			if (x != null && x.getLength() > 0)
				for (int i = 0; i < x.getLength(); i++) {
					Element e = x.getItem(i);
					e.setId(DOM.createUniqueId());
					final RootPanel q = RootPanel.get(e.getId());
					Scheduler.get().scheduleDeferred(new ScheduledCommand() {
						@Override
						public void execute() {
							initComponentAsync(q, c);
						}
					});
				}
		}
	}
	
	Window.addWindowClosingHandler(new Window.ClosingHandler() {
		@Override
		public void onWindowClosing(Window.ClosingEvent event) {
			if (isLoadingDisplayed() || LoadingWidget.getInstance().isShowing()) return;
			LoadingWidget.showLoading(MESSAGES.waitPlease());
			iPageLoadingTimer = new Timer() {
				@Override
				public void run() {
					RPC.execute(new IsSessionBusyRpcRequest(), new AsyncCallback<GwtRpcResponseBoolean>() {
						@Override
						public void onFailure(Throwable caught) {
							LoadingWidget.hideLoading();
						}
						@Override
						public void onSuccess(GwtRpcResponseBoolean result) {
							if (result.getValue()) {
								iPageLoadingTimer.schedule(500);
							} else {
								LoadingWidget.hideLoading();
							}
						}
					});
				}
			};
			iPageLoadingTimer.schedule(500);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:82,代码来源:Client.java


示例15: initComponentAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public void initComponentAsync(final RootPanel panel, final Components comp) {
	GWT.runAsync(new RunAsyncCallback() {
		public void onSuccess() {
			comp.insert(panel);
		}
		public void onFailure(Throwable reason) {
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:10,代码来源:Client.java


示例16: openDialogAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
private void openDialogAsync() {
       GWT.runAsync(new RunAsyncCallback() {
       	public void onSuccess() {
       		openDialog();
       	}
       	public void onFailure(Throwable reason) {
       		UniTimeNotifications.error(MESSAGES.failedToLoadTheApp(reason.getMessage()));
       	}
       });
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:11,代码来源:CourseSelectionSuggestBox.java


示例17: showSuggestionsAsync

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
public void showSuggestionsAsync(final int rowIndex) {
	if (rowIndex < 0) return;
	GWT.runAsync(new RunAsyncCallback() {
		public void onSuccess() {
			openSuggestionsBox(rowIndex);
		}
		public void onFailure(Throwable caught) {
			iStatus.error(MESSAGES.exceptionSuggestionsFailed(caught.getMessage()), caught);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:12,代码来源:StudentSectioningWidget.java


示例18: loadFacade

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
private static void loadFacade(final Callback<Void, String> aCallback) {
	final CumulativeCallbackAdapter<Void, String> facadeProcess = new CumulativeCallbackAdapter<Void, String>(2) {

		@Override
		protected void doWork(Void aResult) throws Exception {
			GWT.runAsync(new RunAsyncCallback() {

				@Override
				public void onSuccess() {
					if (!asyncRan.contains(FACADE_HUB)) {
						asyncRan.add(FACADE_HUB);
						JsFacade.init();
					}
					aCallback.onSuccess(null);
				}

				@Override
				public void onFailure(Throwable reason) {
					aCallback.onFailure(reason.toString());
				}
			});
		}

		@Override
		protected void failed(List<String> aReasons) {
			aCallback.onFailure(errorsToString(aReasons));
		}

	};
	loadForms(facadeProcess);
	loadHub(MODEL_HUB, facadeProcess);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:33,代码来源:Loader.java


示例19: CodeMirrorEditorExtension

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
@Inject
public CodeMirrorEditorExtension(final EditorTypeRegistry editorTypeRegistry,
                                 final RequireJsLoader requireJsLoader,
                                 final NotificationManager notificationManager,
                                 final CodeMirrorEditorModule editorModule,
                                 final BaseCodemirrorPromise basePromise,
                                 final BaseCodemirrorInitializer baseInitializer,
                                 final CodeMirrorTextEditorFactory codeMirrorTextEditorFactory,
                                 final CompletionResources completionResources,
                                 final BasePathConstant basePathConstant) {
    this.notificationManager = notificationManager;
    this.requireJsLoader = requireJsLoader;
    this.editorModule = editorModule;
    this.editorTypeRegistry = editorTypeRegistry;
    this.codeMirrorTextEditorFactory = codeMirrorTextEditorFactory;
    this.codemirrorBase = basePathConstant.basePath();

    completionResources.completionCss().ensureInjected();

    Log.debug(CodeMirrorEditorExtension.class, "Codemirror extension module=" + editorModule);
    editorModule.setEditorInitializer(new EditorInitializer() {
        @Override
        public void initialize(final InitializerCallback callback) {
            // add code-splitting of the whole orion editor
            GWT.runAsync(new RunAsyncCallback() {
                @Override
                public void onSuccess() {
                    initBaseCodeMirror(basePromise, baseInitializer, callback);
                }
                @Override
                public void onFailure(final Throwable reason) {
                    callback.onFailure(reason);
                }
            });
        }
    });
    // must not delay
    registerEditor();
    CodeMirrorKeymaps.init();
}
 
开发者ID:codenvy-legacy,项目名称:plugin-editor-codemirror,代码行数:41,代码来源:CodeMirrorEditorExtension.java


示例20: getSourceWriter

import com.google.gwt.core.client.RunAsyncCallback; //导入依赖的package包/类
private SourceWriter getSourceWriter(PrintWriter printWriter, GeneratorContext ctx) {
	ClassSourceFileComposerFactory composerFactory =
		new ClassSourceFileComposerFactory(this.packageName, this.viewProxySimpleName);

	composerFactory.setSuperclass(this.placeType.getSimpleSourceName());

	composerFactory.addImport(GWT.class.getName());
	composerFactory.addImport(RunAsyncCallback.class.getName());
	composerFactory.addImport(ViewProxy.class.getName());
	composerFactory.addImport(Place.class.getName());
	composerFactory.addImport(ViewPlace.class.getName());
	composerFactory.addImport(Activity.class.getName());
	composerFactory.addImport(ViewActivity.class.getName());
	composerFactory.addImport(ApplicationUnreachableException.class.getName());
	composerFactory.addImport(this.placeType.getQualifiedSourceName());
	composerFactory.addImport(this.activityDescrition.view().getCanonicalName());
	if (this.placeTokenizerClass != null) {
		composerFactory.addImport(this.placeTokenizerClass.getCanonicalName());
	}
	if (this.viewDecoratorClass != null) {
		composerFactory.addImport(this.viewDecoratorClass.getCanonicalName());
	}

	composerFactory.addImplementedInterface(
		ViewProxy.class.getSimpleName() + "<" + this.placeType.getSimpleSourceName() + ">");

	return composerFactory.createSourceWriter(ctx, printWriter);
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:29,代码来源:ProxyViewCreator.java



注:本文中的com.google.gwt.core.client.RunAsyncCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Change类代码示例发布时间:2022-05-21
下一篇:
Java CursorRequestMessage类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap