int selectedIndex = projectFiles.getSelectedRow();
if (selectedIndex < 0) {
return;
}
BOFile taskFile = (BOFile) projectFiles.getValueAt(selectedIndex, -1);
FileEditorPanel fe = new FileEditorPanel(FileEditorMode.FileCheckIn);
fe.setFile(taskFile);
DialogUtility.showDialog(fe, "CheckIn file", new Dimension(350, 250));
if (fe.getRealFile() == null || fe.getFile() == null) {
return;
}
taskFile.setFileCheckout("");
taskFile.setCheckedOutUser(null);
taskFile.setFileDate(new Date());
BOFile newTaskFile = fe.getFile();
File realFile = fe.getRealFile();
newTaskFile.setTaskID(taskFile.getTaskID());
newTaskFile.setProject((BOProject) lstProjects.getSelectedValue());
newTaskFile.setFileName(newTaskFile.generateFileName());
newTaskFile.setFileVersion(taskFile.getFileVersion() + 1);
newTaskFile.setFileDate(new Date());
try {
fileManager.checkInFile(taskFile, newTaskFile, realFile, ApplicationContext.getCurrentUser());
fileTableModel.updateFileList(fileManager.getAllFile((BOProject) lstProjects.getSelectedValue(), ApplicationContext.getCurrentUser()));
} catch (Throwable a_th) {
a_th.printStackTrace();