当前位置: 首页>>代码示例>>Java>>正文


Java RunAsyncCallback类代码示例

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


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


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