editButton.addActionListener(new ActionListener() {
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e) {
Report selectedReport = (Report) reportsList.getSelectedValue();
if (selectedReport != null) {
State stateInfo = State.REPORT_EDITOR;
ticketsModel.getCurrentReportModel().setCurrentReport(selectedReport);
ticketsModel.setCurrentState(stateInfo);
}
}
});
removeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Report selectedReport = (Report) reportsList.getSelectedValue();
if (selectedReport != null) {
String message = bundle.getString("tool_window.tickets.reports_list.confirm_report_removal");
int answer = Messages.showYesNoDialog(ApplicationModel.getProject(), message, bundle.getString("dialogs.warning"), Messages.getQuestionIcon());
if (answer == 0) {
ticketsModel.getReportsListModel().removeReport(selectedReport);
}
}
}
});
addButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
State state = State.REPORT_EDITOR;
ticketsModel.getCurrentReportModel().setCurrentReport(new Report());
ticketsModel.setCurrentState(state);
}
});
openButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {