use of com.liferay.ide.project.core.ProjectRecord in project liferay-ide by liferay.
the class ImportSDKProjectsCheckboxCustomPart method getInitItemsList.
@Override
protected List<ProjectCheckboxElement> getInitItemsList() {
List<ProjectCheckboxElement> checkboxElementList = new ArrayList<>();
Value<Path> sdkLocationPath = _op().getSdkLocation();
Path sdkLocation = sdkLocationPath.content();
if ((sdkLocation == null) || !sdkLocation.toFile().exists()) {
return checkboxElementList;
}
final ProjectRecord[] projectRecords = _updateProjectsList(PathBridge.create(sdkLocation).toPortableString());
if (projectRecords == null) {
return checkboxElementList;
}
String context = null;
for (ProjectRecord projectRecord : projectRecords) {
final String projectLocation = projectRecord.getProjectLocation().toPortableString();
context = projectRecord.getProjectName() + " (" + projectLocation + ")";
ProjectCheckboxElement checkboxElement = new ProjectCheckboxElement(projectRecord.getProjectName(), context, projectRecord.getProjectLocation().toPortableString());
if (!projectRecord.hasConflicts()) {
checkboxElementList.add(checkboxElement);
}
}
_sortProjectCheckboxElement(checkboxElementList);
return checkboxElementList;
}
use of com.liferay.ide.project.core.ProjectRecord in project liferay-ide by liferay.
the class ImportSDKProjectsCheckboxCustomPart method _getProjectRecords.
@SuppressWarnings({ "rawtypes", "unchecked" })
private Object[] _getProjectRecords() {
List projectRecords = new ArrayList();
for (int i = 0; i < selectedProjects.length; i++) {
ProjectRecord projectRecord = (ProjectRecord) selectedProjects[i];
if (_isProjectInWorkspace(projectRecord.getProjectName())) {
projectRecord.setHasConflicts(true);
}
projectRecords.add(selectedProjects[i]);
}
return projectRecords.toArray(new ProjectRecord[projectRecords.size()]);
}
Aggregations