Skip to content

Commit c6a61d8

Browse files
committed
Merge branch 'nb81dev'
2 parents d3cc7d7 + 96b311b commit c6a61d8

41 files changed

Lines changed: 451 additions & 315 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
22
OpenIDE-Module: org.netbeans.modules.php.wordpress
33
OpenIDE-Module-Layer: org/netbeans/modules/php/wordpress/resources/layer.xml
44
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/wordpress/Bundle.properties
5-
OpenIDE-Module-Specification-Version: 0.7.4
5+
OpenIDE-Module-Specification-Version: 0.8.1
66
OpenIDE-Module-Install: org/netbeans/modules/php/wordpress/WordPressModuleInstall.class

nbproject/genfiles.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
build.xml.data.CRC32=afe7c087
1+
build.xml.data.CRC32=271f9ae7
22
build.xml.script.CRC32=f6cbff90
3-
build.xml.stylesheet.CRC32=a56c6a5b@2.62.1
3+
build.xml.stylesheet.CRC32=a56c6a5b@2.70.1
44
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
55
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6-
nbproject/build-impl.xml.data.CRC32=afe7c087
6+
nbproject/build-impl.xml.data.CRC32=271f9ae7
77
nbproject/build-impl.xml.script.CRC32=bfa38a5f
8-
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.62.1
8+
nbproject/build-impl.xml.stylesheet.CRC32=238281d1@2.70.1

