use of jetbrains.communicator.core.vfs.ProjectsData 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];
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesTest method testTree_SortProjects.
public void testTree_SortProjects() throws Exception {
ProjectsData projectsData = new ProjectsData();
projectsData.setProjectFiles("aaa", new VFile[0]);
projectsData.setProjectFiles("ccc", new VFile[0]);
projectsData.setProjectFiles("bbb", new VFile[0]);
myViewFilesPanel.refreshData(myUser, projectsData);
assertTree(new String[] { "aaa", "bbb", "ccc" });
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesTest method testTree_ProjectAndNonProjectFiles.
public void testTree_ProjectAndNonProjectFiles() throws Exception {
ProjectsData projectsData = new ProjectsData();
projectsData.addNonProjectFile(VFile.create("log4j.xml"));
projectsData.setProjectFiles("ideTalk", new VFile[] { VFile.create("build.xml") });
myViewFilesPanel.refreshData(myUser, projectsData);
assertTree(new String[] { "ideTalk", "build.xml", ViewFilesPanel.NON_PROJECT_NODE, "log4j.xml" });
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesTest method testHideReadOnly.
public void testHideReadOnly() throws Exception {
myViewFilesPanel.showReadOnly(true);
ProjectsData projectsData = new ProjectsData();
projectsData.setProjectFiles("ideTalk", new VFile[] { VFile.create("aaa", true), VFile.create("bbb", false) });
myViewFilesPanel.refreshData(myUser, projectsData);
assertTree(new String[] { "ideTalk", "aaa", "bbb" });
myViewFilesPanel.showReadOnly(false);
assertFalse(myViewFilesPanel.isReadOnlyShown());
assertEquals(myViewFilesPanel.isReadOnlyShown(), myOptions.isSet(ViewFilesPanel.SHOW_READ_ONLY_KEY, true));
assertTree(new String[] { "ideTalk", "aaa" });
}
use of jetbrains.communicator.core.vfs.ProjectsData in project intellij-plugins by JetBrains.
the class ViewFilesTest method testTree_FileNotInProject.
public void testTree_FileNotInProject() throws Exception {
ProjectsData projectsData = new ProjectsData();
projectsData.addNonProjectFile(VFile.create("log4j.xml"));
myViewFilesPanel.refreshData(myUser, projectsData);
assertTree(new String[] { ViewFilesPanel.NON_PROJECT_NODE, "log4j.xml" });
}
Aggregations