Java Code Examples for org.eclipse.compare.ITypedElement#TEXT_TYPE

The following examples show how to use org.eclipse.compare.ITypedElement#TEXT_TYPE . 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: CompareAction.java    From ADT_Frontend with MIT License 6 votes vote down vote up
/**
 * Returns the file extension registered in SFS for the given abap object
 * for opening the right compare editor. For properties file the default
 * extension (txt) is returned for opening the text compare editor. </br>
 * </br>
 * eg: If the selection is on an abap class file, the method returns the the
 * SFS file extension registered for the abap class in ADT to open the abap
 * compare editor. If the selection is on an xml file, the methods returns
 * the text editor extension (txt) to open a text compare editor.
 *
 * @param file
 *            File to compare
 * @param abapObject
 *            Parent abap object of the selected file
 * @return File extension for the compare editor
 */
private String getFileExtension(IAbapGitFile file, IAbapGitObject abapObject) {
	if (isSourceCodeFile(file)) {
		IFile objectFile = (IFile) AdtUriMappingServiceFactory.createUriMappingService().getPlatformResource(
				new UriMappingContext(this.view.getProject()), URI.create(abapObject.getUri()));
		if (objectFile != null) {
			IAdtObjectLoader adtObjectLoader = AbapSource.getInstance().getAdtObjectLoader(objectFile);
			if (adtObjectLoader != null) {
				final IFile propsFile = adtObjectLoader.getLifecycleInfoFile(objectFile);
				if (propsFile != null) {
					final IFile sourceFile = adtObjectLoader.getSourceFile(propsFile);
					if (sourceFile != null) {
						return sourceFile.getFileExtension();
					}
				}
			}
		}
	}
	return ITypedElement.TEXT_TYPE;
}
 
Example 2
Source File: FileNode.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public String getType() {
	int index = getName().indexOf("."); //$NON-NLS-1$
	if (index != -1 && getName().length() > index + 1) {
		return getName().substring(index + 1);
	}
	return ITypedElement.TEXT_TYPE;
}
 
Example 3
Source File: N4IDEXpectCompareEditorInput.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public String getType() {
	return ITypedElement.TEXT_TYPE;
}
 
Example 4
Source File: DatastoreIndexesUpdatedStatusHandler.java    From google-cloud-eclipse with Apache License 2.0 4 votes vote down vote up
@Override
public String getType() {
  return ITypedElement.TEXT_TYPE;
}
 
Example 5
Source File: CompareScript.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public String getType() {
    return ITypedElement.TEXT_TYPE;
}
 
Example 6
Source File: DuplicatedCode.java    From JDeodorant with MIT License votes vote down vote up
public String getType() {return ITypedElement.TEXT_TYPE;}