Search in sources :

Example 1 with IgnoredProblemsContainer

use of com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer in project liferay-ide by liferay.

the class IgnoreAlwaysAction method _storeIgnoredProblem.

private void _storeIgnoredProblem(Problem problem) {
    try {
        IgnoredProblemsContainer ipContainer = MigrationUtil.getIgnoredProblemsContainer();
        if (ipContainer == null) {
            ipContainer = new IgnoredProblemsContainer();
        }
        ipContainer.add(problem);
        UpgradeAssistantSettingsUtil.setObjectToStore(IgnoredProblemsContainer.class, ipContainer);
    } catch (IOException ioe) {
    }
}
Also used : IgnoredProblemsContainer(com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer) IOException(java.io.IOException)

Example 2 with IgnoredProblemsContainer

use of com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer in project liferay-ide by liferay.

the class MigrationProblemPreferencePage method _fillIgnoredProblemTable.

private void _fillIgnoredProblemTable() {
    try {
        IgnoredProblemsContainer mpContainer = UpgradeAssistantSettingsUtil.getObjectFromStore(IgnoredProblemsContainer.class);
        if (mpContainer != null) {
            Map<String, Problem> problemMap = mpContainer.getProblemMap();
            Problem[] problems = problemMap.values().toArray(new Problem[0]);
            _ignoredProblemTable.setInput(problems);
        }
    } catch (IOException ioe) {
        ioe.printStackTrace();
    }
}
Also used : IgnoredProblemsContainer(com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer) Problem(com.liferay.blade.api.Problem) IOException(java.io.IOException)

Example 3 with IgnoredProblemsContainer

use of com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer in project liferay-ide by liferay.

the class MigrateProjectHandler method _shouldAdd.

private boolean _shouldAdd(Problem problem) {
    IgnoredProblemsContainer ignoredProblemsContainer = MigrationUtil.getIgnoredProblemsContainer();
    if (ignoredProblemsContainer != null) {
        Set<String> ticketSet = ignoredProblemsContainer.getProblemMap().keySet();
        if ((ticketSet != null) && ticketSet.contains(problem.getTicket())) {
            final IResource resource = MigrationUtil.getIResourceFromProblem(problem);
            final IMarker marker = resource.getMarker(problem.getMarkerId());
            if (marker.exists()) {
                try {
                    marker.delete();
                } catch (CoreException ce) {
                    ProjectUI.logError(ce);
                }
            }
            return false;
        }
    }
    return true;
}
Also used : IgnoredProblemsContainer(com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer) CoreException(org.eclipse.core.runtime.CoreException) IMarker(org.eclipse.core.resources.IMarker) IResource(org.eclipse.core.resources.IResource)

Aggregations

IgnoredProblemsContainer (com.liferay.ide.project.core.upgrade.IgnoredProblemsContainer)3 IOException (java.io.IOException)2 Problem (com.liferay.blade.api.Problem)1 IMarker (org.eclipse.core.resources.IMarker)1 IResource (org.eclipse.core.resources.IResource)1 CoreException (org.eclipse.core.runtime.CoreException)1