Java Code Examples for org.eclipse.xtext.ide.editor.contentassist.ContentAssistEntry#KIND_INTERFACE

The following examples show how to use org.eclipse.xtext.ide.editor.contentassist.ContentAssistEntry#KIND_INTERFACE . 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: ImportsAwareReferenceProposalCreator.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
private static String getKind(ReferenceResolution resolution) {
	EClass eClass = resolution.referencedElement.getEClass();
	if (TypesPackage.eINSTANCE.getTClass() == eClass) {
		return ContentAssistEntry.KIND_CLASS;
	}
	if (TypesPackage.eINSTANCE.getTInterface() == eClass) {
		return ContentAssistEntry.KIND_INTERFACE;
	}
	if (TypesPackage.eINSTANCE.getTField() == eClass) {
		return ContentAssistEntry.KIND_FIELD;
	}
	if (TypesPackage.eINSTANCE.getTEnum() == eClass) {
		return ContentAssistEntry.KIND_ENUM;
	}
	if (TypesPackage.eINSTANCE.getTFunction() == eClass) {
		return ContentAssistEntry.KIND_FUNCTION;
	}
	if (TypesPackage.eINSTANCE.getTVariable() == eClass) {
		return ContentAssistEntry.KIND_VARIABLE;
	}
	if (N4JSPackage.eINSTANCE.getVariableDeclaration() == eClass) {
		return ContentAssistEntry.KIND_VARIABLE;
	}
	if (TypesPackage.eINSTANCE.getModuleNamespaceVirtualType() == eClass) {
		return ContentAssistEntry.KIND_COLOR;
	}
	return ContentAssistEntry.KIND_TEXT;
}
 
Example 2
Source File: XContentAssistService.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Translate to a completion item kind.
 */
protected CompletionItemKind translateKind(ContentAssistEntry entry) {
	CompletionItemKind result = null;
	if (entry.getKind() != null) {
		switch (entry.getKind()) {
		case ContentAssistEntry.KIND_CLASS:
			result = CompletionItemKind.Class;
			break;
		case ContentAssistEntry.KIND_COLOR:
			result = CompletionItemKind.Color;
			break;
		case ContentAssistEntry.KIND_CONSTRUCTOR:
			result = CompletionItemKind.Constructor;
			break;
		case ContentAssistEntry.KIND_ENUM:
			result = CompletionItemKind.Enum;
			break;
		case ContentAssistEntry.KIND_FIELD:
			result = CompletionItemKind.Field;
			break;
		case ContentAssistEntry.KIND_FILE:
			result = CompletionItemKind.File;
			break;
		case ContentAssistEntry.KIND_FUNCTION:
			result = CompletionItemKind.Function;
			break;
		case ContentAssistEntry.KIND_INTERFACE:
			result = CompletionItemKind.Interface;
			break;
		case ContentAssistEntry.KIND_KEYWORD:
			result = CompletionItemKind.Keyword;
			break;
		case ContentAssistEntry.KIND_METHOD:
			result = CompletionItemKind.Method;
			break;
		case ContentAssistEntry.KIND_MODULE:
			result = CompletionItemKind.Module;
			break;
		case ContentAssistEntry.KIND_PROPERTY:
			result = CompletionItemKind.Property;
			break;
		case ContentAssistEntry.KIND_REFERENCE:
			result = CompletionItemKind.Reference;
			break;
		case ContentAssistEntry.KIND_SNIPPET:
			result = CompletionItemKind.Snippet;
			break;
		case ContentAssistEntry.KIND_TEXT:
			result = CompletionItemKind.Text;
			break;
		case ContentAssistEntry.KIND_UNIT:
			result = CompletionItemKind.Unit;
			break;
		case ContentAssistEntry.KIND_VALUE:
			result = CompletionItemKind.Value;
			break;
		case ContentAssistEntry.KIND_VARIABLE:
			result = CompletionItemKind.Variable;
			break;
		default:
			result = CompletionItemKind.Value;
			break;
		}
	} else {
		result = CompletionItemKind.Value;
	}
	return result;
}
 
Example 3
Source File: ContentAssistService.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected CompletionItemKind translateKind(ContentAssistEntry entry) {
	if (entry.getKind() != null) {
		switch (entry.getKind()) {
		case ContentAssistEntry.KIND_CLASS:
			return CompletionItemKind.Class;
		case ContentAssistEntry.KIND_COLOR:
			return CompletionItemKind.Color;
		case ContentAssistEntry.KIND_CONSTRUCTOR:
			return CompletionItemKind.Constructor;
		case ContentAssistEntry.KIND_ENUM:
			return CompletionItemKind.Enum;
		case ContentAssistEntry.KIND_FIELD:
			return CompletionItemKind.Field;
		case ContentAssistEntry.KIND_FILE:
			return CompletionItemKind.File;
		case ContentAssistEntry.KIND_FUNCTION:
			return CompletionItemKind.Function;
		case ContentAssistEntry.KIND_INTERFACE:
			return CompletionItemKind.Interface;
		case ContentAssistEntry.KIND_KEYWORD:
			return CompletionItemKind.Keyword;
		case ContentAssistEntry.KIND_METHOD:
			return CompletionItemKind.Method;
		case ContentAssistEntry.KIND_MODULE:
			return CompletionItemKind.Module;
		case ContentAssistEntry.KIND_PROPERTY:
			return CompletionItemKind.Property;
		case ContentAssistEntry.KIND_REFERENCE:
			return CompletionItemKind.Reference;
		case ContentAssistEntry.KIND_SNIPPET:
			return CompletionItemKind.Snippet;
		case ContentAssistEntry.KIND_TEXT:
			return CompletionItemKind.Text;
		case ContentAssistEntry.KIND_UNIT:
			return CompletionItemKind.Unit;
		case ContentAssistEntry.KIND_VALUE:
			return CompletionItemKind.Value;
		case ContentAssistEntry.KIND_VARIABLE:
			return CompletionItemKind.Variable;
		default:
			return CompletionItemKind.Value;
		}
	} else {
		return CompletionItemKind.Value;
	}
}