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
|
@Override
|
||||||
public Future<Boolean> showOptions(List<IOptionDetails> opts) {
|
public Future<Boolean> showOptions(List<IOptionDetails> opts) {
|
||||||
CompletableFuture<Boolean> future = new CompletableFuture<Boolean>();
|
CompletableFuture<Boolean> future = new CompletableFuture<>();
|
||||||
OptionsSelectWindow dialog = new OptionsSelectWindow(opts, future);
|
OptionsSelectWindow dialog = new OptionsSelectWindow(opts, future);
|
||||||
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||||
dialog.setVisible(true);
|
dialog.setVisible(true);
|
||||||
|
@ -5,7 +5,7 @@ public class OptionTempHandler implements IOptionDetails {
|
|||||||
private final IOptionDetails opt;
|
private final IOptionDetails opt;
|
||||||
private boolean tempValue;
|
private boolean tempValue;
|
||||||
|
|
||||||
public OptionTempHandler(IOptionDetails opt) {
|
OptionTempHandler(IOptionDetails opt) {
|
||||||
this.opt = opt;
|
this.opt = opt;
|
||||||
tempValue = opt.getOptionValue();
|
tempValue = opt.getOptionValue();
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ public class OptionTempHandler implements IOptionDetails {
|
|||||||
tempValue = value;
|
tempValue = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finalise() {
|
void finalise() {
|
||||||
opt.setOptionValue(tempValue);
|
opt.setOptionValue(tempValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
public class OptionsSelectWindow extends JDialog implements ActionListener {
|
public class OptionsSelectWindow extends JDialog implements ActionListener {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final JPanel contentPanel = new JPanel();
|
|
||||||
private final JLabel lblOptionDescription;
|
private final JLabel lblOptionDescription;
|
||||||
private final OptionTableModel tableModel;
|
private final OptionTableModel tableModel;
|
||||||
private final CompletableFuture<Boolean> future;
|
private final CompletableFuture<Boolean> future;
|
||||||
@ -26,7 +25,7 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
|||||||
/**
|
/**
|
||||||
* Create the dialog.
|
* Create the dialog.
|
||||||
*/
|
*/
|
||||||
public OptionsSelectWindow(List<IOptionDetails> optList, CompletableFuture<Boolean> future) {
|
OptionsSelectWindow(List<IOptionDetails> optList, CompletableFuture<Boolean> future) {
|
||||||
tableModel = new OptionTableModel(optList);
|
tableModel = new OptionTableModel(optList);
|
||||||
this.future = future;
|
this.future = future;
|
||||||
|
|
||||||
@ -34,6 +33,7 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
|||||||
setTitle("Select optional mods...");
|
setTitle("Select optional mods...");
|
||||||
setBounds(100, 100, 450, 300);
|
setBounds(100, 100, 450, 300);
|
||||||
getContentPane().setLayout(new BorderLayout());
|
getContentPane().setLayout(new BorderLayout());
|
||||||
|
JPanel contentPanel = new JPanel();
|
||||||
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||||
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
||||||
contentPanel.setLayout(new BorderLayout(0, 0));
|
contentPanel.setLayout(new BorderLayout(0, 0));
|
||||||
@ -114,10 +114,10 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private class OptionTableModel implements TableModel {
|
private static class OptionTableModel implements TableModel {
|
||||||
private List<OptionTempHandler> opts = new ArrayList<OptionTempHandler>();
|
private List<OptionTempHandler> opts = new ArrayList<>();
|
||||||
|
|
||||||
public OptionTableModel(List<IOptionDetails> givenOpts) {
|
OptionTableModel(List<IOptionDetails> givenOpts) {
|
||||||
for (IOptionDetails opt : givenOpts) {
|
for (IOptionDetails opt : givenOpts) {
|
||||||
opts.add(new OptionTempHandler(opt));
|
opts.add(new OptionTempHandler(opt));
|
||||||
}
|
}
|
||||||
@ -173,11 +173,11 @@ public class OptionsSelectWindow extends JDialog implements ActionListener {
|
|||||||
@Override
|
@Override
|
||||||
public void removeTableModelListener(TableModelListener l) {}
|
public void removeTableModelListener(TableModelListener l) {}
|
||||||
|
|
||||||
public String getDescription(int rowIndex) {
|
String getDescription(int rowIndex) {
|
||||||
return opts.get(rowIndex).getOptionDescription();
|
return opts.get(rowIndex).getOptionDescription();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finalise() {
|
void finalise() {
|
||||||
for (OptionTempHandler opt : opts) {
|
for (OptionTempHandler opt : opts) {
|
||||||
opt.finalise();
|
opt.finalise();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user