Java Code Examples for org.eclipse.xtext.common.types.JvmGenericType#getSimpleName()

The following examples show how to use org.eclipse.xtext.common.types.JvmGenericType#getSimpleName() . 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: XtendJvmLabelProvider.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected String text(final JvmGenericType element) {
  String _xblockexpression = null;
  {
    final boolean local = element.isLocal();
    if (local) {
      final JvmTypeReference supertype = IterableExtensions.<JvmTypeReference>last(element.getSuperTypes());
      StringConcatenation _builder = new StringConcatenation();
      _builder.append("new ");
      String _simpleName = supertype.getSimpleName();
      _builder.append(_simpleName);
      _builder.append("() {...}");
      return _builder.toString();
    }
    String _simpleName_1 = element.getSimpleName();
    String _xifexpression = null;
    boolean _isEmpty = element.getTypeParameters().isEmpty();
    if (_isEmpty) {
      _xifexpression = "";
    } else {
      _xifexpression = this.uiStrings.typeParameters(element.getTypeParameters());
    }
    _xblockexpression = (_simpleName_1 + _xifexpression);
  }
  return _xblockexpression;
}
 
Example 2
Source File: LocalClassAwareTypeNames.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public String getReadableName(XtendTypeDeclaration typeDeclaration) {
	if (typeDeclaration instanceof AnonymousClass) {
		JvmGenericType superType = anonymousClassUtil.getSuperType((AnonymousClass) typeDeclaration);
		return "new " + superType.getSimpleName() + "(){}";
	} else if (typeDeclaration.getName() == null) {
		return "<unnamed>";
	}
	return typeDeclaration.getName();
}
 
Example 3
Source File: XbaseLabelProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected String text(JvmGenericType genericType) {
	return genericType.getSimpleName();
}
 
Example 4
Source File: XbaseDeclarativeHoverSignatureProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
protected String _signature(JvmGenericType clazz, boolean typeAtEnd) {
	return clazz.getSimpleName() + hoverUiStrings.typeParameters(clazz.getTypeParameters());
}