Lines 58-63
Link Here
|
58 |
import org.netbeans.modules.nativeexecution.TerminalLocalNativeProcess; |
58 |
import org.netbeans.modules.nativeexecution.TerminalLocalNativeProcess; |
59 |
import org.netbeans.modules.nativeexecution.api.pty.PtySupport; |
59 |
import org.netbeans.modules.nativeexecution.api.pty.PtySupport; |
60 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
60 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager; |
|
|
61 |
import org.netbeans.modules.nativeexecution.api.util.ConnectionManager.CancellationException; |
61 |
import org.netbeans.modules.nativeexecution.api.util.ExternalTerminal; |
62 |
import org.netbeans.modules.nativeexecution.api.util.ExternalTerminal; |
62 |
import org.netbeans.modules.nativeexecution.api.util.ExternalTerminalProvider; |
63 |
import org.netbeans.modules.nativeexecution.api.util.ExternalTerminalProvider; |
63 |
import org.netbeans.modules.nativeexecution.api.util.MacroMap; |
64 |
import org.netbeans.modules.nativeexecution.api.util.MacroMap; |
Lines 65-70
Link Here
|
65 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport; |
66 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport; |
66 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus; |
67 |
import org.netbeans.modules.nativeexecution.api.util.ShellValidationSupport.ShellValidationStatus; |
67 |
import org.netbeans.modules.nativeexecution.api.util.WindowsSupport; |
68 |
import org.netbeans.modules.nativeexecution.api.util.WindowsSupport; |
|
|
69 |
import org.openide.util.Exceptions; |
70 |
import org.openide.util.UserQuestionException; |
68 |
|
71 |
|
69 |
/** |
72 |
/** |
70 |
* Utility class for the {@link NativeProcess external native process} creation. |
73 |
* Utility class for the {@link NativeProcess external native process} creation. |
Lines 160-177
Link Here
|
160 |
* in this builder |
163 |
* in this builder |
161 |
* @throws IOException if the process could not be created |
164 |
* @throws IOException if the process could not be created |
162 |
*/ |
165 |
*/ |
|
|
166 |
@NbBundle.Messages({ |
167 |
"#{0} - display name of execution environment", |
168 |
"EXC_NotConnectedQuestion=No connection to {0}. Connect now?" |
169 |
}) |
163 |
@Override |
170 |
@Override |
164 |
public NativeProcess call() throws IOException { |
171 |
public NativeProcess call() throws IOException { |
165 |
AbstractNativeProcess process = null; |
172 |
AbstractNativeProcess process = null; |
166 |
|
173 |
|
167 |
ExecutionEnvironment execEnv = info.getExecutionEnvironment(); |
174 |
final ExecutionEnvironment execEnv = info.getExecutionEnvironment(); |
168 |
|
175 |
|
169 |
if (info.getCommand() == null) { |
176 |
if (info.getCommand() == null) { |
170 |
throw new IllegalStateException("No executable nor command line is specified"); // NOI18N |
177 |
throw new IllegalStateException("No executable nor command line is specified"); // NOI18N |
171 |
} |
178 |
} |
172 |
|
179 |
|
173 |
if (!ConnectionManager.getInstance().isConnectedTo(execEnv)) { |
180 |
if (!ConnectionManager.getInstance().isConnectedTo(execEnv)) { |
174 |
throw new IOException("No connection to " + execEnv.getDisplayName()); // NOI18N |
181 |
throw new UserQuestionException("No connection to " + execEnv.getDisplayName()) { |
|
|
182 |
@Override |
183 |
public void confirmed() throws IOException { |
184 |
try { |
185 |
ConnectionManager.getInstance().connectTo(execEnv); |
186 |
} catch (CancellationException ex) { |
187 |
throw new IOException(ex); |
188 |
} |
189 |
} |
190 |
@Override |
191 |
public String getLocalizedMessage() { |
192 |
return Bundle.EXC_NotConnectedQuestion(execEnv.getDisplayName()); |
193 |
} |
194 |
}; |
175 |
} |
195 |
} |
176 |
|
196 |
|
177 |
if (info.isPtyMode() && PtySupport.isSupportedFor(info.getExecutionEnvironment())) { |
197 |
if (info.isPtyMode() && PtySupport.isSupportedFor(info.getExecutionEnvironment())) { |