Bug 575365: Adapt to improved IssueTypeSet Change-Id: I2203faeaeb0826ef20c1ebd15d6eeb87ea4b5028
diff --git a/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/model/build/LtxSourceUnitModelContainer.java b/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/model/build/LtxSourceUnitModelContainer.java index d7e3560..35d94f3 100644 --- a/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/model/build/LtxSourceUnitModelContainer.java +++ b/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/model/build/LtxSourceUnitModelContainer.java
@@ -34,9 +34,9 @@ public static final IssueTypeSet ISSUE_TYPE_SET= new IssueTypeSet(TexCore.BUNDLE_ID, - TexIssues.TASK_TYPE_DEF, + TexIssues.TASK_CATEGORY, ImCollections.newList( - TexIssues.LTX_MODEL_PROBLEM_TYPE_DEF )); + TexIssues.LTX_MODEL_PROBLEM_CATEGORY )); public LtxSourceUnitModelContainer(final TSourceUnit su) {
diff --git a/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/project/TexIssues.java b/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/project/TexIssues.java index 3db604f..d48b2d6 100644 --- a/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/project/TexIssues.java +++ b/docmlet/org.eclipse.statet.docmlet.tex.core/src/org/eclipse/statet/docmlet/tex/core/project/TexIssues.java
@@ -25,7 +25,7 @@ public final class TexIssues { - public static final IssueTypeSet.TaskTypeDef TASK_TYPE_DEF= new IssueTypeSet.TaskTypeDef( + public static final IssueTypeSet.TaskCategory TASK_CATEGORY= new IssueTypeSet.TaskCategory( DocTasks.TASK_MARKER_TYPE, null ); @@ -34,7 +34,7 @@ // public static final IssueTypeSet.ProblemTypes LTX_MODEL_PROBLEM_MARKER_TYPES= new IssueTypeSet.ProblemTypes( // LTX_MODEL_PROBLEM_MARKER_TYPE ); - public static final IssueTypeSet.ProblemTypeDef LTX_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory LTX_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( TexModel.LTX_TYPE_ID, null, null );
diff --git a/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/docmlet/tex/ui/editors/TexEditorBuild.java b/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/docmlet/tex/ui/editors/TexEditorBuild.java index ce1e24b..767a72a 100644 --- a/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/docmlet/tex/ui/editors/TexEditorBuild.java +++ b/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/docmlet/tex/ui/editors/TexEditorBuild.java
@@ -37,20 +37,20 @@ TexEditingSettings.EDITING_PREF_QUALIFIER, "ProblemChecking.enabled"); //$NON-NLS-1$ - public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.error"; //$NON-NLS-1$ - public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.warning"; //$NON-NLS-1$ - public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.info"; //$NON-NLS-1$ + public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.error"; //$NON-NLS-1$ + public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.warning"; //$NON-NLS-1$ + public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.tex.ui.info"; //$NON-NLS-1$ private static final IssueTypeSet.ProblemTypes PROBLEM_ANNOTATION_TYPES= new IssueTypeSet.ProblemTypes( ERROR_ANNOTATION_TYPE, WARNING_ANNOTATION_TYPE, INFO_ANNOTATION_TYPE ); - public static final IssueTypeSet.ProblemTypeDef LTX_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory LTX_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( TexModel.LTX_TYPE_ID, null, PROBLEM_ANNOTATION_TYPES ); public static final IssueTypeSet LTX_ISSUE_TYPE_SET= new IssueTypeSet(TexUI.BUNDLE_ID, - TexIssues.TASK_TYPE_DEF, + TexIssues.TASK_CATEGORY, ImCollections.newList( - TexEditorBuild.LTX_MODEL_PROBLEM_TYPE_DEF )); + TexEditorBuild.LTX_MODEL_PROBLEM_CATEGORY )); }
diff --git a/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/internal/docmlet/tex/ui/editors/LtxDocumentProvider.java b/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/internal/docmlet/tex/ui/editors/LtxDocumentProvider.java index 4adbb62..60fa0a6 100644 --- a/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/internal/docmlet/tex/ui/editors/LtxDocumentProvider.java +++ b/docmlet/org.eclipse.statet.docmlet.tex.ui/src/org/eclipse/statet/internal/docmlet/tex/ui/editors/LtxDocumentProvider.java
@@ -14,7 +14,6 @@ package org.eclipse.statet.internal.docmlet.tex.ui.editors; -import java.util.List; import java.util.Set; import org.eclipse.core.resources.IFile; @@ -33,13 +32,12 @@ import org.eclipse.statet.docmlet.tex.core.model.TexModel; import org.eclipse.statet.docmlet.tex.core.model.TexSourceUnit; +import org.eclipse.statet.docmlet.tex.core.project.TexIssues; import org.eclipse.statet.docmlet.tex.core.source.LtxDocumentSetupParticipant; import org.eclipse.statet.docmlet.tex.ui.TexUI; import org.eclipse.statet.docmlet.tex.ui.editors.TexEditorBuild; import org.eclipse.statet.ltk.core.Ltk; import org.eclipse.statet.ltk.issues.core.IssueTypeSet; -import org.eclipse.statet.ltk.model.core.LtkModels; -import org.eclipse.statet.ltk.model.core.element.SourceUnit; import org.eclipse.statet.ltk.ui.sourceediting.SourceAnnotationModel; import org.eclipse.statet.ltk.ui.sourceediting.SourceDocumentProvider; @@ -50,9 +48,9 @@ private static final IssueTypeSet ISSUE_TYPE_SET= new IssueTypeSet(TexUI.BUNDLE_ID, - new IssueTypeSet.TaskTypeDef(null, null), + TexIssues.TASK_CATEGORY, ImCollections.newList( - TexEditorBuild.LTX_MODEL_PROBLEM_TYPE_DEF )); + TexEditorBuild.LTX_MODEL_PROBLEM_CATEGORY )); private class ThisAnnotationModel extends SourceAnnotationModel { @@ -62,7 +60,7 @@ } @Override - protected boolean isHandlingTemporaryProblems() { + protected boolean isHandlingTemporaryProblems(final IssueTypeSet.ProblemCategory issueCategory) { return LtxDocumentProvider.this.handleTemporaryProblems; } @@ -108,19 +106,7 @@ final boolean newHandleTemporaryProblems= access.getPreferenceValue(TexEditorBuild.PROBLEMCHECKING_ENABLED_PREF); if (this.handleTemporaryProblems != newHandleTemporaryProblems) { this.handleTemporaryProblems= newHandleTemporaryProblems; - if (this.handleTemporaryProblems) { - TexModel.getLtxModelManager().refresh(Ltk.EDITOR_CONTEXT); - } - else { - final List<? extends SourceUnit> sus= LtkModels.getSourceUnitManager().getOpenSourceUnits( - TexModel.LTX_TYPE_ID, Ltk.EDITOR_CONTEXT ); - for (final SourceUnit su : sus) { - final IAnnotationModel model= getAnnotationModel(su); - if (model instanceof ThisAnnotationModel) { - ((ThisAnnotationModel) model).clearProblems(null); - } - } - } + TexModel.getLtxModelManager().refresh(Ltk.EDITOR_CONTEXT); } }
diff --git a/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/model/build/WikidocSourceUnitModelContainer.java b/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/model/build/WikidocSourceUnitModelContainer.java index f1760dc..302b880 100644 --- a/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/model/build/WikidocSourceUnitModelContainer.java +++ b/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/model/build/WikidocSourceUnitModelContainer.java
@@ -36,11 +36,11 @@ public static final IssueTypeSet ISSUE_TYPE_SET= new IssueTypeSet(WikitextCore.BUNDLE_ID, - WikitextIssues.TASK_TYPE_DEF, + WikitextIssues.TASK_CATEGORY, ImCollections.newList( - WikitextIssues.WIKIDOC_MODEL_PROBLEM_TYPE_DEF, - YamlIssues.YAML_MODEL_PROBLEM_TYPE_DEF, - TexIssues.LTX_MODEL_PROBLEM_TYPE_DEF )); + WikitextIssues.WIKIDOC_MODEL_PROBLEM_CATEGORY, + YamlIssues.YAML_MODEL_PROBLEM_CATEGORY, + TexIssues.LTX_MODEL_PROBLEM_CATEGORY )); public WikidocSourceUnitModelContainer(final TSourceUnit su) {
diff --git a/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/project/WikitextIssues.java b/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/project/WikitextIssues.java index 944ed3c..b429ef8 100644 --- a/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/project/WikitextIssues.java +++ b/docmlet/org.eclipse.statet.docmlet.wikitext.core/src/org/eclipse/statet/docmlet/wikitext/core/project/WikitextIssues.java
@@ -25,7 +25,7 @@ public final class WikitextIssues { - public static final IssueTypeSet.TaskTypeDef TASK_TYPE_DEF= new IssueTypeSet.TaskTypeDef( + public static final IssueTypeSet.TaskCategory TASK_CATEGORY= new IssueTypeSet.TaskCategory( DocTasks.TASK_MARKER_TYPE, null ); @@ -34,7 +34,7 @@ // public static final IssueTypeSet.ProblemTypes WIKIDOC_MODEL_PROBLEM_MARKER_TYPES= new IssueTypeSet.ProblemTypes( // WIKIDOC_MODEL_PROBLEM_MARKER_TYPE ); - public static final IssueTypeSet.ProblemTypeDef WIKIDOC_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory WIKIDOC_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( WikitextModel.WIKIDOC_TYPE_ID, null, null );
diff --git a/docmlet/org.eclipse.statet.docmlet.wikitext.ui/src/org/eclipse/statet/docmlet/wikitext/ui/editors/WikitextEditorBuild.java b/docmlet/org.eclipse.statet.docmlet.wikitext.ui/src/org/eclipse/statet/docmlet/wikitext/ui/editors/WikitextEditorBuild.java index 866cd52..69f0ac1 100644 --- a/docmlet/org.eclipse.statet.docmlet.wikitext.ui/src/org/eclipse/statet/docmlet/wikitext/ui/editors/WikitextEditorBuild.java +++ b/docmlet/org.eclipse.statet.docmlet.wikitext.ui/src/org/eclipse/statet/docmlet/wikitext/ui/editors/WikitextEditorBuild.java
@@ -39,22 +39,22 @@ WikitextEditingSettings.EDITING_PREF_QUALIFIER, "ProblemChecking.enabled"); //$NON-NLS-1$ - public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.error"; //$NON-NLS-1$ - public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.warning"; //$NON-NLS-1$ - public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.info"; //$NON-NLS-1$ + public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.error"; //$NON-NLS-1$ + public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.warning"; //$NON-NLS-1$ + public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.docmlet.wikitext.ui.info"; //$NON-NLS-1$ private static final IssueTypeSet.ProblemTypes PROBLEM_ANNOTATION_TYPES= new IssueTypeSet.ProblemTypes( ERROR_ANNOTATION_TYPE, WARNING_ANNOTATION_TYPE, INFO_ANNOTATION_TYPE ); - public static final IssueTypeSet.ProblemTypeDef WIKIDOC_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory WIKIDOC_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( WikitextModel.WIKIDOC_TYPE_ID, null, PROBLEM_ANNOTATION_TYPES ); public static final IssueTypeSet WIKIDOC_ISSUE_TYPE_SET= new IssueTypeSet(WikitextUI.BUNDLE_ID, - WikitextIssues.TASK_TYPE_DEF, + WikitextIssues.TASK_CATEGORY, ImCollections.newList( - WikitextEditorBuild.WIKIDOC_MODEL_PROBLEM_TYPE_DEF, - YamlEditorBuild.YAML_MODEL_PROBLEM_TYPE_DEF, - TexEditorBuild.LTX_MODEL_PROBLEM_TYPE_DEF )); + WikitextEditorBuild.WIKIDOC_MODEL_PROBLEM_CATEGORY, + YamlEditorBuild.YAML_MODEL_PROBLEM_CATEGORY, + TexEditorBuild.LTX_MODEL_PROBLEM_CATEGORY )); }
diff --git a/yaml/org.eclipse.statet.yaml.core/src/org/eclipse/statet/yaml/core/project/YamlIssues.java b/yaml/org.eclipse.statet.yaml.core/src/org/eclipse/statet/yaml/core/project/YamlIssues.java index f7b7738..bba6122 100644 --- a/yaml/org.eclipse.statet.yaml.core/src/org/eclipse/statet/yaml/core/project/YamlIssues.java +++ b/yaml/org.eclipse.statet.yaml.core/src/org/eclipse/statet/yaml/core/project/YamlIssues.java
@@ -26,7 +26,7 @@ public static final String TASK_MARKER_TYPE= "org.eclipse.statet.yaml.resourceMarkers.Tasks"; //$NON-NLS-1$ - public static final IssueTypeSet.TaskTypeDef TASK_TYPE_DEF= new IssueTypeSet.TaskTypeDef( + public static final IssueTypeSet.TaskCategory TASK_CATEGORY= new IssueTypeSet.TaskCategory( TASK_MARKER_TYPE, null ); @@ -35,7 +35,7 @@ // public static final IssueTypeSet.ProblemTypes YAML_MODEL_PROBLEM_MARKER_TYPES= new IssueTypeSet.ProblemTypes( // YAML_MODEL_PROBLEM_MARKER_TYPE ); - public static final IssueTypeSet.ProblemTypeDef YAML_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory YAML_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( YamlModel.YAML_TYPE_ID, null, null );
diff --git a/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/internal/yaml/ui/editors/YamlDocumentProvider.java b/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/internal/yaml/ui/editors/YamlDocumentProvider.java index 7355e7d..f9773f8 100644 --- a/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/internal/yaml/ui/editors/YamlDocumentProvider.java +++ b/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/internal/yaml/ui/editors/YamlDocumentProvider.java
@@ -14,7 +14,6 @@ package org.eclipse.statet.internal.yaml.ui.editors; -import java.util.List; import java.util.Set; import org.eclipse.core.resources.IFile; @@ -31,7 +30,7 @@ import org.eclipse.statet.ecommons.preferences.core.PreferenceAccess; import org.eclipse.statet.ltk.core.Ltk; -import org.eclipse.statet.ltk.model.core.LtkModels; +import org.eclipse.statet.ltk.issues.core.IssueTypeSet; import org.eclipse.statet.ltk.model.core.element.SourceUnit; import org.eclipse.statet.ltk.ui.sourceediting.SourceAnnotationModel; import org.eclipse.statet.ltk.ui.sourceediting.SourceDocumentProvider; @@ -52,7 +51,7 @@ } @Override - protected boolean isHandlingTemporaryProblems() { + protected boolean isHandlingTemporaryProblems(final IssueTypeSet.ProblemCategory issueCategory) { return YamlDocumentProvider.this.handleTemporaryProblems; } @@ -98,19 +97,7 @@ final boolean newHandleTemporaryProblems= access.getPreferenceValue(YamlEditorBuild.PROBLEMCHECKING_ENABLED_PREF); if (this.handleTemporaryProblems != newHandleTemporaryProblems) { this.handleTemporaryProblems= newHandleTemporaryProblems; - if (this.handleTemporaryProblems) { - YamlModel.getYamlModelManager().refresh(Ltk.EDITOR_CONTEXT); - } - else { - final List<? extends SourceUnit> sus= LtkModels.getSourceUnitManager().getOpenSourceUnits( - YamlModel.YAML_TYPE_ID, Ltk.EDITOR_CONTEXT ); - for (final SourceUnit su : sus) { - final IAnnotationModel model= getAnnotationModel(su); - if (model instanceof ThisAnnotationModel) { - ((ThisAnnotationModel) model).clearProblems(null); - } - } - } + YamlModel.getYamlModelManager().refresh(Ltk.EDITOR_CONTEXT); } }
diff --git a/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/yaml/ui/editors/YamlEditorBuild.java b/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/yaml/ui/editors/YamlEditorBuild.java index 34ff903..a2cf3a5 100644 --- a/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/yaml/ui/editors/YamlEditorBuild.java +++ b/yaml/org.eclipse.statet.yaml.ui/src/org/eclipse/statet/yaml/ui/editors/YamlEditorBuild.java
@@ -36,20 +36,20 @@ YamlEditingSettings.EDITING_PREF_QUALIFIER, "ProblemChecking.enabled"); //$NON-NLS-1$ - public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.error"; //$NON-NLS-1$ - public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.warning"; //$NON-NLS-1$ - public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.info"; //$NON-NLS-1$ + public static final String ERROR_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.error"; //$NON-NLS-1$ + public static final String WARNING_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.warning"; //$NON-NLS-1$ + public static final String INFO_ANNOTATION_TYPE= "org.eclipse.statet.yaml.ui.info"; //$NON-NLS-1$ private static final IssueTypeSet.ProblemTypes PROBLEM_ANNOTATION_TYPES= new IssueTypeSet.ProblemTypes( ERROR_ANNOTATION_TYPE, WARNING_ANNOTATION_TYPE, INFO_ANNOTATION_TYPE ); - public static final IssueTypeSet.ProblemTypeDef YAML_MODEL_PROBLEM_TYPE_DEF= new IssueTypeSet.ProblemTypeDef( + public static final IssueTypeSet.ProblemCategory YAML_MODEL_PROBLEM_CATEGORY= new IssueTypeSet.ProblemCategory( YamlModel.YAML_TYPE_ID, null, PROBLEM_ANNOTATION_TYPES ); public static final IssueTypeSet YAML_ISSUE_TYPE_SET= new IssueTypeSet(YamlUI.BUNDLE_ID, - new IssueTypeSet.TaskTypeDef(null, null), + new IssueTypeSet.TaskCategory(null, null), ImCollections.newList( - YamlEditorBuild.YAML_MODEL_PROBLEM_TYPE_DEF )); + YamlEditorBuild.YAML_MODEL_PROBLEM_CATEGORY )); }