本文整理汇总了Java中com.intellij.remoteServer.runtime.ConnectionStatus类的典型用法代码示例。如果您正苦于以下问题:Java ConnectionStatus类的具体用法?Java ConnectionStatus怎么用?Java ConnectionStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConnectionStatus类属于com.intellij.remoteServer.runtime包,在下文中一共展示了ConnectionStatus类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doDisconnect
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void doDisconnect() {
if (myStatus == ConnectionStatus.CONNECTED) {
if (myRuntimeInstance != null) {
myRuntimeInstance.disconnect();
myRuntimeInstance = null;
}
setStatus(ConnectionStatus.DISCONNECTED);
for (DeploymentLogManagerImpl logManager : myLogManagers.values()) {
logManager.disposeLogs();
}
}
}
示例2: getStatusIcon
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
@Nullable
private Icon getStatusIcon(final ConnectionStatus status) {
switch (status) {
case CONNECTED: return RemoteServersIcons.ResumeScaled;
case DISCONNECTED: return RemoteServersIcons.SuspendScaled;
default: return null;
}
}
示例3: testConnection
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void testConnection() {
final ServerConnection connection = ServerConnectionManager.getInstance().getOrCreateConnection(myServer);
final AtomicReference<Runnable> showResultRef = new AtomicReference<Runnable>(null);
new Task.Modal(null, "Connecting...", true) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
indicator.setIndeterminate(true);
final Semaphore semaphore = new Semaphore();
semaphore.down();
connection.connect(new Runnable() {
@Override
public void run() {
showResultRef.set(new Runnable() {
@Override
public void run() {
if (connection.getStatus() == ConnectionStatus.CONNECTED) {
Messages.showInfoMessage(myMainPanel, "Connection successful", "Test Connection");
}
else if (connection.getStatus() == ConnectionStatus.DISCONNECTED) {
Messages.showErrorDialog(myMainPanel, "Cannot connect: " + connection.getStatusText(), "Test Connection");
}
}
});
semaphore.up();
}
});
while (!indicator.isCanceled()) {
semaphore.waitFor(500);
}
Runnable showResult = showResultRef.get();
if (showResult != null) {
ApplicationManager.getApplication().invokeLater(showResult);
}
}
}.queue();
}
示例4: disconnect
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void disconnect() {
if (myStatus == ConnectionStatus.CONNECTED) {
myRuntimeInstance = null;
myConnector.disconnect();
myStatus = ConnectionStatus.DISCONNECTED;
}
}
示例5: testConnection
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void testConnection() {
final ServerConnection connection = ServerConnectionManager.getInstance().getOrCreateConnection(myServer);
final AtomicReference<Runnable> showResultRef = new AtomicReference<Runnable>(null);
new Task.Modal(null, "Connecting...", true) {
@Override
public void run(@Nonnull ProgressIndicator indicator) {
indicator.setIndeterminate(true);
final Semaphore semaphore = new Semaphore();
semaphore.down();
connection.connect(new Runnable() {
@Override
public void run() {
showResultRef.set(new Runnable() {
@Override
public void run() {
if (connection.getStatus() == ConnectionStatus.CONNECTED) {
Messages.showInfoMessage(myMainPanel, "Connection successful", "Test Connection");
}
else if (connection.getStatus() == ConnectionStatus.DISCONNECTED) {
Messages.showErrorDialog(myMainPanel, "Cannot connect: " + connection.getStatusText(), "Test Connection");
}
}
});
semaphore.up();
}
});
while (!indicator.isCanceled()) {
if (semaphore.waitFor(500)) {
break;
}
}
Runnable showResult = showResultRef.get();
if (showResult != null) {
ApplicationManager.getApplication().invokeLater(showResult);
}
}
}.queue();
}
示例6: doDisconnect
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void doDisconnect() {
if (myStatus == ConnectionStatus.CONNECTED) {
if (myRuntimeInstance != null) {
myRuntimeInstance.disconnect();
myRuntimeInstance = null;
}
setStatus(ConnectionStatus.DISCONNECTED);
}
}
示例7: updateServerDetails
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void updateServerDetails(ServersTreeStructure.RemoteServerNode node) {
RemoteServer<?> server = ((ServersTreeStructure.RemoteServerNode)node).getValue();
ServerConnection connection = ServerConnectionManager.getInstance().getConnection(server);
if (connection == null || connection.getStatus() == ConnectionStatus.DISCONNECTED) {
showMessageLabel("Double-click on the server node to connect");
}
else {
showMessageLabel(connection.getStatusText());
}
}
示例8: getStatus
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
@NotNull
@Override
public ConnectionStatus getStatus() {
return myStatus;
}
示例9: setStatus
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void setStatus(final ConnectionStatus status) {
setStatus(status, null);
}
示例10: isConnected
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
public boolean isConnected() {
ServerConnection<?> connection = getConnection();
return connection != null && connection.getStatus() == ConnectionStatus.CONNECTED;
}
示例11: getStatus
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
@Nonnull
@Override
public ConnectionStatus getStatus() {
return myStatus;
}
示例12: setStatus
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
private void setStatus(final ConnectionStatus status) {
myStatus = status;
myEventDispatcher.queueConnectionStatusChanged(this);
}
示例13: isConnected
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
@Override
public boolean isConnected() {
ServerConnection<?> connection = getConnection();
return connection != null && connection.getStatus() == ConnectionStatus.CONNECTED;
}
示例14: isStartActionEnabled
import com.intellij.remoteServer.runtime.ConnectionStatus; //导入依赖的package包/类
@Override
public boolean isStartActionEnabled(@Nonnull Executor executor) {
ServerConnection connection = getConnection();
return executor.equals(DefaultRunExecutor.getRunExecutorInstance()) &&
(connection == null || connection.getStatus() == ConnectionStatus.DISCONNECTED);
}