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


Java AsyncCallback类代码示例

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


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

示例1: goToOozInstance

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
/**
 * Jump to a oozie instance( which need to synchronize current oozie job actions before jumping)
 * 
 * @param oozJobId   oozie job id
 * @param message page url
 */
public void goToOozInstance(final String oozJobId,final String message)
{
	jobSrv.updateJobActionStatus(oozJobId, new AsyncCallback<Void>(){

		@Override
		public void onFailure(Throwable caught) {
			// TODO Auto-generated method stub
			logger.warning("Synchronize current oozie instance actions status failed! Oozie job id ="+oozJobId);
		}

		@Override
		public void onSuccess(Void result) {
			// TODO Auto-generated method stub
			eventBus.fireEvent(new ToMonitorEvent(message));
		}
	});
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:24,代码来源:HistoryPopupPanel.java

示例2: returnSuggestions

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public void returnSuggestions(final List<Chip> chips, final String text, final List<Suggestion> suggestions, final AsyncCallback<Collection<Suggestion>> callback) {
	if (iNext == null)
		callback.onSuccess(suggestions);
	else
		iNext.getSuggestions(chips, text, new AsyncCallback<Collection<Suggestion>>() {

			@Override
			public void onFailure(Throwable caught) {
				callback.onSuccess(suggestions);
			}

			@Override
			public void onSuccess(Collection<Suggestion> result) {
				if (result != null) suggestions.addAll(result);
				callback.onSuccess(suggestions);
			}
		});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:FilterBox.java

示例3: showMenu

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public void showMenu() {
	if (iLoaded) showMenuPopup();
	else {
		RPC.execute(new MenuInterface.MenuRpcRequest(), new AsyncCallback<GwtRpcResponseList<MenuInterface>>() {
			@Override
			public void onSuccess(GwtRpcResponseList<MenuInterface> result) {
				initMenu(result);
				showMenuPopup();
			}
			@Override
			public void onFailure(Throwable caught) {
				UniTimeNotifications.error(caught.getMessage(), caught);
			}
		});
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:17,代码来源:UniTimeMobileMenu.java

示例4: setCompany

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public void setCompany(Integer company) {
	this.company = company;
	
	companyService.getCompany(company, new AsyncCallback<CompanyInfo>() {

		@Override
		public void onFailure(Throwable caught) {
			Window.alert(caught.getMessage());
		}

		@Override
		public void onSuccess(CompanyInfo result) {
			resetFaultMessages();
			name.setText(result.getName());
			total.setText(Double.toString(result.getTotal()));
		}
	});
}
 
开发者ID:amritbhat786,项目名称:DocIT,代码行数:19,代码来源:CompanyPanel.java

示例5: ensureInitialized

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
protected void ensureInitialized(final AsyncCallback<Boolean> callback) {
	if (iClassifications != null)
		callback.onSuccess(true);
	iCurriculaService.loadAcademicClassifications(new AsyncCallback<TreeSet<AcademicClassificationInterface>>() {
		@Override
		public void onSuccess(TreeSet<AcademicClassificationInterface> result) {
			iClassifications = result;
			if (callback != null) callback.onSuccess(true);
		}
		
		@Override
		public void onFailure(Throwable caught) {
			iHeader.setErrorMessage(MESSAGES.failedToLoadClassifications(caught.getMessage()));
			UniTimeNotifications.error(MESSAGES.failedToLoadClassifications(caught.getMessage()), caught);
			if (callback != null) callback.onFailure(caught);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:CourseCurriculaTable.java

示例6: requestSuggestions

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
@Override
public void requestSuggestions(final Request request, final Callback callback) {
	if (!request.getQuery().isEmpty()) {
		iFilter.getWidget().getSuggestionsProvider().getSuggestions(iFilter.getWidget().getChips(null), request.getQuery(), new AsyncCallback<Collection<FilterBox.Suggestion>>() {

			@Override
			public void onFailure(Throwable caught) {
			}

			@Override
			public void onSuccess(Collection<FilterBox.Suggestion> result) {
				if (result == null) return;
				List<CourseSuggestion> suggestions = new ArrayList<CourseSuggestion>();
				for (FilterBox.Suggestion suggestion: result) {
					if (suggestion.getChipToAdd() != null && "course".equals(suggestion.getChipToAdd().getCommand())) {
						suggestions.add(new CourseSuggestion(suggestion));
					}
				}
				callback.onSuggestionsReady(request, new Response(suggestions));
			}
		});
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:TeachingRequestsFilterBox.java

示例7: SolverStatus

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public SolverStatus() {
	super("unitime-SolverStatus");
	iStatus = new P("status-label");
	iIcon = new Image(RESOURCES.helpIcon()); iIcon.addStyleName("status-icon");
	iIcon.setVisible(false);
	add(iStatus); add(iIcon);
	RPC.execute(new PageNameRpcRequest("Solver Status"), new AsyncCallback<PageNameInterface>() {
		@Override
		public void onFailure(Throwable caught) {}
		@Override
		public void onSuccess(final PageNameInterface result) {
			iIcon.setTitle(MESSAGES.pageHelp(result.getName()));
			iIcon.setVisible(true);
			iIcon.addClickHandler(new ClickHandler() {
				@Override
				public void onClick(ClickEvent event) {
					if (result.getHelpUrl() == null || result.getHelpUrl().isEmpty()) return;
					UniTimeFrameDialog.openDialog(MESSAGES.pageHelp(result.getName()), result.getHelpUrl());
				}
			});
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:SolverPage.java

示例8: insert

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public void insert(final RootPanel panel, Long eventAvailability) {
	String[] ids = panel.getElement().getInnerHTML().trim().split(":");
	Long locationId = Long.valueOf(ids[0]);
	Long examTypeId = Long.valueOf(ids[1]);
	RPC.execute(RoomInterface.PeriodPreferenceRequest.load(locationId, examTypeId), new AsyncCallback<PeriodPreferenceModel>() {
		@Override
		public void onFailure(Throwable caught) {
			UniTimeNotifications.error(MESSAGES.failedToLoadPeriodPreferences(caught.getMessage()));
		}

		@Override
		public void onSuccess(PeriodPreferenceModel result) {
			panel.getElement().setInnerText(null);
			setModel(result);
			panel.add(PeriodPreferencesWidget.this);
			panel.setVisible(true);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:20,代码来源:PeriodPreferencesWidget.java

示例9: drawEnvelope

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
private void drawEnvelope(final VectorFeature... vectorFeatures) {
	final WKT wktFormat = new WKT();
	final List<String> wktElements = new ArrayList<String>();
	for (final VectorFeature feature : vectorFeatures) {
		wktElements.add(wktFormat.write(feature));
	}

	JTS_SERVICE_ASYNC.getEnvelope(wktElements, new AsyncCallback<List<String>>() {
		public void onFailure(final Throwable caught) {
			progressBar.hide();
			messageDialogBuilder.createError(UIMessages.INSTANCE.fail(), "Error: " + caught.getMessage()).show();
		}

		public void onSuccess(final List<String> wktEnvelopes) {
			final VectorLayer vector = getEnvelopeLayer();
			for (final String wktEnvelope : wktEnvelopes) {
				final VectorFeature newVectorFeature = new VectorFeature(Geometry.fromWKT(wktEnvelope));
				vector.addFeature(newVectorFeature);
			}
			progressBar.hide();
		}
	});
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:24,代码来源:EnvelopeTool.java

示例10: execute

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
private void execute(final int index, final AsyncCallback<Boolean> callback) {
	if (index >= iInitializations.length) {
		callback.onSuccess(true);
	} else {
		iInitializations[index].execute(new AsyncCallback<Boolean>() {
			@Override
			public void onFailure(Throwable caught) {
				callback.onFailure(caught);
			}
			@Override
			public void onSuccess(Boolean result) {
				if (result) {
					execute(1 + index, callback);
				} else {
					callback.onSuccess(false);
				}
			}
		});
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:21,代码来源:ReservationEdit.java

示例11: updateKeystoreFileMenuButtons

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
/**
 * Enables or disables buttons based on whether the user has an android.keystore file.
 */
public void updateKeystoreFileMenuButtons() {
  Ode.getInstance().getUserInfoService().hasUserFile(StorageUtil.ANDROID_KEYSTORE_FILENAME,
      new AsyncCallback<Boolean>() {
        @Override
        public void onSuccess(Boolean keystoreFileExists) {
          isKeystoreCached = true;
          isKeystorePresent = keystoreFileExists;
          fileDropDown.setItemEnabled(MESSAGES.deleteKeystoreMenuItem(), keystoreFileExists);
          fileDropDown.setItemEnabled(MESSAGES.downloadKeystoreMenuItem(), keystoreFileExists);
        }

        @Override
        public void onFailure(Throwable caught) {
          // Enable the MenuItems. If they are clicked, we'll check again if the keystore exists.
          fileDropDown.setItemEnabled(MESSAGES.deleteKeystoreMenuItem(), true);
          fileDropDown.setItemEnabled(MESSAGES.downloadKeystoreMenuItem(), true);
        }
      });
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:23,代码来源:TopToolbar.java

示例12: showInstructorDetail

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
public void showInstructorDetail(Long id) {
	iAssignmentTable.clearTable(1);
	LoadingWidget.getInstance().show(MESSAGES.waitLoadTeachingRequestDetail());
	ToolBox.setMaxHeight(iScroll.getElement().getStyle(), Math.round(0.9 * Window.getClientHeight()) + "px");
	RPC.execute(new TeachingAssignmentsDetailRequest(id), new AsyncCallback<InstructorInfo>() {
		@Override
		public void onFailure(Throwable caught) {
			LoadingWidget.getInstance().hide();
			UniTimeNotifications.error(MESSAGES.failedToLoadTeachingRequestDetail(caught.getMessage()), caught);
			ToolBox.checkAccess(caught);
		}

		@Override
		public void onSuccess(InstructorInfo result) {
			LoadingWidget.getInstance().hide();
			populate(null, null, result);
			GwtHint.hideHint();
			center();
			RootPanel.getBodyElement().getStyle().setOverflow(Overflow.HIDDEN);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:23,代码来源:TeachingRequestDetailPage.java

示例13: getDefaultAsyncCallback

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
protected AsyncCallback<List<String>> getDefaultAsyncCallback() {
	
	return new AsyncCallback<List<String>>() {

		@Override
		public void onFailure(final Throwable caught) {
			finishProgressbar();		
			onError(caught.getMessage());				
		}

		public void onSuccess(final List<String> wktElements) {
			finishProgressbar();
			onSucess(getResultLayer(wktElements));				
		}
	};
}
 
开发者ID:geowe,项目名称:sig-seguimiento-vehiculos,代码行数:17,代码来源:Geoprocess.java

示例14: init

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
protected void init() {
	RPC.execute(new NotAssignedClassesFilterRequest(), new AsyncCallback<NotAssignedClassesFilterResponse>() {
		@Override
		public void onFailure(Throwable caught) {
			iFilter.getFooter().setErrorMessage(MESSAGES.failedToInitialize(caught.getMessage()));
			UniTimeNotifications.error(MESSAGES.failedToInitialize(caught.getMessage()), caught);
			ToolBox.checkAccess(caught);
		}

		@Override
		public void onSuccess(NotAssignedClassesFilterResponse result) {
			iLegend = new PreferenceLegend(result.getPreferences());
			iFilter.getFooter().clearMessage();
			iFilter.setValue(result);
			iFilter.getFooter().setEnabled("search", true);
			createTriggers();
			if (iFilter.getHeader().isCollapsible() != null && !iFilter.getHeader().isCollapsible())
				search(null);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:22,代码来源:NotAssignedClassesPage.java

示例15: requestSuggestions

import com.google.gwt.user.client.rpc.AsyncCallback; //导入依赖的package包/类
@Override
public void requestSuggestions(final Request request, final Callback callback) {
	if (!request.getQuery().isEmpty()) {
		iFilter.getWidget().getSuggestionsProvider().getSuggestions(iFilter.getWidget().getChips(null), request.getQuery(), new AsyncCallback<Collection<FilterBox.Suggestion>>() {

			@Override
			public void onFailure(Throwable caught) {
			}

			@Override
			public void onSuccess(Collection<FilterBox.Suggestion> result) {
				if (result == null) return;
				List<RequestedBySuggestion> suggestions = new ArrayList<RequestedBySuggestion>();
				for (FilterBox.Suggestion suggestion: result) {
					if (suggestion.getChipToAdd() != null && "requested".equals(suggestion.getChipToAdd().getCommand())) {
						suggestions.add(new RequestedBySuggestion(suggestion));
					}
				}
				callback.onSuggestionsReady(request, new Response(suggestions));
			}
		});
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:24,代码来源:EventFilterBox.java


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