nbproject/project.xml

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@
2121
<compile-dependency/>
2222
<run-dependency>
2323
<release-version>1</release-version>
24-
<specification-version>1.32.1</specification-version>
24+
<specification-version>1.45.1</specification-version>
25+
</run-dependency>
26+
</dependency>
27+
<dependency>
28+
<code-name-base>org.netbeans.api.progress.nb</code-name-base>
29+
<build-prerequisite/>
30+
<compile-dependency/>
31+
<run-dependency>
32+
<specification-version>1.45.1</specification-version>
33+
</run-dependency>
34+
</dependency>
35+
<dependency>
36+
<code-name-base>org.netbeans.api.templates</code-name-base>
37+
<build-prerequisite/>
38+
<compile-dependency/>
39+
<run-dependency>
40+
<specification-version>1.5.1</specification-version>
2541
</run-dependency>
2642
</dependency>
2743
<dependency>
@@ -48,7 +64,7 @@
4864
<compile-dependency/>
4965
<run-dependency>
5066
<release-version>3</release-version>
51-
<specification-version>1.71.2.5.21.40</specification-version>
67+
<specification-version>1.83.1.5.1.22.43</specification-version>
5268
</run-dependency>
5369
</dependency>
5470
<dependency>
@@ -57,7 +73,7 @@
5773
<compile-dependency/>
5874
<run-dependency>
5975
<release-version>1</release-version>
60-
<specification-version>1.33.1.1</specification-version>
76+
<specification-version>1.42.1.2</specification-version>
6177
</run-dependency>
6278
</dependency>
6379
<dependency>
@@ -75,7 +91,7 @@
7591
<compile-dependency/>
7692
<run-dependency>
7793
<release-version>3</release-version>
78-
<specification-version>3.33.2.21.40</specification-version>
94+
<specification-version>4.2.1.22.1.43</specification-version>
7995
</run-dependency>
8096
</dependency>
8197
<dependency>
@@ -96,6 +112,15 @@
96112
<specification-version>1.39.1</specification-version>
97113
</run-dependency>
98114
</dependency>
115+
<dependency>
116+
<code-name-base>org.netbeans.modules.extexecution.base</code-name-base>
117+
<build-prerequisite/>
118+
<compile-dependency/>
119+
<run-dependency>
120+
<release-version>2</release-version>
121+
<specification-version>1.1.1</specification-version>
122+
</run-dependency>
123+
</dependency>
99124
<dependency>
100125
<code-name-base>org.netbeans.modules.lexer</code-name-base>
101126
<build-prerequisite/>
@@ -123,6 +148,14 @@
123148
<specification-version>1.62.1.6</specification-version>
124149
</run-dependency>
125150
</dependency>
151+
<dependency>
152+
<code-name-base>org.netbeans.modules.parsing.indexing</code-name-base>
153+
<build-prerequisite/>
154+
<compile-dependency/>
155+
<run-dependency>
156+
<specification-version>9.6.1.1.1.8</specification-version>
157+
</run-dependency>
158+
</dependency>
126159
<dependency>
127160
<code-name-base>org.netbeans.modules.php.api.editor</code-name-base>
128161
<build-prerequisite/>
@@ -181,7 +214,7 @@
181214
<compile-dependency/>
182215
<run-dependency>
183216
<release-version>1</release-version>
184-
<specification-version>1.65.1.8</specification-version>
217+
<specification-version>1.85.1.8</specification-version>
185218
</run-dependency>
186219
</dependency>
187220
<dependency>
@@ -213,7 +246,15 @@
213246
<build-prerequisite/>
214247
<compile-dependency/>
215248
<run-dependency>
216-
<specification-version>8.5.1</specification-version>
249+
<specification-version>9.6.1</specification-version>
250+
</run-dependency>
251+
</dependency>
252+
<dependency>
253+
<code-name-base>org.openide.filesystems.nb</code-name-base>
254+
<build-prerequisite/>
255+
<compile-dependency/>
256+
<run-dependency>
257+
<specification-version>9.6.1</specification-version>
217258
</run-dependency>
218259
</dependency>
219260
<dependency>
@@ -261,7 +302,7 @@
261302
<build-prerequisite/>
262303
<compile-dependency/>
263304
<run-dependency>
264-
<specification-version>8.29.1</specification-version>
305+
<specification-version>9.4.1</specification-version>
265306
</run-dependency>
266307
</dependency>
267308
<dependency>
@@ -272,6 +313,14 @@
272313
<specification-version>8.19.1</specification-version>
273314
</run-dependency>
274315
</dependency>
316+
<dependency>
317+
<code-name-base>org.openide.util.ui</code-name-base>
318+
<build-prerequisite/>
319+
<compile-dependency/>
320+
<run-dependency>
321+
<specification-version>9.3.1</specification-version>
322+
</run-dependency>
323+
</dependency>
275324
</module-dependencies>
276325
<test-dependencies>
277326
<test-type>
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
/*
2+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3+
*
4+
* Copyright 2015 Oracle and/or its affiliates. All rights reserved.
5+
*
6+
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7+
* Other names may be trademarks of their respective owners.
8+
*
9+
* The contents of this file are subject to the terms of either the GNU
10+
* General Public License Version 2 only ("GPL") or the Common
11+
* Development and Distribution License("CDDL") (collectively, the
12+
* "License"). You may not use this file except in compliance with the
13+
* License. You can obtain a copy of the License at
14+
* http://www.netbeans.org/cddl-gplv2.html
15+
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16+
* specific language governing permissions and limitations under the
17+
* License. When distributing the software, include this License Header
18+
* Notice in each file and include the License file at
19+
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
20+
* particular file as subject to the "Classpath" exception as provided
21+
* by Oracle in the GPL Version 2 section of the License file that
22+
* accompanied this code. If applicable, add the following below the
23+
* License Header, with the fields enclosed by brackets [] replaced by
24+
* your own identifying information:
25+
* "Portions Copyrighted [year] [name of copyright owner]"
26+
*
27+
* If you wish your version of this file to be governed by only the CDDL
28+
* or only the GPL Version 2, indicate your decision by adding
29+
* "[Contributor] elects to include this software in this distribution
30+
* under the [CDDL or GPL Version 2] license." If you do not indicate a
31+
* single choice of license, a recipient has the option to distribute
32+
* your version of this file under either the CDDL, the GPL Version 2 or
33+
* to extend the choice of license to its licensees as provided above.
34+
* However, if you add GPL Version 2 code and therefore, elected the GPL
35+
* Version 2 license, then the option applies only if the new code is
36+
* made subject to such option by the copyright holder.
37+
*
38+
* Contributor(s):
39+
*
40+
* Portions Copyrighted 2015 Sun Microsystems, Inc.
41+
*/
42+
package org.netbeans.modules.php.wordpress;
43+
44+
import java.io.File;
45+
import java.util.ArrayList;
46+
import java.util.Collection;
47+
import java.util.List;
48+
import javax.swing.event.ChangeListener;
49+
import org.netbeans.modules.php.api.phpmodule.PhpModule;
50+
import org.netbeans.modules.php.spi.phpmodule.ImportantFilesImplementation;
51+
import org.netbeans.modules.php.wordpress.modules.WordPressModule;
52+
import org.openide.filesystems.FileChangeAdapter;
53+
import org.openide.filesystems.FileEvent;
54+
import org.openide.filesystems.FileObject;
55+
import org.openide.filesystems.FileRenameEvent;
56+
import org.openide.filesystems.FileUtil;
57+
import org.openide.util.ChangeSupport;
58+
59+
/**
60+
*
61+
* @author junichi11
62+
*/
63+
public final class ConfigurationFiles extends FileChangeAdapter implements ImportantFilesImplementation {
64+
65+
private final PhpModule phpModule;
66+
private final ChangeSupport changeSupport = new ChangeSupport(this);
67+
68+
// @GuardedBy("this")
69+
private boolean isInitialized = false;
70+
private static final String WP_CONFIG_PHP = "wp-config.php"; // NOI18N
71+
72+
public ConfigurationFiles(PhpModule phpModule) {
73+
assert phpModule != null;
74+
this.phpModule = phpModule;
75+
}
76+
77+
@Override
78+
public Collection<FileInfo> getFiles() {
79+
FileObject wordPressRoot = getWordPressRoot();
80+
List<FileInfo> files = new ArrayList<>();
81+
if (wordPressRoot != null) {
82+
FileObject config = wordPressRoot.getFileObject(WP_CONFIG_PHP);
83+
if (config != null) {
84+
files.add(new FileInfo(config));
85+
}
86+
}
87+
return files;
88+
}
89+
90+
private synchronized FileObject getWordPressRoot() {
91+
WordPressModule wpModuel = WordPressModule.Factory.forPhpModule(phpModule);
92+
FileObject wordPressRoot = wpModuel.getWordPressRootDirecotry();
93+
if (wordPressRoot != null) {
94+
if (!isInitialized) {
95+
FileObject config = wordPressRoot.getFileObject(WP_CONFIG_PHP);
96+
if (config != null) {
97+
isInitialized = true;
98+
addListener(FileUtil.toFile(config));
99+
}
100+
}
101+
}
102+
return wordPressRoot;
103+
}
104+
105+
private void addListener(File path) {
106+
try {
107+
FileUtil.addRecursiveListener(this, path);
108+
} catch (IllegalArgumentException ex) {
109+
// noop, already listening
110+
assert false : path;
111+
}
112+
}
113+
114+
@Override
115+
public void addChangeListener(ChangeListener listener) {
116+
changeSupport.addChangeListener(listener);
117+
}
118+
119+
@Override
120+
public void removeChangeListener(ChangeListener listener) {
121+
changeSupport.removeChangeListener(listener);
122+
}
123+
124+
private void fireChange() {
125+
changeSupport.fireChange();
126+
}
127+
128+
//~ FS
129+
@Override
130+
public void fileRenamed(FileRenameEvent fe) {
131+
fireChange();
132+
}
133+
134+
@Override
135+
public void fileDeleted(FileEvent fe) {
136+
fireChange();
137+
}
138+
139+
@Override
140+
public void fileDataCreated(FileEvent fe) {
141+
fireChange();
142+
}
143+
144+
@Override
145+
public void fileFolderCreated(FileEvent fe) {
146+
fireChange();
147+
}
148+
149+
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@
4545
*
4646
* @author junichi11
4747
*/
48-
public class WordPress {
48+
public final class WordPress {
4949

5050
public static final String WP_ICON_8 = "org/netbeans/modules/php/wordpress/resources/wordpress_icon_8.png"; // NOI18N
5151
public static final String WP_ICON_16 = "org/netbeans/modules/php/wordpress/resources/wordpress_icon_16.png"; // NOI18N
52+
53+
private WordPress() {
54+
}
55+
5256
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public RunCommandAction getRunCommandAction() {
8585

8686
@Override
8787
public List<? extends Action> getActions() {
88-
List<Action> actions = new ArrayList<Action>();
88+
List<Action> actions = new ArrayList<>();
8989
actions.add(CreateThemeAction.getInstance());
9090
actions.add(CreateChildThemeAction.getInstance());
9191
actions.add(CreatePluginAction.getInstance());

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
import java.util.logging.Level;
8585
import java.util.logging.Logger;
8686
import org.netbeans.api.progress.ProgressHandle;
87-
import org.netbeans.api.progress.ProgressHandleFactory;
8887
import org.netbeans.modules.php.api.executable.InvalidPhpExecutableException;
8988
import org.netbeans.modules.php.api.util.StringUtils;
9089
import org.netbeans.modules.php.wordpress.commands.WordPressCli;
@@ -113,7 +112,7 @@ public void restored() {
113112

114113
@Override
115114
public void run() {
116-
ProgressHandle handle = ProgressHandleFactory.createHandle(Bundle.WordPressModule_get_commands());
115+
ProgressHandle handle = ProgressHandle.createHandle(Bundle.WordPressModule_get_commands());
117116
try {
118117
handle.start();
119118
try {

0 commit comments

Comments
 (0)