use of com.intellij.openapi.util.UserDataHolderBase in project intellij-community by JetBrains.
the class XsltCommandLineState method createJavaParameters.
protected SimpleJavaParameters createJavaParameters() throws ExecutionException {
final Sdk jdk = myXsltRunConfiguration.getEffectiveJDK();
if (jdk == null) {
throw CantRunException.noJdkConfigured();
}
final SimpleJavaParameters parameters = new SimpleJavaParameters();
parameters.setJdk(jdk);
if (myXsltRunConfiguration.getJdkChoice() == XsltRunConfiguration.JdkChoice.FROM_MODULE) {
final Module module = myXsltRunConfiguration.getEffectiveModule();
// OK to run as if just a JDK has been selected (a missing JDK would already have been complained about above)
if (module != null) {
OrderEnumerator.orderEntries(module).productionOnly().recursively().classes().collectPaths(parameters.getClassPath());
}
}
final ParametersList vmParameters = parameters.getVMParametersList();
vmParameters.addParametersString(myXsltRunConfiguration.myVmArguments);
if (isEmpty(myXsltRunConfiguration.getXsltFile())) {
throw new CantRunException("No XSLT file selected");
}
vmParameters.defineProperty("xslt.file", myXsltRunConfiguration.getXsltFile());
if (isEmpty(myXsltRunConfiguration.getXmlInputFile())) {
throw new CantRunException("No XML input file selected");
}
vmParameters.defineProperty("xslt.input", myXsltRunConfiguration.getXmlInputFile());
final XsltRunConfiguration.OutputType outputType = myXsltRunConfiguration.getOutputType();
if (outputType == XsltRunConfiguration.OutputType.CONSOLE) {
//noinspection deprecation
myPort = NetUtils.tryToFindAvailableSocketPort(myXsltRunConfiguration.myRunnerPort);
vmParameters.defineProperty("xslt.listen-port", String.valueOf(myPort));
}
if (myXsltRunConfiguration.isSaveToFile()) {
vmParameters.defineProperty("xslt.output", myXsltRunConfiguration.myOutputFile);
}
for (Pair<String, String> pair : myXsltRunConfiguration.getParameters()) {
final String name = pair.getFirst();
final String value = pair.getSecond();
if (isEmpty(name) || value == null)
continue;
vmParameters.defineProperty("xslt.param." + name, value);
}
vmParameters.defineProperty("xslt.smart-error-handling", String.valueOf(myXsltRunConfiguration.mySmartErrorHandling));
final PluginId pluginId = PluginManagerCore.getPluginByClassName(getClass().getName());
assert pluginId != null || System.getProperty("xslt.plugin.path") != null : "PluginId not found - development builds need to specify -Dxslt.plugin.path=../out/classes/production/xslt-rt";
final File pluginPath;
if (pluginId != null) {
final IdeaPluginDescriptor descriptor = PluginManager.getPlugin(pluginId);
assert descriptor != null;
pluginPath = descriptor.getPath();
} else {
// -Dxslt.plugin.path=C:\work\java\intellij/ultimate\out\classes\production\xslt-rt
pluginPath = new File(System.getProperty("xslt.plugin.path"));
}
LOG.debug("Plugin Path = " + pluginPath.getAbsolutePath());
final char c = File.separatorChar;
File rtClasspath = new File(pluginPath, "lib" + c + "rt" + c + "xslt-rt.jar");
// File rtClasspath = new File("C:/Demetra/plugins/xpath/lib/rt/xslt-rt.jar");
if (!rtClasspath.exists()) {
LOG.warn("Plugin's Runtime classes not found in " + rtClasspath.getAbsolutePath());
if (!(rtClasspath = new File(pluginPath, "classes")).exists()) {
if (ApplicationManagerEx.getApplicationEx().isInternal() && new File(pluginPath, "org").exists()) {
rtClasspath = pluginPath;
} else {
throw new CantRunException("Runtime classes not found");
}
}
parameters.getVMParametersList().prepend("-ea");
}
parameters.getClassPath().addTail(rtClasspath.getAbsolutePath());
parameters.setMainClass("org.intellij.plugins.xslt.run.rt.XSLTRunner");
if (isEmpty(myXsltRunConfiguration.myWorkingDirectory)) {
parameters.setWorkingDirectory(new File(myXsltRunConfiguration.getXsltFile()).getParentFile().getAbsolutePath());
} else {
parameters.setWorkingDirectory(expandPath(myXsltRunConfiguration.myWorkingDirectory, myXsltRunConfiguration.getEffectiveModule(), myXsltRunConfiguration.getProject()));
}
myExtensionData = new UserDataHolderBase();
final List<XsltRunnerExtension> extensions = XsltRunnerExtension.getExtensions(myXsltRunConfiguration, myIsDebugger);
for (XsltRunnerExtension extension : extensions) {
extension.patchParameters(parameters, myXsltRunConfiguration, myExtensionData);
}
parameters.setUseDynamicClasspath(JdkUtil.useDynamicClasspath(myXsltRunConfiguration.getProject()));
return parameters;
}
use of com.intellij.openapi.util.UserDataHolderBase in project intellij-community by JetBrains.
the class DataNode method readObject.
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
myChildrenView = Collections.unmodifiableList(myChildren);
myUserData = new UserDataHolderBase();
}
use of com.intellij.openapi.util.UserDataHolderBase in project intellij-community by JetBrains.
the class ProjectFacetsConfigurator method getSharedModuleData.
private UserDataHolder getSharedModuleData(final Module module) {
UserDataHolder dataHolder = mySharedModuleData.get(module);
if (dataHolder == null) {
dataHolder = new UserDataHolderBase();
mySharedModuleData.put(module, dataHolder);
}
return dataHolder;
}
use of com.intellij.openapi.util.UserDataHolderBase in project intellij-community by JetBrains.
the class RemoteConnectionCredentialsWrapper method setCredentials.
public <C> void setCredentials(Key<C> key, C credentials) {
myCredentialsTypeHolder = new UserDataHolderBase();
myCredentialsTypeHolder.putUserData(key, credentials);
}
use of com.intellij.openapi.util.UserDataHolderBase in project intellij-community by JetBrains.
the class RemoteConnectionCredentialsWrapper method copyTo.
public void copyTo(final RemoteConnectionCredentialsWrapper copy) {
copy.myCredentialsTypeHolder = new UserDataHolderBase();
Pair<Object, CredentialsType> credentialsAndProvider = getCredentialsAndType();
credentialsAndProvider.getSecond().putCredentials(copy.myCredentialsTypeHolder, credentialsAndProvider.getFirst());
}
Aggregations