com.google.gwt.i18n.client.Messages Java Examples

The following examples show how to use com.google.gwt.i18n.client.Messages. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MicrosoftTemplates.java    From codenvy with Eclipse Public License 1.0 5 votes vote down vote up
@Messages.DefaultMessage("https://{0}.visualstudio.com/{1}/{2}/_git/{3}/pullrequest/{4}")
@Key("pullRequestUrlTemplateWithProjectAndRepo")
String pullRequestUrlTemplate(
    String accountName,
    String collection,
    String username,
    String repository,
    String pullRequestNumber);
 
Example #2
Source File: Localization.java    From unitime with Apache License 2.0 5 votes vote down vote up
private Map<String, String> getStrutsActions(Object proxy, Class<? extends LocalizedLookupDispatchAction> apply) throws Throwable {
	Map<String, String> ret = new HashMap<String, String>();
	for (Method m: iMessages.getDeclaredMethods()) {
		if (m.getParameterTypes().length > 0) continue;
		org.unitime.localization.messages.Messages.StrutsAction action = m.getAnnotation(org.unitime.localization.messages.Messages.StrutsAction.class);
		if (action != null) {
			Messages.DefaultMessage dm = m.getAnnotation(Messages.DefaultMessage.class);
			if (action.apply() == null || action.apply().length == 0) {
				try {
					if (apply.getMethod(action.value(), new Class<?>[] {
						ActionMapping.class, ActionForm.class, HttpServletRequest.class, HttpServletResponse.class
						}) != null) {
						ret.put((String)invoke(proxy, m, new Object[] {}), action.value());
						if (dm != null)
							ret.put(dm.value(), action.value());
					}
				} catch (NoSuchMethodException e) {}
			} else {
				for (Class<? extends LocalizedLookupDispatchAction> a: action.apply())
					if (a.equals(apply)) {
						ret.put((String)invoke(proxy, m, new Object[] {}), action.value());
						if (dm != null)
							ret.put(dm.value(), action.value());
					}
			}
		}
	}
	return ret;
}
 
Example #3
Source File: GwtMockitoTest.java    From gwtmockito with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldGenerateHashCodeForMessages() {
  SampleMessages messages = GWT.create(SampleMessages.class);
  SampleMessages2 messages2 = GWT.create(SampleMessages2.class);

  final Set<Messages> set = new HashSet<>();

  set.add(messages);
  set.add(messages2);
  assertEquals(2, set.size());

  set.add(messages);
  assertEquals(2, set.size());
}
 
Example #4
Source File: MicrosoftTemplates.java    From codenvy with Eclipse Public License 1.0 4 votes vote down vote up
@Messages.DefaultMessage("https://{0}.visualstudio.com/{1}/_git/{2}.git")
String httpUrlTemplate(String accountName, String collection, String repository);
 
Example #5
Source File: MicrosoftTemplates.java    From codenvy with Eclipse Public License 1.0 4 votes vote down vote up
@Messages.DefaultMessage("https://{0}.visualstudio.com/{1}/{2}/_git/{3}.git")
@Key("httpUrlTemplateWithProjectAndRepo")
String httpUrlTemplate(String accountName, String collection, String username, String repository);
 
Example #6
Source File: MicrosoftTemplates.java    From codenvy with Eclipse Public License 1.0 4 votes vote down vote up
@Messages.DefaultMessage("https://{0}.visualstudio.com/{1}/_git/{2}/pullrequest/{3}")
String pullRequestUrlTemplate(
    String accountName, String collection, String repository, String pullRequestNumber);