Skip to content

Commit

Permalink
'#1993: Disable pause button until workers are created.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Nov 23, 2023
1 parent 8bbab3b commit 830b0ef
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public ProgressFrame(UIPropertyListenerProvider task) {

pause = new JButton(Messages.getString("ProgressFrame.Pause")); //$NON-NLS-1$
pause.addActionListener(this);
pause.setEnabled(false);

openApp = new JButton(Messages.getString("ProgressFrame.OpenApp")); //$NON-NLS-1$
openApp.addActionListener(this);
Expand Down Expand Up @@ -266,6 +267,7 @@ public void propertyChange(PropertyChangeEvent evt) {
workers = (Worker[]) evt.getNewValue();
lastWorkerTaskItemId = new String[workers.length];
lastWorkerTime = new long[workers.length];
pause.setEnabled(true);
}

}
Expand Down Expand Up @@ -647,7 +649,7 @@ private void finishTable(StringBuilder sb) {

@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(pause)) {
if (e.getSource().equals(pause) && workers != null) {
paused = !paused;
if (paused)
pause.setText(Messages.getString("ProgressFrame.Continue")); //$NON-NLS-1$
Expand Down

0 comments on commit 830b0ef

Please sign in to comment.