-
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2217 from Haehnchen/feature/auto-configure-button
provide auto configure button inside Settings
- Loading branch information
Showing
2 changed files
with
83 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
import fr.adrienbrault.idea.symfony2plugin.util.IdeHelper; | ||
import fr.adrienbrault.idea.symfony2plugin.util.ProjectUtil; | ||
import fr.adrienbrault.idea.symfony2plugin.webDeployment.WebDeploymentUtil; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.jetbrains.annotations.Nls; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
@@ -24,6 +25,7 @@ | |
import java.awt.event.MouseAdapter; | ||
import java.awt.event.MouseEvent; | ||
import java.awt.event.MouseListener; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Daniel Espendiller <[email protected]> | ||
|
@@ -57,6 +59,7 @@ public class SettingsForm implements Configurable { | |
private JButton buttonReindex; | ||
private JCheckBox enableSchedulerCheckBox; | ||
private JCheckBox featureTwigIcon; | ||
private JButton buttonAutoConfigure; | ||
|
||
public SettingsForm(@NotNull final Project project) { | ||
this.project = project; | ||
|
@@ -67,6 +70,7 @@ public void mouseClicked(MouseEvent e) { | |
IdeHelper.openUrl(Symfony2ProjectComponent.HELP_URL); | ||
} | ||
}); | ||
|
||
} | ||
|
||
@Nls | ||
|
@@ -101,6 +105,19 @@ public void mouseClicked(MouseEvent e) { | |
} | ||
}); | ||
|
||
buttonAutoConfigure.addMouseListener(new MouseAdapter() { | ||
@Override | ||
public void mouseClicked(MouseEvent e) { | ||
super.mouseClicked(e); | ||
List<String> list = IdeHelper.enablePluginAndConfigure(project).stream().map(s -> "- " + s).toList(); | ||
|
||
getSettings().pluginEnabled = true; | ||
updateUIFromSettings(); | ||
|
||
JOptionPane.showMessageDialog(panel1, "Plugin activated and configured with:\n" + StringUtils.join(list, "\n"), "Symfony Plugin", JOptionPane.PLAIN_MESSAGE); | ||
} | ||
}); | ||
|
||
return panel1; | ||
} | ||
|
||
|