Skip to content

Commit 7ea50ee

Browse files
committed
Separate the panel for wp-config
1 parent 60d6ee8 commit 7ea50ee

6 files changed

Lines changed: 495 additions & 331 deletions

File tree

src/org/netbeans/modules/php/wordpress/WordPressPhpModuleExtender.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ public boolean isValid() {
161161
if (localFile.isEmpty()) {
162162
// disable all field
163163
panel.setAllEnabled(panel, false);
164-
panel.setAllEnabled(panel.getWpConfigPanel(), false);
165164
errorMessage = Bundle.WordPressPhpModuleExtender_no_installation();
166165
return false;
167166
}
@@ -193,7 +192,6 @@ public String getWarningMessage() {
193192
@Override
194193
public Set<FileObject> extend(PhpModule pm) throws ExtendingException {
195194
panel.setAllEnabled(panel, false);
196-
panel.setAllEnabled(panel.getWpConfigPanel(), false);
197195

198196
FileObject sourceDirectory = pm.getSourceDirectory();
199197
if (panel.useUrl()) {

src/org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,6 @@ NewProjectConfigurationPanel.useLocalFileRadioButton.text=Use Local file
55
NewProjectConfigurationPanel.localFileLabel.text=
66
NewProjectConfigurationPanel.urlLabel.text=
77
NewProjectConfigurationPanel.formatCheckBox.text=Set format to project
8-
NewProjectConfigurationPanel.dbNameTextField.text=
9-
NewProjectConfigurationPanel.dbUserLabel.text=DB_USER:
10-
NewProjectConfigurationPanel.dbUserTextField.text=
11-
NewProjectConfigurationPanel.dbPasswordLabel.text=DB_PASS:
12-
NewProjectConfigurationPanel.dbHostLabel.text=DB_HOST:
13-
NewProjectConfigurationPanel.dbCharsetLabel.text=DB_CHAR:
14-
NewProjectConfigurationPanel.dbCollateLabel.text=DB_COLL:
15-
NewProjectConfigurationPanel.dbCollateLabel.toolTipText=DB_COLLATE
16-
NewProjectConfigurationPanel.dbCharsetLabel.toolTipText=DB_CHARSET
17-
NewProjectConfigurationPanel.dbPasswordLabel.toolTipText=DB_PASSWORD
18-
NewProjectConfigurationPanel.wpConfigPanel.border.title=wp-config
19-
NewProjectConfigurationPanel.dbPasswordTextField.text=
20-
NewProjectConfigurationPanel.dbHostTextField.text=localhost
21-
NewProjectConfigurationPanel.dbCharsetTextField.text=utf8
22-
NewProjectConfigurationPanel.dbCollateTextField.text=
238
NewProjectConfigurationPanel.createConfigCheckBox.text=create wp-config.php
249
CreateUnderscoresThemePanel.authorUriTextField.text=
2510
CreateUnderscoresThemePanel.descriptionTextField.text=
@@ -54,8 +39,23 @@ CreateChildThemePanel.childDirectoryNameLabel.text=Child Directory Name:
5439
CreateChildThemePanel.childDirectoryNameTextField.text=
5540
CreateChildThemePanel.childThemeNameLabel.text=Child Theme Name:
5641
CreateChildThemePanel.childThemeNameTextField.text=
57-
NewProjectConfigurationPanel.dbNameLabel.text=DB_NAME:
5842
CreateMinimumBlankThemePanel.errorMessageLabel.text=ERROR
5943
CreateMinimumBlankThemePanel.themeDirectoryNameTextField.text=
6044
CreateMinimumBlankThemePanel.themeDirectoryNameLabel.text=Theme Directory Name:
6145
CreateMinimumBlankThemePanel.descriptionLabel.text=Just create a style.css and an empty index.php
46+
WpConfigPanel.dbNameLabel.text=DB_NAME:
47+
WpConfigPanel.dbCollateTextField.text=
48+
WpConfigPanel.dbCharsetTextField.text=utf8
49+
WpConfigPanel.dbHostTextField.text=localhost
50+
WpConfigPanel.dbPasswordTextField.text=
51+
WpConfigPanel.dbCollateLabel.toolTipText=DB_COLLATE
52+
WpConfigPanel.dbCollateLabel.text=DB_COLL:
53+
WpConfigPanel.dbCharsetLabel.toolTipText=DB_CHARSET
54+
WpConfigPanel.dbCharsetLabel.text=DB_CHAR:
55+
WpConfigPanel.dbHostLabel.text=DB_HOST:
56+
WpConfigPanel.dbPasswordLabel.toolTipText=DB_PASSWORD
57+
WpConfigPanel.dbPasswordLabel.text=DB_PASS:
58+
WpConfigPanel.dbUserTextField.text=
59+
WpConfigPanel.dbUserLabel.text=DB_USER:
60+
WpConfigPanel.dbNameTextField.text=
61+
NewProjectConfigurationPanel.setWpConfigValuesButton.text=Set wp-config values

src/org/netbeans/modules/php/wordpress/ui/wizards/NewProjectConfigurationPanel.form

Lines changed: 19 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@
4242
<Group type="102" attributes="0">
4343
<Group type="103" groupAlignment="0" attributes="0">
4444
<Component id="formatCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
45-
<Component id="createConfigCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
4645
<Component id="useWpCliRadioButton" alignment="0" min="-2" max="-2" attributes="0"/>
46+
<Group type="102" alignment="0" attributes="0">
47+
<Component id="createConfigCheckBox" min="-2" max="-2" attributes="0"/>
48+
<EmptySpace max="-2" attributes="0"/>
49+
<Component id="setWpConfigValuesButton" min="-2" max="-2" attributes="0"/>
50+
</Group>
4751
</Group>
4852
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
4953
</Group>
5054
</Group>
51-
<EmptySpace max="-2" attributes="0"/>
52-
<Component id="wpConfigPanel" min="-2" max="-2" attributes="0"/>
53-
<EmptySpace max="-2" attributes="0"/>
55+
<EmptySpace min="-2" max="-2" attributes="0"/>
5456
</Group>
5557
</Group>
5658
</DimensionLayout>
@@ -77,10 +79,12 @@
7779
<EmptySpace max="-2" attributes="0"/>
7880
<Component id="formatCheckBox" min="-2" max="-2" attributes="0"/>
7981
<EmptySpace max="-2" attributes="0"/>
80-
<Component id="createConfigCheckBox" min="-2" max="-2" attributes="0"/>
81-
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
82+
<Group type="103" groupAlignment="3" attributes="0">
83+
<Component id="createConfigCheckBox" alignment="3" min="-2" max="-2" attributes="0"/>
84+
<Component id="setWpConfigValuesButton" alignment="3" min="-2" max="-2" attributes="0"/>
85+
</Group>
86+
<EmptySpace min="0" pref="12" max="32767" attributes="0"/>
8287
</Group>
83-
<Component id="wpConfigPanel" alignment="0" max="32767" attributes="0"/>
8488
</Group>
8589
</DimensionLayout>
8690
</Layout>
@@ -158,184 +162,22 @@
158162
</Property>
159163
</Properties>
160164
</Component>
161-
<Container class="javax.swing.JPanel" name="wpConfigPanel">
162-
<Properties>
163-
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
164-
<Border info="org.netbeans.modules.form.compat2.border.TitledBorderInfo">
165-
<TitledBorder title="wp-config">
166-
<ResourceString PropertyName="titleX" bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.wpConfigPanel.border.title" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
167-
</TitledBorder>
168-
</Border>
169-
</Property>
170-
<Property name="autoscrolls" type="boolean" value="true"/>
171-
</Properties>
172-
173-
<Layout>
174-
<DimensionLayout dim="0">
175-
<Group type="103" groupAlignment="0" attributes="0">
176-
<Group type="102" attributes="0">
177-
<Group type="103" groupAlignment="0" attributes="0">
178-
<Component id="dbNameLabel" alignment="0" min="-2" max="-2" attributes="0"/>
179-
<Component id="dbHostLabel" alignment="0" min="-2" max="-2" attributes="0"/>
180-
<Component id="dbCharsetLabel" alignment="0" min="-2" max="-2" attributes="0"/>
181-
<Component id="dbCollateLabel" alignment="0" min="-2" max="-2" attributes="0"/>
182-
<Component id="dbUserLabel" alignment="0" min="-2" max="-2" attributes="0"/>
183-
<Component id="dbPasswordLabel" alignment="0" min="-2" max="-2" attributes="0"/>
184-
</Group>
185-
<EmptySpace max="-2" attributes="0"/>
186-
<Group type="103" groupAlignment="0" attributes="0">
187-
<Component id="dbNameTextField" alignment="0" max="32767" attributes="0"/>
188-
<Component id="dbUserTextField" alignment="0" max="32767" attributes="0"/>
189-
<Component id="dbPasswordTextField" alignment="0" max="32767" attributes="0"/>
190-
<Component id="dbHostTextField" alignment="0" pref="119" max="32767" attributes="0"/>
191-
<Component id="dbCharsetTextField" alignment="0" max="32767" attributes="0"/>
192-
<Component id="dbCollateTextField" alignment="0" max="32767" attributes="0"/>
193-
</Group>
194-
</Group>
195-
</Group>
196-
</DimensionLayout>
197-
<DimensionLayout dim="1">
198-
<Group type="103" groupAlignment="0" attributes="0">
199-
<Group type="102" alignment="0" attributes="0">
200-
<Group type="103" groupAlignment="3" attributes="0">
201-
<Component id="dbNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
202-
<Component id="dbNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
203-
</Group>
204-
<EmptySpace max="-2" attributes="0"/>
205-
<Group type="103" groupAlignment="3" attributes="0">
206-
<Component id="dbUserLabel" alignment="3" min="-2" max="-2" attributes="0"/>
207-
<Component id="dbUserTextField" alignment="3" min="-2" max="-2" attributes="0"/>
208-
</Group>
209-
<EmptySpace max="-2" attributes="0"/>
210-
<Group type="103" groupAlignment="3" attributes="0">
211-
<Component id="dbPasswordLabel" alignment="3" min="-2" max="-2" attributes="0"/>
212-
<Component id="dbPasswordTextField" alignment="3" min="-2" max="-2" attributes="0"/>
213-
</Group>
214-
<EmptySpace max="-2" attributes="0"/>
215-
<Group type="103" groupAlignment="3" attributes="0">
216-
<Component id="dbHostLabel" alignment="3" min="-2" max="-2" attributes="0"/>
217-
<Component id="dbHostTextField" alignment="3" min="-2" max="-2" attributes="0"/>
218-
</Group>
219-
<EmptySpace max="-2" attributes="0"/>
220-
<Group type="103" groupAlignment="3" attributes="0">
221-
<Component id="dbCharsetLabel" alignment="3" min="-2" max="-2" attributes="0"/>
222-
<Component id="dbCharsetTextField" alignment="3" min="-2" max="-2" attributes="0"/>
223-
</Group>
224-
<EmptySpace max="-2" attributes="0"/>
225-
<Group type="103" groupAlignment="3" attributes="0">
226-
<Component id="dbCollateLabel" alignment="3" min="-2" max="-2" attributes="0"/>
227-
<Component id="dbCollateTextField" alignment="3" min="-2" max="-2" attributes="0"/>
228-
</Group>
229-
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
230-
</Group>
231-
</Group>
232-
</DimensionLayout>
233-
</Layout>
234-
<SubComponents>
235-
<Component class="javax.swing.JLabel" name="dbNameLabel">
236-
<Properties>
237-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
238-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbNameLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
239-
</Property>
240-
</Properties>
241-
</Component>
242-
<Component class="javax.swing.JTextField" name="dbNameTextField">
243-
<Properties>
244-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
245-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbNameTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
246-
</Property>
247-
</Properties>
248-
</Component>
249-
<Component class="javax.swing.JLabel" name="dbUserLabel">
250-
<Properties>
251-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
252-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbUserLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
253-
</Property>
254-
</Properties>
255-
</Component>
256-
<Component class="javax.swing.JTextField" name="dbUserTextField">
257-
<Properties>
258-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
259-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbUserTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
260-
</Property>
261-
</Properties>
262-
</Component>
263-
<Component class="javax.swing.JLabel" name="dbPasswordLabel">
264-
<Properties>
265-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
266-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbPasswordLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
267-
</Property>
268-
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
269-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbPasswordLabel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
270-
</Property>
271-
</Properties>
272-
</Component>
273-
<Component class="javax.swing.JLabel" name="dbHostLabel">
274-
<Properties>
275-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
276-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbHostLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
277-
</Property>
278-
</Properties>
279-
</Component>
280-
<Component class="javax.swing.JLabel" name="dbCharsetLabel">
281-
<Properties>
282-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
283-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCharsetLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
284-
</Property>
285-
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
286-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCharsetLabel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
287-
</Property>
288-
</Properties>
289-
</Component>
290-
<Component class="javax.swing.JLabel" name="dbCollateLabel">
291-
<Properties>
292-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
293-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCollateLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
294-
</Property>
295-
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
296-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCollateLabel.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
297-
</Property>
298-
</Properties>
299-
</Component>
300-
<Component class="javax.swing.JTextField" name="dbPasswordTextField">
301-
<Properties>
302-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
303-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbPasswordTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
304-
</Property>
305-
</Properties>
306-
</Component>
307-
<Component class="javax.swing.JTextField" name="dbHostTextField">
308-
<Properties>
309-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
310-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbHostTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
311-
</Property>
312-
</Properties>
313-
</Component>
314-
<Component class="javax.swing.JTextField" name="dbCharsetTextField">
315-
<Properties>
316-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
317-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCharsetTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
318-
</Property>
319-
</Properties>
320-
</Component>
321-
<Component class="javax.swing.JTextField" name="dbCollateTextField">
322-
<Properties>
323-
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
324-
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.dbCollateTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
325-
</Property>
326-
</Properties>
327-
</Component>
328-
</SubComponents>
329-
</Container>
330165
<Component class="javax.swing.JCheckBox" name="createConfigCheckBox">
331166
<Properties>
332167
<Property name="selected" type="boolean" value="true"/>
333168
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
334169
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.createConfigCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
335170
</Property>
336171
</Properties>
172+
</Component>
173+
<Component class="javax.swing.JButton" name="setWpConfigValuesButton">
174+
<Properties>
175+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
176+
<ResourceString bundle="org/netbeans/modules/php/wordpress/ui/wizards/Bundle.properties" key="NewProjectConfigurationPanel.setWpConfigValuesButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
177+
</Property>
178+
</Properties>
337179
<Events>
338-
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="createConfigCheckBoxActionPerformed"/>
180+
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="setWpConfigValuesButtonActionPerformed"/>
339181
</Events>
340182
</Component>
341183
</SubComponents>

0 commit comments

Comments
 (0)