/
ConfigurationView.java
executable file
·83 lines (66 loc) · 2.32 KB
/
ConfigurationView.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package cn.bestwu.intellij.plugins.gradle.codeInsight.completion.config;
import java.util.HashSet;
import java.util.Set;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.JTextField;
import org.jetbrains.idea.maven.model.MavenRemoteRepository;
public class ConfigurationView {
private JPanel nexusPanel;
private JButton resetButton;
private JCheckBox useNexus;
private JTextField nexusSearchUrlField;
private JPanel dpPanel;
private JPanel mavenIndexPanel;
private JCheckBox useMavenIndex;
// private JButton addRemoteRepo;
private Set<MavenRemoteRepository> remoteRepositories = new HashSet<>();
public ConfigurationView() {
useNexus.addActionListener(
actionEvent -> nexusSearchUrlField.setEnabled(useNexus.isSelected()));
// useMavenIndex.addActionListener(
// actionEvent -> addRemoteRepo.setEnabled(useMavenIndex.isSelected()));
// addRemoteRepo.addActionListener(e -> {
// final RemoteRepositoryEditor repositoryEditor = new RemoteRepositoryEditor(
// "Add Maven Remote Repository", "", "", new EditValidator());
// if (repositoryEditor.showAndGet()) {
// remoteRepositories.add(new MavenRemoteRepository(repositoryEditor.getName(), null,
// repositoryEditor.getValue(), null, null, null));
// }
// });
}
public JPanel getDpPanel() {
return dpPanel;
}
public String getNexusSearchUrlField() {
return nexusSearchUrlField.getText();
}
public void setNexusSearchUrlField(String nexusSearchUrlField) {
this.nexusSearchUrlField.setText(nexusSearchUrlField);
}
public boolean getUseNexus() {
return useNexus.isSelected();
}
public void setUseNexus(boolean selected) {
useNexus.setSelected(selected);
nexusSearchUrlField.setEnabled(selected);
}
public Set<MavenRemoteRepository> getRemoteRepositories() {
return remoteRepositories;
}
public void setRemoteRepositories(
Set<MavenRemoteRepository> remoteRepositories) {
this.remoteRepositories = remoteRepositories;
}
public boolean getUseMavenIndex() {
return useMavenIndex.isSelected();
}
public void setUseMavenIndex(boolean selected) {
useMavenIndex.setSelected(selected);
// addRemoteRepo.setEnabled(selected);
}
public JButton getResetButton() {
return resetButton;
}
}