Fix MigLayout 5 issues

This commit is contained in:
Reinhard Pointner 2016-11-20 02:52:01 +08:00
parent 7ac784fa74
commit 01c62f7cc0
2 changed files with 47 additions and 51 deletions

View File

@ -285,7 +285,7 @@ public class Main {
dialog.setContentPane(pane);
pane.add(new JLabel(ResourceManager.getIcon("window.icon.medium")), "aligny top");
pane.add(new JLabel(update.get("message")), "gap 10, wrap paragraph:push");
pane.add(new JLabel(update.get("message")), "aligny top, gap 10, wrap paragraph:push");
pane.add(newButton("Download", ResourceManager.getIcon("dialog.continue"), evt -> {
openURI(update.get("download"));

View File

@ -33,7 +33,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.RunnableFuture;
@ -119,7 +118,7 @@ public class DropToUnlock extends JList<File> {
}
public static boolean showUnlockFoldersDialog(Window owner, Collection<File> files) {
final List<File> model = getParentFolders(files);
List<File> model = getParentFolders(files);
// immediately return if there is nothing that needs to be unlocked
if (model.isEmpty()) {
@ -135,12 +134,10 @@ public class DropToUnlock extends JList<File> {
}
// show selection dialog on EDT
RunnableFuture<Boolean> showPermissionDialog = new FutureTask<Boolean>(new Callable<Boolean>() {
RunnableFuture<Boolean> showPermissionDialog = new FutureTask<Boolean>(() -> {
JDialog dialog = new JDialog(owner);
AtomicBoolean dialogCancelled = new AtomicBoolean(true);
@Override
public Boolean call() throws Exception {
final JDialog dialog = new JDialog(owner);
final AtomicBoolean dialogCancelled = new AtomicBoolean(true);
DropToUnlock d = new DropToUnlock(model) {
@Override
@ -176,7 +173,7 @@ public class DropToUnlock extends JList<File> {
c.add(h, "wmin 150px, hmin 75px, growx, dock north");
c.add(d, "wmin 150px, hmin 150px, grow");
c.add(help, "wmin 150px, hmin 75px, growx, dock south");
c.add(help, "wmin 150px, hmin 75px, growx, aligny center, dock south");
dialog.setModal(true);
dialog.setModalExclusionType(ModalExclusionType.TOOLKIT_EXCLUDE);
@ -195,7 +192,6 @@ public class DropToUnlock extends JList<File> {
// abort if user has closed the window before all folders have been unlocked
return !dialogCancelled.get();
}
});
// show dialog on EDT and wait for user input