private void choosePath(JComponent jc, String function,
			Map<SectionType, String> strings) throws DocumentException,
			NullPointerException, IOException {

		JFileChooser chooser = new JFileChooser(recentPath);
		// setChooser(chooser, function);
		chooser.setFileFilter(getFilter(function));

		int returnVal = chooser.showDialog(null, getApproveText(function));

		String dirPath = chooser.getCurrentDirectory().getPath();
		recentPath = dirPath;
		String filePath = chooser.getSelectedFile().getPath();

		if (returnVal == JFileChooser.APPROVE_OPTION) {
			if (function.equals(Labels.EXPORT_DOC)) {
				PDFHandler.initPdfCreation(jc, filePath, function);
			} else if (function.equals(Labels.SAVE_DOC_AS)) {
				IOHandler.saveFile(filePath, strings);
			} else if (function.equals(Labels.OPEN_DOC)) {
				if (setStringsMap(IOHandler.openFile(filePath))) {
					pcs.firePropertyChange(Labels.LOAD_DOC, true, false);
				}
			}
		} else if (returnVal == JFileChooser.CANCEL_OPTION) {
			// Do nothing
		}
	}