// Path: org.eclipse.ec4e/src/main/java/org/eclipse/ec4e/utils/EditorUtils.java
// public class EditorUtils {
// 
// 	public static boolean isEditorConfigFile(ITextEditor textEditor) {
// 		IFile configFile = EditorUtils.getFile(textEditor);
// 		return isEditorConfigFile(configFile);
// 	}
// 
// 	public static boolean isEditorConfigFile(IFile configFile) {
// 		return configFile != null && EditorConfigConstants.EDITORCONFIG.equals(configFile.getName());
// 	}
// 
// 	public static IFile getFile(ITextEditor textEditor) {
// 		IEditorInput input = textEditor.getEditorInput();
// 		if (input instanceof IFileEditorInput) {
// 			return ((IFileEditorInput) input).getFile();
// 		}
// 		return null;
// 	}
// }


import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import org.ec4j.core.EditorConfigConstants;
import org.ec4j.core.PropertyTypeRegistry;
import org.ec4j.core.Resource.Resources;
import org.ec4j.core.model.EditorConfig;
import org.ec4j.core.model.Property;
import org.ec4j.core.model.Section;
import org.ec4j.core.model.Version;
import org.ec4j.core.parser.EditorConfigModelHandler;
import org.ec4j.core.parser.EditorConfigParser;
import org.ec4j.core.parser.ErrorHandler;
import org.ec4j.core.parser.LocationAwareModelHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ec4e.utils.EditorUtils;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonContentProvider;
import org.eclipse.ui.texteditor.ITextEditor;

package org.eclipse.ec4e.internal.outline;



public class EditorConfigContentProvider
		implements ICommonContentProvider, ITreeContentProvider, IDocumentListener, IResourceChangeListener {

	public static final Object COMPUTING = new Object();

	private TreeViewer viewer;
	private ITextEditor info;
	private IFile resource;
	private EditorConfig editorConfig;
	private CompletableFuture<EditorConfig> symbols;

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
		this.viewer = (TreeViewer) viewer;
		this.info = (ITextEditor) newInput;
		getDocument().addDocumentListener(this);

// Path: org.eclipse.ec4e/src/main/java/org/eclipse/ec4e/utils/EditorUtils.java
// public class EditorUtils {
// 
// 	public static boolean isEditorConfigFile(ITextEditor textEditor) {
// 		IFile configFile = EditorUtils.getFile(textEditor);
// 		return isEditorConfigFile(configFile);
// 	}
// 
// 	public static boolean isEditorConfigFile(IFile configFile) {
// 		return configFile != null && EditorConfigConstants.EDITORCONFIG.equals(configFile.getName());
// 	}
// 
// 	public static IFile getFile(ITextEditor textEditor) {
// 		IEditorInput input = textEditor.getEditorInput();
// 		if (input instanceof IFileEditorInput) {
// 			return ((IFileEditorInput) input).getFile();
// 		}
// 		return null;
// 	}
// }


// Path: org.eclipse.ec4e/src/main/java/org/eclipse/ec4e/internal/outline/EditorConfigContentProvider.java
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import org.ec4j.core.EditorConfigConstants;
import org.ec4j.core.PropertyTypeRegistry;
import org.ec4j.core.Resource.Resources;
import org.ec4j.core.model.EditorConfig;
import org.ec4j.core.model.Property;
import org.ec4j.core.model.Section;
import org.ec4j.core.model.Version;
import org.ec4j.core.parser.EditorConfigModelHandler;
import org.ec4j.core.parser.EditorConfigParser;
import org.ec4j.core.parser.ErrorHandler;
import org.ec4j.core.parser.LocationAwareModelHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.ec4e.utils.EditorUtils;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
import org.eclipse.ui.navigator.ICommonContentProvider;
import org.eclipse.ui.texteditor.ITextEditor;

package org.eclipse.ec4e.internal.outline;



public class EditorConfigContentProvider
		implements ICommonContentProvider, ITreeContentProvider, IDocumentListener, IResourceChangeListener {

	public static final Object COMPUTING = new Object();

	private TreeViewer viewer;
	private ITextEditor info;
	private IFile resource;
	private EditorConfig editorConfig;
	private CompletableFuture<EditorConfig> symbols;

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
		this.viewer = (TreeViewer) viewer;
		this.info = (ITextEditor) newInput;
		getDocument().addDocumentListener(this);

		resource = EditorUtils.getFile(info);
