use of com.liferay.ide.project.ui.upgrade.animated.FindBreakingChangesPage in project liferay-ide by liferay.
the class RunMigrationToolAction method run.
@Override
public void run() {
if ((_selection == null) || _selection.isEmpty()) {
_selection = getSelectionProjects();
}
final FindBreakingChangesPage page = UpgradeView.getPage(Page.findbreackingchangesPageId, FindBreakingChangesPage.class);
if (_selection != null) {
try {
Map<String, Object> breakingChangeParameters = new HashMap<>();
breakingChangeParameters.put("CombineExistedProblem", getCombineExistedProjects());
UIUtil.executeCommand("com.liferay.ide.project.ui.migrateProject", _selection, breakingChangeParameters);
} catch (ExecutionException | NotDefinedException | NotEnabledException | NotHandledException e) {
page.setButtonState(true);
ProjectUI.createErrorStatus("Error in migrate command", e);
}
} else {
page.setButtonState(true);
}
}
use of com.liferay.ide.project.ui.upgrade.animated.FindBreakingChangesPage in project liferay-ide by liferay.
the class IgnoreAlwaysAction method run.
@Override
public void run() {
final Problem problem = MigrationUtil.getProblemFromSelection(getSelection());
_storeIgnoredProblem(problem);
new WorkspaceJob("Ignore all problems of this type") {
public IStatus runInWorkspace(IProgressMonitor monitor) {
IStatus retval = Status.OK_STATUS;
try {
FindBreakingChangesPage page = UpgradeView.getPage(Page.findbreackingchangesPageId, FindBreakingChangesPage.class);
TreeViewer treeViewer = page.getTreeViewer();
MigrationContentProvider contentProvider = (MigrationContentProvider) treeViewer.getContentProvider();
final MigrationProblemsContainer mpContainer = (MigrationProblemsContainer) contentProvider.getProblems().get(0);
final MigrationProblems[] projectProblem = mpContainer.getProblemsArray();
for (MigrationProblems pProblem : projectProblem) {
FileProblems[] fProblems = pProblem.getProblems();
for (FileProblems fp : fProblems) {
List<Problem> problems = fp.getProblems();
Iterator<Problem> iterator = problems.iterator();
while (iterator.hasNext()) {
Problem p = iterator.next();
if (p.getTicket().equals(problem.getTicket())) {
new IgnoreAction().run(p, _provider);
}
}
}
}
} catch (Exception e) {
retval = ProjectUI.createErrorStatus("Unable to get file from problem");
}
return retval;
}
}.schedule();
}
Aggregations