mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix editing of a remote python sdk.
This commit is contained in:
@@ -161,4 +161,12 @@ public class RemoteConnectionCredentialsWrapper {
|
||||
throw unknownConnectionType();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof RemoteConnectionCredentialsWrapper) {
|
||||
return getId().equals(((RemoteConnectionCredentialsWrapper)obj).getId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
package com.intellij.remote;
|
||||
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Pair;
|
||||
@@ -35,7 +34,7 @@ public abstract class VagrantSupport {
|
||||
return ServiceManager.getService(VagrantSupport.class);
|
||||
}
|
||||
|
||||
public abstract Pair<String, RemoteCredentials> getVagrantSettings(Project data);
|
||||
public abstract Pair<String, RemoteCredentials> getVagrantSettings(Project project);
|
||||
|
||||
public abstract RemoteCredentials getCredentials(@NotNull String folder);
|
||||
|
||||
|
||||
@@ -23,16 +23,20 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public class WebDeploymentCredentialsHolder {
|
||||
public static final String WEB_SERVER_CONFIG_ID = "WEB_SERVER_CONFIG_ID";
|
||||
public static final String WEB_SERVER_CONFIG_NAME = "WEB_SERVER_CONFIG_NAME";
|
||||
|
||||
|
||||
private String myWebServerConfigId;
|
||||
private final RemoteCredentialsHolder myRemoteCredentials = new RemoteCredentialsHolder();
|
||||
private String myWebServerConfigName;
|
||||
|
||||
|
||||
public WebDeploymentCredentialsHolder() {
|
||||
}
|
||||
|
||||
public WebDeploymentCredentialsHolder(@NotNull String webServerConfigId, @NotNull RemoteCredentials remoteCredentials) {
|
||||
public WebDeploymentCredentialsHolder(@NotNull String webServerConfigId, String name, @NotNull RemoteCredentials remoteCredentials) {
|
||||
myWebServerConfigId = webServerConfigId;
|
||||
myWebServerConfigName = name;
|
||||
myRemoteCredentials.copyFrom(remoteCredentials);
|
||||
}
|
||||
|
||||
@@ -45,13 +49,23 @@ public class WebDeploymentCredentialsHolder {
|
||||
myWebServerConfigId = webServerConfigId;
|
||||
}
|
||||
|
||||
public String getWebServerConfigName() {
|
||||
return myWebServerConfigName;
|
||||
}
|
||||
|
||||
public void setWebServerConfigName(String name) {
|
||||
myWebServerConfigName = name;
|
||||
}
|
||||
|
||||
public void load(Element element) {
|
||||
myRemoteCredentials.load(element);
|
||||
setWebServerConfigId(element.getAttributeValue(WEB_SERVER_CONFIG_ID));
|
||||
setWebServerConfigName(element.getAttributeValue(WEB_SERVER_CONFIG_NAME));
|
||||
}
|
||||
|
||||
public void save(Element element) {
|
||||
element.setAttribute(WEB_SERVER_CONFIG_ID, getWebServerConfigId());
|
||||
element.setAttribute(WEB_SERVER_CONFIG_NAME, getWebServerConfigName());
|
||||
|
||||
myRemoteCredentials.save(element);
|
||||
}
|
||||
@@ -60,3 +74,4 @@ public class WebDeploymentCredentialsHolder {
|
||||
return myRemoteCredentials;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.Computable;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.remote.RemoteCredentials;
|
||||
import com.intellij.remote.RemoteSdkAdditionalData;
|
||||
import com.intellij.ui.*;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.NullableConsumer;
|
||||
@@ -54,8 +54,10 @@ import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
import java.awt.*;
|
||||
import java.util.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class PythonSdkDetailsDialog extends DialogWrapper {
|
||||
private JPanel myMainPanel;
|
||||
@@ -294,7 +296,7 @@ public class PythonSdkDetailsDialog extends DialogWrapper {
|
||||
private void editSdk() {
|
||||
final Sdk currentSdk = getSelectedSdk();
|
||||
if (currentSdk != null) {
|
||||
if (currentSdk.getSdkAdditionalData() instanceof RemoteCredentials) {
|
||||
if (currentSdk.getSdkAdditionalData() instanceof RemoteSdkAdditionalData) {
|
||||
editRemoteSdk(currentSdk);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class RemoteDebugger implements ProcessDebugger {
|
||||
private final List<RemoteDebuggerCloseListener> myCloseListeners = ContainerUtil.createLockFreeCopyOnWriteList();
|
||||
private DebuggerReader myDebuggerReader;
|
||||
|
||||
public RemoteDebugger(final IPyDebugProcess debugProcess, final ServerSocket serverSocket, final int timeout) {
|
||||
public RemoteDebugger(final IPyDebugProcess debugProcess, @NotNull final ServerSocket serverSocket, final int timeout) {
|
||||
myDebugProcess = debugProcess;
|
||||
myServerSocket = serverSocket;
|
||||
myConnectionTimeout = timeout;
|
||||
|
||||
Reference in New Issue
Block a user