Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: aa65257b2a7e60f7bf9ee9478629ba49cd61192d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.eclipse.papyrus.infra.nattable.manager;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;

import org.eclipse.papyrus.infra.nattable.Activator;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.utils.CSVPasteHelper;


public class ImportAxisInNattableManager extends AbstractPasteImportInNattableManager {

	/**
	 * the file to import
	 */
	private File file;

	/**
	 * 
	 * Constructor.
	 * 
	 * @param tableManager
	 * @param pasteHelper
	 * @param fileToImport
	 * @param useProgressMonitorDialog
	 */
	public ImportAxisInNattableManager(INattableModelManager tableManager, CSVPasteHelper pasteHelper, final File fileToImport, boolean useProgressMonitorDialog) {
		super(tableManager, pasteHelper, useProgressMonitorDialog);
		this.file = fileToImport;
	}

	/**
	 * 
	 * @see org.eclipse.papyrus.infra.nattable.manager.AbstractPasteImportInNattableManager#createReader()
	 * 
	 * @return
	 */
	@Override
	protected Reader createReader() {
		FileReader reader = null;
		try {
			reader = new FileReader(file);
		} catch (FileNotFoundException e) {
			Activator.log.error(e);
		}
		return reader;
	}

	/**
	 * 
	 * @see org.eclipse.papyrus.infra.nattable.manager.AbstractPasteImportInNattableManager#getDataSize()
	 * 
	 * @return
	 */
	@Override
	protected long getDataSize() {
		return this.file.length();
	}

}

Back to the top