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


Java AsyncCallback.onSuccess方法代码示例

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


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

示例1: 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

示例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: 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

示例4: getData

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void getData(String source, AsyncCallback<List<FreeTime>> callback) {
	try {
		callback.onSuccess(parseFreeTime(source));
	} catch (IllegalArgumentException e) {
		callback.onFailure(e);
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:9,代码来源:FreeTimeParser.java

示例5: parse

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
private void parse(final List<Chip> chips, final String text, final Collection<Filter> filters, final AsyncCallback<Parser.Results> callback) {
	if (text.isEmpty()) {
		callback.onSuccess(new Parser.Results(text, chips));
	} else {
		for (RegExp regExp: sRegExps) {
			final MatchResult r = regExp.exec(text);
			if (r == null) continue;
			for (Filter filter: filters) {
				if (filter.getCommand().equals(r.getGroup(1))) {
					filter.validate(r.getGroup(2), new AsyncCallback<Chip>() {
						@Override
						public void onFailure(Throwable caught) {
							callback.onSuccess(new Parser.Results(text, chips));
						}

						@Override
						public void onSuccess(Chip result) {
							if (result == null) {
								callback.onSuccess(new Parser.Results(text, chips));
							} else {
								chips.add(result);
								if (r.getGroupCount() > 3) {
									parse(chips, r.getGroup(3).trim(), filters, callback);
								} else {
									callback.onSuccess(new Parser.Results("", chips));
								}
							}
						}
					});
					return;
				}
			}
		}
		callback.onSuccess(new Parser.Results(text, chips));
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:37,代码来源:FilterBox.java

示例6: validate

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void validate(String text, AsyncCallback<Chip> callback) {
	if (iValidate) {
		for (Chip chip: iValues)
			if (chip.getValue().equals(text)) {
				callback.onSuccess(chip);
				return;
			}
		callback.onFailure(new Exception("Unknown value " + text + "."));
	} else {
		callback.onSuccess(new Chip(getCommand(), text).withTranslatedCommand(getLabel()));
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:14,代码来源:FilterBox.java

示例7: selectSession

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void selectSession(Long sessionId, AsyncCallback<Boolean> callback) {
	if (sessionId != null && sessionId.equals(getAcademicSessionId())) {
		if (callback != null) callback.onSuccess(true);
		return;
	}
	if (sessionId == null && getAcademicSessionId() == null) {
		if (callback != null) callback.onSuccess(true);
		return;
	}
	if (sessionId == null) {
		setValue(null);
		if (callback != null) callback.onSuccess(true);
	} else {
		boolean found = false;
		if (getValues() != null) {
			for (AcademicSession session: getValues()) {
				if (session.getUniqueId().equals(sessionId)) {
					setValue(new Interval(session));
					if (callback != null) callback.onSuccess(true);
					found = true;
					break;
				}
			}
		}
		if (!found) {
			setValue(null);
			if (callback != null) callback.onSuccess(false);
		}
	}
	fireAcademicSessionChanged();
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:33,代码来源:AcademicSessionSelectionBox.java

示例8: selectSession

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
public void selectSession(final Long sessionId, final AsyncCallback<Boolean> callback) {
	if (sessionId == null) {
		selectSession();
		callback.onSuccess(false);
	} else if (sessionId.equals(getAcademicSessionId())) {
		callback.onSuccess(true);
	} else {
		iSectioningService.listAcademicSessions(iMode.isSectioning(), new AsyncCallback<Collection<AcademicSessionInfo>>() {
			public void onSuccess(Collection<AcademicSessionInfo> result) {
				for (AcademicSessionInfo session: result) {
					if (session.getSessionId().equals(sessionId)) {
						selectSession(session, false);
						callback.onSuccess(true);
						return;
					}
				}
				selectSession();
				callback.onSuccess(false);
			}
			public void onFailure(Throwable caught) {
				iSessions.clearTable(1);
				iSessions.addRow(null, new EmptyTableCell(caught.getMessage()));
				iDialog.center();
				callback.onSuccess(false);
			}
		});
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:29,代码来源:AcademicSessionSelector.java

示例9: doInvoke

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
   protected <T> Request doInvoke(ResponseReader responseReader, final String methodName, RpcStatsContext statsContext, String requestData, final AsyncCallback<T> callback) {
	return super.doInvoke(responseReader, methodName, statsContext, requestData, new AsyncCallback<T>() {
		@Override
		public void onFailure(Throwable caught) {
			UniTimeNotifications.error("Request " + methodName.replace("_Proxy", "") + " failed: " + caught.getMessage(), caught);
			callback.onFailure(caught);
		}
		@Override
		public void onSuccess(T result) {
			callback.onSuccess(result);
		}
	});
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:15,代码来源:GwtRpcProxy.java

示例10: updateKeystoreFileMenuButtons

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
/**
 * Enables or disables buttons based on whether the user has an android.keystore file. If the
 * useCache parameter is true, then the last value returned from the UserInfoService is used.
 * Otherwise, the behavior is identical to {@link #updateKeystoreFileMenuButtons()}.
 *
 * @param useCache true if a cached value of a previous call is acceptable.
 */
public void updateKeystoreFileMenuButtons(boolean useCache) {
  if (useCache && isKeystoreCheckPending) {
    return;
  }
  AsyncCallback<Boolean> callback = new AsyncCallback<Boolean>() {
    @Override
    public void onSuccess(Boolean keystoreFileExists) {
      isKeystoreCached = true;
      isKeystorePresent = keystoreFileExists;
      isKeystoreCheckPending = false;
      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.
      isKeystoreCached = false;
      isKeystorePresent = true;
      isKeystoreCheckPending = false;
      fileDropDown.setItemEnabled(MESSAGES.deleteKeystoreMenuItem(), true);
      fileDropDown.setItemEnabled(MESSAGES.downloadKeystoreMenuItem(), true);
    }
  };
  if (useCache && isKeystoreCached) {
    callback.onSuccess(isKeystorePresent);
  } else {
    isKeystoreCheckPending = true;
    Ode.getInstance().getUserInfoService().hasUserFile(StorageUtil.ANDROID_KEYSTORE_FILENAME,
        callback);
  }
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:40,代码来源:TopToolbar.java

示例11: getAdditionalProposalInfo

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void getAdditionalProposalInfo(AsyncCallback<Widget> callback) {
  callback.onSuccess(null);
}
 
开发者ID:eclipse,项目名称:che-archetypes,代码行数:5,代码来源:SimpleCompletionProposal.java

示例12: selectSession

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void selectSession(Long sessionId, AsyncCallback<Boolean> callback) {
	callback.onSuccess(false);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:TravelTimes.java

示例13: getValues

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void getValues(List<Chip> chips, String text, AsyncCallback<Collection<Chip>> callback) {
	callback.onSuccess(iValues);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:FilterBox.java

示例14: getSuggestions

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
@Override
public void getSuggestions(List<Chip> chips, String text, AsyncCallback<Collection<Suggestion>> callback) {
	callback.onSuccess(null);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:5,代码来源:FilterBox.java

示例15: validate

import com.google.gwt.user.client.rpc.AsyncCallback; //导入方法依赖的package包/类
public void validate(final AsyncCallback<Boolean> callback) {
	iHeader.clearMessage();
	boolean valid = true;
	if (iName.getWidget().getText().isEmpty() && getEventType() != EventType.Unavailabile) {
		iName.setErrorHint(MESSAGES.reqEventName());
		UniTimeNotifications.error(MESSAGES.reqEventName());
		iHeader.setErrorMessage(MESSAGES.reqEventName());
		valid = false;
	} else {
		iName.clearHint();
	}
	if (iMainLName.getWidget().getText().isEmpty() && getEventType() != EventType.Unavailabile) {
		UniTimeNotifications.error(MESSAGES.reqMainContactLastName());
		if (valid)
			iHeader.setErrorMessage(MESSAGES.reqMainContactLastName());
		valid = false;
	} else {
		iMainLName.clearHint();
	}
	if (iMainEmail.getWidget().getText().isEmpty() && getEventType() != EventType.Unavailabile) {
		UniTimeNotifications.error(MESSAGES.reqMainContactEmail());
		if (valid)
			iHeader.setErrorMessage(MESSAGES.reqMainContactEmail());
		valid = false;
	} else {
		iMainEmail.clearHint();
	}
	if (hasMainContactChanged() && !iMainContactChanged.getValue()) {
		UniTimeNotifications.error(iMainContactChanged.getText());
		if (valid)
			iHeader.setErrorMessage(iMainContactChanged.getText());
		valid = false;
	}
	if (iMeetings.getValue().isEmpty() && iEvent.getId() == null) {
		UniTimeNotifications.error(MESSAGES.reqMeetings());
		if (valid)
			iHeader.setErrorMessage(MESSAGES.reqMeetings());
		valid = false;
	}
	if (iExpirationDate.getValue() != null && iExpirationDate.getValue().before(iExpirationDate.today()) && iForm.getRowFormatter().isVisible(iForm.getRow(MESSAGES.propExpirationDate()))) {
		for (EventMeetingRow row: iMeetings.getValue()) {
			if (row.getMeeting().getId() == null && row.getMeeting().getApprovalStatus() == ApprovalStatus.Pending) { // there is a new meeting that could get expired
				UniTimeNotifications.error(MESSAGES.errorExpirationDateInPast());
				if (valid)
					iHeader.setErrorMessage(MESSAGES.errorExpirationDateInPast());
				valid = false;
				break;
			}
		}
	}
	if (getEventType() == EventType.Course && iCourses.getValue().isEmpty()) {
		UniTimeNotifications.error(MESSAGES.reqCoursesOrClasses());
		if (valid)
			iHeader.setErrorMessage(MESSAGES.reqCoursesOrClasses());
		valid = false;
	}
	callback.onSuccess(valid);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:59,代码来源:EventAdd.java


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