@Override
	public int open(JoeTree tree, DocumentInfo docInfo, InputStream stream) {
		FileFormatManager manager = Outliner.fileFormatManager;
		
		String extension = getExtension(PropertyContainerUtil.getPropertyAsString(docInfo, DocumentInfo.KEY_PATH));
		OpenFileFormat format = null;
		String format_name = null;
		
		if (PropertyContainerUtil.getPropertyAsBoolean(docInfo, DocumentInfo.KEY_IMPORTED)) {
			format_name = manager.getImportFileFormatNameForExtension(extension);
			format = manager.getImportFormat(format_name);
		} else {
			format_name = manager.getOpenFileFormatNameForExtension(extension);
			format = manager.getOpenFormat(format_name);
		}
		
		System.out.println("EXTENSION: " + extension);
		System.out.println("FORMAT_NAME: " + format_name);
		PropertyContainerUtil.setPropertyAsString(docInfo, DocumentInfo.KEY_FILE_FORMAT, format.getName());
		
		return format.open(tree, docInfo, stream);
	}