use of com.intellij.remoteServer.impl.runtime.ui.tree.TreeBuilderBase in project intellij-community by JetBrains.
the class ServersToolWindowContent method setupBuilder.
private void setupBuilder(@NotNull final Project project) {
ServersTreeStructure structure = myContribution.createTreeStructure(project, this);
myBuilder = new TreeBuilderBase(myTree, structure, myTreeModel) {
@Override
protected boolean isAutoExpandNode(NodeDescriptor nodeDescriptor) {
return (nodeDescriptor instanceof ServersTreeStructure.RemoteServerNode || nodeDescriptor instanceof ServersTreeStructure.DeploymentNodeImpl) && (!myCollapsedTreeNodeValues.contains(((AbstractTreeNode) nodeDescriptor).getValue()));
}
};
Disposer.register(this, myBuilder);
project.getMessageBus().connect().subscribe(ServerConnectionListener.TOPIC, new ServerConnectionListener() {
@Override
public void onConnectionCreated(@NotNull ServerConnection<?> connection) {
getBuilder().queueUpdate();
}
@Override
public void onConnectionStatusChanged(@NotNull ServerConnection<?> connection) {
getBuilder().queueUpdate();
updateSelectedServerDetails();
if (connection.getStatus() == ConnectionStatus.CONNECTED) {
pollDeployments(connection);
}
}
@Override
public void onDeploymentsChanged(@NotNull ServerConnection<?> connection) {
getBuilder().queueUpdate();
updateSelectedServerDetails();
}
});
}
Aggregations