1 | /******************************************************************************* | |
2 | * Copyhacked (H) 2012-2020. | |
3 | * This program and the accompanying materials | |
4 | * are made available under no term at all, use it like | |
5 | * you want, but share and discuss about it | |
6 | * every time possible with every body. | |
7 | * | |
8 | * Contributors: | |
9 | * ron190 at ymail dot com - initial implementation | |
10 | *******************************************************************************/ | |
11 | package com.jsql.view.swing.tree; | |
12 | ||
13 | import com.jsql.model.suspendable.AbstractSuspendable; | |
14 | import com.jsql.view.swing.tree.model.AbstractNodeModel; | |
15 | import com.jsql.view.swing.util.MediatorHelper; | |
16 | ||
17 | import java.awt.event.ActionEvent; | |
18 | import java.awt.event.ActionListener; | |
19 | ||
20 | /** | |
21 | * Action to pause and unpause injection process. | |
22 | */ | |
23 | public class ActionPauseUnpause implements ActionListener { | |
24 | | |
25 | private final AbstractNodeModel nodeModel; | |
26 | ||
27 | public ActionPauseUnpause(AbstractNodeModel nodeModel) { | |
28 | this.nodeModel = nodeModel; | |
29 | } | |
30 | ||
31 | @Override | |
32 | public void actionPerformed(ActionEvent e) { | |
33 | | |
34 | AbstractSuspendable suspendableTask = MediatorHelper.model().getMediatorUtils().getThreadUtil().get(this.nodeModel.getElementDatabase()); | |
35 | | |
36 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
if (suspendableTask == null) { |
37 | return; | |
38 | } | |
39 | | |
40 |
1
1. actionPerformed : negated conditional → NO_COVERAGE |
if (suspendableTask.isPaused()) { |
41 |
1
1. actionPerformed : removed call to com/jsql/model/suspendable/AbstractSuspendable::unpause → NO_COVERAGE |
suspendableTask.unpause(); |
42 | } else { | |
43 |
1
1. actionPerformed : removed call to com/jsql/model/suspendable/AbstractSuspendable::pause → NO_COVERAGE |
suspendableTask.pause(); |
44 | } | |
45 | } | |
46 | } | |
Mutations | ||
36 |
1.1 |
|
40 |
1.1 |
|
41 |
1.1 |
|
43 |
1.1 |