提交 99eb31b3 编写于 作者: S Skylot

fix(gui): add dots for progress titles

上级 287275d8
......@@ -79,7 +79,7 @@ public class BackgroundExecutor {
@Override
protected Boolean doInBackground() throws Exception {
progressPane.changeLabel(this, task.getTitle() + ':');
progressPane.changeLabel(this, task.getTitle() + "… ");
progressPane.changeCancelBtnVisible(this, task.canBeCanceled());
progressPane.changeVisibility(this, true);
......@@ -125,7 +125,8 @@ public class BackgroundExecutor {
}
if (isCancelled()) {
executor.shutdownNow();
progressPane.changeLabel(this, task.getTitle() + " (Canceling):");
progressPane.changeLabel(this, task.getTitle() + " (Canceling)… ");
progressPane.changeIndeterminate(this, true);
// force termination
executor.awaitTermination(5, TimeUnit.SECONDS);
return false;
......
......@@ -19,6 +19,6 @@ public class DecompileJob extends BackgroundJob {
@Override
public String getInfoString() {
return NLS.str("progress.decompile");
return NLS.str("progress.decompile") + "… ";
}
}
......@@ -68,6 +68,6 @@ public class IndexJob extends BackgroundJob {
@Override
public String getInfoString() {
return NLS.str("progress.index");
return NLS.str("progress.index") + "… ";
}
}
......@@ -79,6 +79,10 @@ public class ProgressPanel extends JPanel implements PropertyChangeListener {
setVisible(((Boolean) evt.getNewValue()));
break;
case "indeterminate":
setIndeterminate(((Boolean) evt.getNewValue()));
break;
case "cancel-visible":
cancelButton.setVisible(((Boolean) evt.getNewValue()));
break;
......@@ -97,6 +101,10 @@ public class ProgressPanel extends JPanel implements PropertyChangeListener {
task.firePropertyChange("label", null, label);
}
public void changeIndeterminate(SwingWorker<?, ?> task, boolean indeterminate) {
task.firePropertyChange("indeterminate", null, indeterminate);
}
public void changeVisibility(SwingWorker<?, ?> task, boolean visible) {
task.firePropertyChange("visible", null, visible);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册