public RevisionDialog(Path file)
	{
		super(MainFrame.getInstance(), true);

		// Put the relative path in the title
		String relativePath = MainFrame.getInstance().toolbar.locationBar.getText();
		if(!relativePath.endsWith(File.separator))
		{
			relativePath += File.separator;
		}
		relativePath += file.getFileName();
		setTitle("Revision Log: " + relativePath);

		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		setIconImage(new ImageIcon("res/icon.png").getImage());
		setSize(450, 250);

		fileDisplayed = file;

		// Create main panel
		JPanel contentPane = new JPanel(new BorderLayout());

		// Create table columns
		columns = new Vector<>();
		columns.add("Date");
		columns.add("File size");
		columns.add("Delta");

		// Create table
		table = new JTable();
		table.setShowGrid(false);
		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		table.getTableHeader().setReorderingAllowed(false);
		table.addMouseListener(new RevisionTableSelectionListener(this));
		table.addKeyListener(new RevisionTableSelectionListener(this));

		// Create the data model
		DataRetriever revisionRetriever = new DataRetriever(fileDisplayed);
		rows = revisionRetriever.getRevisionInfoTable();
		table.setModel(new DefaultTableModel(rows, columns)
		{
			@Override
			public boolean isCellEditable(int row, int column)
			{
				return false;
			}
		});

		// Set the column widths
		table.getColumnModel().getColumn(0).setMinWidth(115);

		// Create scrollpane for the table
		JScrollPane scrollPane = new JScrollPane(table);
		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
		table.setFillsViewportHeight(true);

		// Create buttons at the bottom
		JPanel buttonPanel = new JPanel(new FlowLayout());
		viewRevisionButton = new JButton("View revision");
		revertRevisionButton = new JButton("Revert revision");
		viewRevisionButton.setEnabled(false);
		revertRevisionButton.setEnabled(false);
		buttonPanel.add(viewRevisionButton);
		buttonPanel.add(revertRevisionButton);

		// And add to the main panel
		contentPane.add(scrollPane, BorderLayout.CENTER);
		contentPane.add(buttonPanel, BorderLayout.SOUTH);
		add(contentPane);

		// Make the enter key active the cell instead of going to the next cell. Basically, we
		// create a new keyboard mapping for the enter key which does nothing, allowing the listener
		// to pick up the enter key later.
		final String solve = "Solve";
		KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
		table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(enter, solve);
		table.getActionMap().put(solve, null);

		// Necessary to revalidate the frame so that we can see the table
		revalidate();

		// Handler for view revision button
		viewRevisionButton.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent arg0)
			{
				if(selectedTimestamp != -1)
				{
					new GuiController().displayRevision(MainFrame.getInstance().selectedFile,
							selectedTimestamp);

					logger.debug("Viewed revision of "
							+ FileOp.convertPath(MainFrame.getInstance().selectedFile).toString()
							+ " @ T = " + selectedTimestamp);
				}
			}
		});

		// Handler for revert revision button
		revertRevisionButton.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent arg0)
			{
				if(selectedTimestamp != -1)
				{
					new GuiController().revertRevision(MainFrame.getInstance().selectedFile,
							selectedTimestamp);
					redrawTable();

					logger.debug("Reverted revision of "
							+ MainFrame.getInstance().selectedFile.toString() + " @ T = "
							+ selectedTimestamp);
				}
			}
		});

		// Auto refresh the revision table every 2 seconds
		new Timer(2000, new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
			{
				long selectedTimestampBackup = selectedTimestamp;

				// Note that this will blank selectedTimestamp
				redrawTable();

				// Reselect the row (if any)
				if(selectedTimestampBackup != -1)
				{
					// Figure out which row is supposed to be selected (by name)
					int selectedRowNumber = -1;
					for(Vector<String> row : rows)
					{
						selectedRowNumber++;
						String fileName = row.get(0);
						if(GuiUtility.unformatDate(fileName) == selectedTimestampBackup)
						{
							// Found the right row
							selectedTimestamp = selectedTimestampBackup;
							revertRevisionButton.setEnabled(true);
							viewRevisionButton.setEnabled(true);
							break;
						}
					}
					table.setRowSelectionInterval(selectedRowNumber, selectedRowNumber);
				}
			}
		}).start();
	}