Skip to content

#2427 inline generated form code #2430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 134 additions & 15 deletions src/main/java/fr/adrienbrault/idea/symfony2plugin/SettingsForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.vfs.VfsUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;
import fr.adrienbrault.idea.symfony2plugin.stubs.util.IndexUtil;
import fr.adrienbrault.idea.symfony2plugin.util.IdeHelper;
import fr.adrienbrault.idea.symfony2plugin.util.ProjectUtil;
Expand All @@ -21,6 +26,7 @@
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
Expand Down Expand Up @@ -126,21 +132,21 @@ public void mouseClicked(MouseEvent e) {
public boolean isModified() {
return
!pluginEnabled.isSelected() == getSettings().pluginEnabled
|| !pathToTranslationRootTextField.getText().equals(getSettings().pathToTranslation)
|| !enableSchedulerCheckBox.isSelected() == getSettings().remoteDevFileScheduler

|| !codeFoldingPhpRoute.isSelected() == getSettings().codeFoldingPhpRoute
|| !codeFoldingPhpModel.isSelected() == getSettings().codeFoldingPhpModel
|| !codeFoldingPhpTemplate.isSelected() == getSettings().codeFoldingPhpTemplate
|| !codeFoldingTwigRoute.isSelected() == getSettings().codeFoldingTwigRoute
|| !codeFoldingTwigTemplate.isSelected() == getSettings().codeFoldingTwigTemplate
|| !codeFoldingTwigConstant.isSelected() == getSettings().codeFoldingTwigConstant
|| !featureTwigIcon.isSelected() == getSettings().featureTwigIcon
|| !featureTypeProvider.isSelected() == getSettings().featureTypeProvider

|| !directoryToApp.getText().equals(getSettings().directoryToApp)
|| !directoryToWeb.getText().equals(getSettings().directoryToWeb)
;
|| !pathToTranslationRootTextField.getText().equals(getSettings().pathToTranslation)
|| !enableSchedulerCheckBox.isSelected() == getSettings().remoteDevFileScheduler

|| !codeFoldingPhpRoute.isSelected() == getSettings().codeFoldingPhpRoute
|| !codeFoldingPhpModel.isSelected() == getSettings().codeFoldingPhpModel
|| !codeFoldingPhpTemplate.isSelected() == getSettings().codeFoldingPhpTemplate
|| !codeFoldingTwigRoute.isSelected() == getSettings().codeFoldingTwigRoute
|| !codeFoldingTwigTemplate.isSelected() == getSettings().codeFoldingTwigTemplate
|| !codeFoldingTwigConstant.isSelected() == getSettings().codeFoldingTwigConstant
|| !featureTwigIcon.isSelected() == getSettings().featureTwigIcon
|| !featureTypeProvider.isSelected() == getSettings().featureTypeProvider

|| !directoryToApp.getText().equals(getSettings().directoryToApp)
|| !directoryToWeb.getText().equals(getSettings().directoryToWeb)
;
}

@Override
Expand Down Expand Up @@ -251,4 +257,117 @@ public static void show(@NotNull Project project) {
ShowSettingsUtilImpl.showSettingsDialog(project, "Symfony2.SettingsForm", null);
}

{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}

/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(2, 5, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel2 = new JPanel();
panel2.setLayout(new FormLayout("fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow", "center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:6dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
panel1.add(panel2, new GridConstraints(1, 0, 1, 5, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
directoryToWebLabel = new JLabel();
directoryToWebLabel.setText("Web Directory");
CellConstraints cc = new CellConstraints();
panel2.add(directoryToWebLabel, cc.xy(1, 3));
directoryToWeb = new TextFieldWithBrowseButton();
panel2.add(directoryToWeb, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
directoryToWebReset = new JButton();
directoryToWebReset.setText("Default");
panel2.add(directoryToWebReset, cc.xy(5, 3));
final JLabel label1 = new JLabel();
label1.setText("Translation Root Path");
panel2.add(label1, cc.xy(1, 1));
pathToTranslationRootTextField = new TextFieldWithBrowseButton();
panel2.add(pathToTranslationRootTextField, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
pathToTranslationRootTextFieldReset = new JButton();
pathToTranslationRootTextFieldReset.setText("Default");
panel2.add(pathToTranslationRootTextFieldReset, cc.xy(5, 1));
final JLabel label2 = new JLabel();
label2.setText("Code Folding");
panel2.add(label2, cc.xy(3, 9));
codeFoldingPhpRoute = new JCheckBox();
codeFoldingPhpRoute.setText("Route (PHP)");
panel2.add(codeFoldingPhpRoute, cc.xy(3, 11));
codeFoldingPhpModel = new JCheckBox();
codeFoldingPhpModel.setText("Repository Entity (PHP)");
panel2.add(codeFoldingPhpModel, cc.xy(3, 13));
codeFoldingTwigRoute = new JCheckBox();
codeFoldingTwigRoute.setText("Route (Twig)");
panel2.add(codeFoldingTwigRoute, cc.xy(3, 17));
codeFoldingPhpTemplate = new JCheckBox();
codeFoldingPhpTemplate.setText("Template (PHP)");
panel2.add(codeFoldingPhpTemplate, cc.xy(3, 15));
codeFoldingTwigTemplate = new JCheckBox();
codeFoldingTwigTemplate.setText("Template (Twig)");
panel2.add(codeFoldingTwigTemplate, cc.xy(3, 19));
codeFoldingTwigConstant = new JCheckBox();
codeFoldingTwigConstant.setText("Constant (Twig)");
panel2.add(codeFoldingTwigConstant, cc.xy(3, 21));
enableSchedulerCheckBox = new JCheckBox();
enableSchedulerCheckBox.setText("Enable 5min scheduler (reopen Project after change)");
enableSchedulerCheckBox.setMnemonic('S');
enableSchedulerCheckBox.setDisplayedMnemonicIndex(12);
panel2.add(enableSchedulerCheckBox, cc.xy(3, 5));
final JLabel label3 = new JLabel();
label3.setText("Download remote files (exp.)");
panel2.add(label3, cc.xy(1, 5));
final JLabel label4 = new JLabel();
label4.setText("Custom Features");
panel2.add(label4, cc.xy(3, 23));
featureTwigIcon = new JCheckBox();
featureTwigIcon.setText("Twig Icon Decoration");
featureTwigIcon.setToolTipText("Decorate Twig file icons with layer to show possible content type");
panel2.add(featureTwigIcon, cc.xy(3, 25));
directoryToAppLabel = new JLabel();
directoryToAppLabel.setText("App Directory");
panel2.add(directoryToAppLabel, cc.xy(1, 31));
directoryToApp = new TextFieldWithBrowseButton();
panel2.add(directoryToApp, cc.xy(3, 31, CellConstraints.FILL, CellConstraints.DEFAULT));
directoryToAppReset = new JButton();
directoryToAppReset.setText("Default");
panel2.add(directoryToAppReset, cc.xy(5, 31));
final JLabel label5 = new JLabel();
label5.setText("Legacy Features");
panel2.add(label5, cc.xy(1, 29));
featureTypeProvider = new JCheckBox();
featureTypeProvider.setText("Type Provider");
featureTypeProvider.setToolTipText("Resolve return type via parameter eg \"ContainerInterface::get, EntityManager::find\"");
panel2.add(featureTypeProvider, cc.xy(3, 27));
pluginEnabled = new JCheckBox();
pluginEnabled.setText("Enable for Project (needs restart)");
panel1.add(pluginEnabled, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonHelp = new JButton();
buttonHelp.setHorizontalAlignment(0);
buttonHelp.setHorizontalTextPosition(4);
buttonHelp.setText("Project Page / Documentation");
panel1.add(buttonHelp, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_EAST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonReindex = new JButton();
buttonReindex.setText("Clear Index");
panel1.add(buttonReindex, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
buttonAutoConfigure = new JButton();
buttonAutoConfigure.setText("Auto Configure");
panel1.add(buttonAutoConfigure, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
}

/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return panel1;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<grid id="27dc6" binding="mainPanel" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="570" height="400"/>
<xy x="20" y="20" width="665" height="400"/>
</constraints>
<properties/>
<border type="none"/>
Expand Down
Loading