init();
initLayout();
}
private void init() {
projectStartDate = new CalendarADC();
projectStartDate.setFormat(ApplicationContext.getUserPreferences().getDateDisplayFormat());
fileTableMouseAdapter = new FileTableMouseAdapter();
fileActions = new FileActions();
taskFilesPopupMenu = new JPopupMenu();
taskFilesPopupMenu.add(addFileMenu = MenuUtility.getMenuItem("Add new file", fileActions));
addFileMenu.setIcon(IconHelper.getNewIcon());
// taskFilesPopupMenu.add(editFileMenu = MenuUtility.getMenuItem("Edit",
// fileActions));
taskFilesPopupMenu.add(viewFileMenu = MenuUtility.getMenuItem("Download", fileActions));
taskFilesPopupMenu.add(checkOutMenu = MenuUtility.getMenuItem("CheckOut", fileActions));
taskFilesPopupMenu.add(checkInMenu = MenuUtility.getMenuItem("CheckIn", fileActions));
taskFilesPopupMenu.add(versionsFileMenu = MenuUtility.getMenuItem("Show all versions", fileActions));
taskFilesPopupMenu.add(deleteFileMenu = MenuUtility.getMenuItem("Delete", fileActions));
deleteFileMenu.setIcon(IconHelper.getDeleteIcon());
viewFileMenu.setIcon(IconHelper.getDownloadIcon());
checkOutMenu.setIcon(IconHelper.getCheckOutIcon());
checkInMenu.setIcon(IconHelper.getCheckInIcon());
addFileMenu.setIcon(IconHelper.getAddNewFileIcon());
// editFileMenu.setIcon(IconHelper.getEditIcon());
versionsFileMenu.setIcon(IconHelper.getViewAllIcon());
fileManager = FileManagerFactory.getFileManager();
fileTableModel = new FileTableModel(new ArrayList<BOFile>());
projectFiles = new JTable(fileTableModel);
projectFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
FileTableRenderer renderer = new FileTableRenderer();
projectFiles.setDefaultRenderer(String.class, renderer);
projectFiles.addMouseListener(fileTableMouseAdapter);
projectFiles.getColumnModel().getColumn(0).setMaxWidth(10);
projectFiles.getColumnModel().getColumn(0).setPreferredWidth(10);
projectFiles.getColumnModel().getColumn(0).setResizable(false);
buttonBar = new ButtonBar(ButtonBar.ADD | ButtonBar.SAVE | ButtonBar.DELETE | ButtonBar.CANCEL);
buttonBar.enableButton(ButtonBar.SAVE, false);
buttonBar.enableButton(ButtonBar.DELETE, false);
buttonBar.addButtonBarListener(this);
projectManager = ProjectManagerFactory.getProjectManager();
Object[] projectsForSorting = projectManager.getAllProjects(null, ApplicationContext.getCurrentUser()).toArray();
Arrays.sort(projectsForSorting);
lstProjects = new JList(projectsForSorting);
lstProjects.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
projectName = new JTextField();
projectDescription = new JTextArea(2, 5);
BOUser[] users = UserManagerFactory.getUserManager().getAllUsers().toArray(new BOUser[] {});
Arrays.sort(users);
projectOwner = new JComboBox(users);
projectEndDate = new CalendarADC();
projectEndDate.setFormat(ApplicationContext.getUserPreferences().getDateDisplayFormat());
//projectEndDate.setSelectable(true);
projectType = new JComboBox(ProjectType.values());