use of jetbrains.communicator.core.transport.GetProjectsDataXmlMessage in project intellij-plugins by JetBrains.
the class Helper method doGetProjectsData.
public static ProjectsData doGetProjectsData(final Transport transport, final User user, IDEFacade ideFacade) {
final ProjectsData[] result = new ProjectsData[] { ProjectsData.NULL };
if (user.isOnline()) {
try {
UIUtil.run(ideFacade, StringUtil.getMsg("ViewFilesCommand.title", user.getDisplayName()), new Runnable() {
@Override
public void run() {
final Semaphore semaphore = new Semaphore(1);
try {
semaphore.acquire();
transport.sendXmlMessage(user, new GetProjectsDataXmlMessage(result) {
@Override
public void processResponse(Element responseElement) {
super.processResponse(responseElement);
semaphore.release();
}
});
semaphore.tryAcquire(getWaitTimeout(), TimeUnit.MILLISECONDS);
} catch (InterruptedException ignored) {
}
}
});
} catch (CanceledException ignored) {
//
}
}
return result[0];
}
Aggregations