forked from Haehnchen/idea-php-symfony2-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettingsForm.java
80 lines (64 loc) · 1.97 KB
/
SettingsForm.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
package fr.adrienbrault.idea.symfony2plugin;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
/**
* Created with IntelliJ IDEA.
* User: Lumbendil
* Date: 7/04/13
* Time: 20:11
* To change this template use File | Settings | File Templates.
*/
public class SettingsForm implements Configurable {
private Project project;
private JTextField pathToProjectPanel;
public SettingsForm(@NotNull final Project project)
{
this.project = project;
}
@Nls
@Override
public String getDisplayName() {
return "Symfony2";
}
@Nullable
@Override
public String getHelpTopic() {
return null;
}
@Nullable
@Override
public JComponent createComponent() {
JLabel label = new JLabel("Path to appDevDebugProjectContainer.xml: ");
pathToProjectPanel = new JTextField(getSettings().pathToProjectContainer, 35);
label.setLabelFor(pathToProjectPanel);
JPanel panel = new JPanel();
panel.add(label);
panel.add(pathToProjectPanel);
return panel;
}
@Override
public boolean isModified() {
return true;
}
@Override
public void apply() throws ConfigurationException {
getSettings().pathToProjectContainer = pathToProjectPanel.getText();
}
@Override
public void reset() {
//To change body of implemented methods use File | Settings | File Templates.
}
@Override
public void disposeUIResources() {
//To change body of implemented methods use File | Settings | File Templates.
}
private Settings getSettings()
{
return Settings.getInstance(project);
}
}