Lines 12-17
Link Here
|
12 |
*/ |
12 |
*/ |
13 |
|
13 |
|
14 |
package org.netbeans.modules.j2ee.deployment.config; |
14 |
package org.netbeans.modules.j2ee.deployment.config; |
|
|
15 |
|
16 |
import java.beans.PropertyChangeEvent; |
17 |
import java.beans.PropertyChangeListener; |
15 |
import java.io.File; |
18 |
import java.io.File; |
16 |
import java.io.IOException; |
19 |
import java.io.IOException; |
17 |
import java.io.OutputStream; |
20 |
import java.io.OutputStream; |
Lines 57-63
Link Here
|
57 |
// case when provider does not associate with any server. |
60 |
// case when provider does not associate with any server. |
58 |
|
61 |
|
59 |
public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport, |
62 |
public final class ConfigSupportImpl implements J2eeModuleProvider.ConfigSupport, |
60 |
DeploymentConfigurationProvider { |
63 |
DeploymentConfigurationProvider, PropertyChangeListener { |
61 |
|
64 |
|
62 |
private static final File[] EMPTY_FILE_LIST = new File[0]; |
65 |
private static final File[] EMPTY_FILE_LIST = new File[0]; |
63 |
private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N |
66 |
private static final String GENERIC_EXTENSION = ".dpf"; // NOI18N |
Lines 81-86
Link Here
|
81 |
server = instance != null |
84 |
server = instance != null |
82 |
? instance.getServer() |
85 |
? instance.getServer() |
83 |
: ServerRegistry.getInstance().getServer(provider.getServerID()); |
86 |
: ServerRegistry.getInstance().getServer(provider.getServerID()); |
|
|
87 |
provider.addPropertyChangeListener(this); |
84 |
} |
88 |
} |
85 |
|
89 |
|
86 |
/** |
90 |
/** |
Lines 159-164
Link Here
|
159 |
|
163 |
|
160 |
/** dispose all created deployment configurations */ |
164 |
/** dispose all created deployment configurations */ |
161 |
public void dispose() { |
165 |
public void dispose() { |
|
|
166 |
provider.removePropertyChangeListener(this); |
162 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
167 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
163 |
if (deploymentConfiguration != null && serverConfig != null) { |
168 |
if (deploymentConfiguration != null && serverConfig != null) { |
164 |
serverConfig.disposeConfiguration(deploymentConfiguration); |
169 |
serverConfig.disposeConfiguration(deploymentConfiguration); |
Lines 472-476
Link Here
|
472 |
collectData(server, allRelativePaths); |
477 |
collectData(server, allRelativePaths); |
473 |
} |
478 |
} |
474 |
return allRelativePaths; |
479 |
return allRelativePaths; |
|
|
480 |
} |
481 |
|
482 |
public void propertyChange(PropertyChangeEvent evt) { |
483 |
if (J2eeModuleProvider.PROP_ENTERPRISE_RESOURCE_DIRECTORY.equals(evt.getPropertyName())) { |
484 |
DeploymentConfiguration config = getDeploymentConfiguration(); |
485 |
ConfigurationSupport serverConfig = server.getConfigurationSupport(); |
486 |
Object newValue = evt.getNewValue(); |
487 |
if (!(newValue instanceof File)) { |
488 |
throw new IllegalArgumentException("Enterprise resource directory property value is not a File"); // NIO18N |
489 |
} |
490 |
serverConfig.updateResourceDir(config, (File)newValue); |
491 |
} |
475 |
} |
492 |
} |
476 |
} |
493 |
} |