mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 13:06:30 +02:00
Make intellij happy
This commit is contained in:
parent
54fd84a6d8
commit
37a1464e11
@ -163,7 +163,7 @@ public class InstallWindow implements IUserInterface {
|
||||
|
||||
@Override
|
||||
public Future<Boolean> showOptions(List<IOptionDetails> opts) {
|
||||
CompletableFuture<Boolean> future = new CompletableFuture<Boolean>();
|
||||
CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||
OptionsSelectWindow dialog = new OptionsSelectWindow(opts, future);
|
||||
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
dialog.setVisible(true);
|
||||
|
@ -5,7 +5,7 @@ public class OptionTempHandler implements IOptionDetails {
|
||||
private final IOptionDetails opt;
|
||||
private boolean tempValue;
|
||||
|
||||
public OptionTempHandler(IOptionDetails opt) {
|
||||
OptionTempHandler(IOptionDetails opt) {
|
||||
this.opt = opt;
|
||||
tempValue = opt.getOptionValue();
|
||||
}
|
||||
@ -26,7 +26,7 @@ public class OptionTempHandler implements IOptionDetails {
|
||||
tempValue = value;
|
||||
}
|
||||
|
||||
public void finalise() {
|
||||
void finalise() {
|
||||
opt.setOptionValue(tempValue);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,6 @@ import java.util.concurrent.CompletableFuture;
|
||||
public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private final JPanel contentPanel = new JPanel();
|
||||
private final JLabel lblOptionDescription;
|
||||
private final OptionTableModel tableModel;
|
||||
private final CompletableFuture<Boolean> future;
|
||||
@ -26,7 +25,7 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||
/**
|
||||
* Create the dialog.
|
||||
*/
|
||||
public OptionsSelectWindow(List<IOptionDetails> optList, CompletableFuture<Boolean> future) {
|
||||
OptionsSelectWindow(List<IOptionDetails> optList, CompletableFuture<Boolean> future) {
|
||||
tableModel = new OptionTableModel(optList);
|
||||
this.future = future;
|
||||
|
||||
@ -34,6 +33,7 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||
setTitle("Select optional mods...");
|
||||
setBounds(100, 100, 450, 300);
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
JPanel contentPanel = new JPanel();
|
||||
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
||||
contentPanel.setLayout(new BorderLayout(0, 0));
|
||||
@ -114,10 +114,10 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||
});
|
||||
}
|
||||
|
||||
private class OptionTableModel implements TableModel {
|
||||
private List<OptionTempHandler> opts = new ArrayList<OptionTempHandler>();
|
||||
private static class OptionTableModel implements TableModel {
|
||||
private List<OptionTempHandler> opts = new ArrayList<>();
|
||||
|
||||
public OptionTableModel(List<IOptionDetails> givenOpts) {
|
||||
OptionTableModel(List<IOptionDetails> givenOpts) {
|
||||
for (IOptionDetails opt : givenOpts) {
|
||||
opts.add(new OptionTempHandler(opt));
|
||||
}
|
||||
@ -173,11 +173,11 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||
@Override
|
||||
public void removeTableModelListener(TableModelListener l) {}
|
||||
|
||||
public String getDescription(int rowIndex) {
|
||||
String getDescription(int rowIndex) {
|
||||
return opts.get(rowIndex).getOptionDescription();
|
||||
}
|
||||
|
||||
public void finalise() {
|
||||
void finalise() {
|
||||
for (OptionTempHandler opt : opts) {
|
||||
opt.finalise();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user