use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class DeprecatedMethodsMigrator method analyze.
@Override
public List<Problem> analyze(File file) {
List<Problem> problems = new ArrayList<>();
String fileExtension = new Path(file.getAbsolutePath()).getFileExtension();
for (JSONArray deprecatedMethodsArray : _deprecatedMethods) {
for (int j = 0; j < deprecatedMethodsArray.length(); j++) {
_tempMethod = deprecatedMethodsArray.getJSONObject(j);
List<SearchResult> searchResults = searchFile(file, createFileChecker(type, file, fileExtension));
if (searchResults != null) {
for (SearchResult searchResult : searchResults) {
int makerType = Problem.MARKER_ERROR;
if (_tempMethod.getString("deprecatedVersion").equals("7.0")) {
makerType = Problem.MARKER_WARNING;
}
problems.add(new Problem(_tempMethod.getString("javadoc"), _tempMethod.getString("javadoc"), fileExtension, "", file, searchResult.startLine, searchResult.startOffset, searchResult.endOffset, _tempMethod.getString("javadoc"), searchResult.autoCorrectContext, Problem.STATUS_NOT_RESOLVED, Problem.DEFAULT_MARKER_ID, makerType));
}
}
}
}
return problems;
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class FileProblemsUtil method newFileProblemsListFrom.
public static FileProblems[] newFileProblemsListFrom(Problem[] problems) {
Map<File, FileProblems> fileProblemsMap = new HashMap<>();
for (Problem problem : problems) {
FileProblems fileProblem = fileProblemsMap.get(problem.getFile());
if (fileProblem == null) {
fileProblem = new FileProblems();
}
fileProblem.addProblem(problem);
fileProblem.setFile(problem.getFile());
fileProblemsMap.put(problem.getFile(), fileProblem);
}
return fileProblemsMap.values().toArray(new FileProblems[0]);
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class FindBreakingChangesPage method _updateForm.
private void _updateForm(SelectionChangedEvent event) {
final ISelection selection = event.getSelection();
final Problem problem = MigrationUtil.getProblemFromSelection(selection);
if (problem != null) {
if (CoreUtil.isNullOrEmpty(problem.html)) {
_browser.setText(_generateFormText(problem));
} else {
_browser.setText(problem.html);
}
} else {
_browser.setUrl("about:blank");
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class FindBreakingChangesPage method doubleClick.
@Override
public void doubleClick(DoubleClickEvent event) {
if (event.getSelection() instanceof IStructuredSelection) {
final IStructuredSelection ss = (IStructuredSelection) event.getSelection();
Object element = ss.getFirstElement();
if (element instanceof Problem) {
MigrationUtil.openEditor((Problem) element);
} else if (element instanceof FileProblems) {
MigrationUtil.openEditor((FileProblems) element);
}
}
}
use of com.liferay.blade.api.Problem in project liferay-ide by liferay.
the class MigrationProblemPreferencePage method _updateForm.
private void _updateForm(SelectionChangedEvent event) {
final ISelection selection = event.getSelection();
final Problem problem = MigrationUtil.getProblemFromSelection(selection);
if (problem != null) {
if (CoreUtil.isNullOrEmpty(problem.html)) {
_browser.setText(_generateFormText(problem));
} else {
_browser.setText(problem.html);
}
} else {
_browser.setUrl("about:blank");
}
}
Aggregations