Commit 87830dfd authored by Sabine Teufl's avatar Sabine Teufl
Browse files

bug fixed filtering elements in the overview

refs 1400
parent c86b6632
......@@ -18,6 +18,7 @@ $Id$
package org.fortiss.af3.mira.ui.editor;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirst;
import static org.fortiss.af3.mira.ui.editor.overview.OverviewLabelProvider.addOverviewContentFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getDisplayTypeFor;
import java.util.List;
......@@ -104,7 +105,7 @@ public class AnalysisEditor extends OverviewEditorBase<Analysis> {
} else {
overviewList.add(element.getName());
overviewList.add(getDisplayTypeFor(element));
overviewList.add(element.getComment());
}
}
}
......@@ -18,6 +18,7 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.af3.mira.ui.editor;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirst;
import static org.fortiss.af3.mira.ui.editor.overview.OverviewLabelProvider.addOverviewContentFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getDisplayTypeFor;
import java.util.List;
......@@ -106,9 +107,8 @@ public class RequirementsContainerEditor<T extends RequirementsContainer> extend
} else {
overviewList.add(element.getName());
overviewList.add(getDisplayTypeFor(element));
overviewList.add(element.getComment());
}
overviewList.add(element.getComment());
}
}
......@@ -18,6 +18,7 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.af3.mira.ui.editor;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirst;
import static org.fortiss.af3.mira.ui.editor.overview.OverviewLabelProvider.addOverviewContentFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getDisplayTypeFor;
import java.util.List;
......@@ -105,8 +106,8 @@ public class RequirementsPackageEditor<T extends RequirementsPackage> extends Ov
} else {
overviewList.add(element.getName());
overviewList.add(getDisplayTypeFor(element));
overviewList.add(element.getComment());
}
overviewList.add(element.getComment());
}
}
......@@ -18,6 +18,7 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.af3.mira.ui.editor.glossary;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirst;
import static org.fortiss.af3.mira.ui.editor.overview.OverviewLabelProvider.addOverviewContentFor;
import java.util.List;
......@@ -102,7 +103,6 @@ public class GlossaryEditor extends OverviewEditorBase<Glossary> {
protected void addOverviewList(List<String> checkList, INamedCommentedElement element) {
if(element instanceof GlossaryEntry) {
addOverviewContentFor(checkList, (GlossaryEntry)element);
checkList.add(element.getComment());
}
}
......
......@@ -19,7 +19,6 @@ package org.fortiss.af3.mira.ui.editor.overview;
import static org.conqat.lib.commons.string.StringUtils.isEmpty;
import static org.eclipse.emf.ecore.util.EcoreUtil.getAllContents;
import static org.fortiss.af3.mira.utils.MiraUtils.getContextElementName;
import static org.fortiss.af3.mira.utils.MiraUtils.getDisplayTypeFor;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.DECORATION_KEY;
......@@ -54,7 +53,6 @@ import org.fortiss.af3.mira.model.RequirementsContainer;
import org.fortiss.af3.mira.model.RequirementsPackage;
import org.fortiss.af3.mira.model.glossary.Glossary;
import org.fortiss.af3.mira.model.requirementSource.RequirementSource;
import org.fortiss.af3.mira.utils.MiraUtils;
import org.fortiss.tooling.base.model.element.IHierarchicElement;
import org.fortiss.tooling.base.ui.editor.FormsEditorBase;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
......@@ -209,29 +207,6 @@ public abstract class OverviewEditorBase<T extends IHierarchicElement> extends F
/** Add check content to check list for filter */
protected abstract void addOverviewList(List<String> checkList, INamedCommentedElement element);
/** Add the name, type, description of given {@link Requirement} to check list */
protected void addOverviewContentFor(List<String> overviewList, Requirement req) {
if(!isEmpty(req.getName())) {
overviewList.add(MiraUtils.getRequirementName(req));
}
overviewList.add(getDisplayTypeFor(req));
if(!isEmpty(req.getDescription())) {
overviewList.add(req.getDescription());
}
}
/** Add the name, type, definition of given {@link ContextElement} to check list */
protected void addOverviewContentFor(List<String> overviewList, ContextElement element) {
if(!isEmpty(element.getName())) {
overviewList.add(getContextElementName(element));
}
overviewList.add(getDisplayTypeFor(element));
if(!isEmpty(element.getDefinition())) {
overviewList.add(element.getDefinition());
}
}
/** Check if the string in filterText field appears in the given check list completely */
protected boolean checkAppearence(List<String> checkList) {
String[] filterTextArray = filterText.getText().split(" +");
......
......@@ -23,6 +23,8 @@ import static org.fortiss.af3.mira.utils.MiraUtils.getContextElementName;
import static org.fortiss.af3.mira.utils.MiraUtils.getDisplayTypeFor;
import static org.fortiss.af3.mira.utils.MiraUtils.getRequirementName;
import java.util.List;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
......@@ -170,7 +172,7 @@ public class OverviewLabelProvider implements ITableLabelProvider {
*
* @return The value for the requirement corresponding to the given column index
*/
private String getColumnText(Requirement requirement, int columnIndex) {
private static String getColumnText(Requirement requirement, int columnIndex) {
if(columnIndex == 0) {
return getDisplayTypeFor(requirement);
......@@ -191,7 +193,7 @@ public class OverviewLabelProvider implements ITableLabelProvider {
* @return The value for the context element source element corresponding to the given column
* index
*/
private String getColumnText(ContextElement element, int columnIndex) {
private static String getColumnText(ContextElement element, int columnIndex) {
if(columnIndex == 0) {
return getDisplayTypeFor(element);
......@@ -225,4 +227,18 @@ public class OverviewLabelProvider implements ITableLabelProvider {
return null;
}
/** Add the name, type, description of given {@link Requirement} to check list */
public static void addOverviewContentFor(List<String> overviewList, Requirement req) {
for(int columnIndex = 0; columnIndex < 4; columnIndex++) {
overviewList.add(getColumnText(req, columnIndex));
}
}
/** Add the name, type, definition of given {@link ContextElement} to check list */
public static void addOverviewContentFor(List<String> overviewList, ContextElement element) {
for(int columnIndex = 0; columnIndex < 4; columnIndex++) {
overviewList.add(getColumnText(element, columnIndex));
}
}
}
......@@ -18,6 +18,7 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.af3.mira.ui.editor.requirementSource;
import static org.conqat.ide.commons.ui.selection.SelectionUtils.checkAndPickFirst;
import static org.fortiss.af3.mira.ui.editor.overview.OverviewLabelProvider.addOverviewContentFor;
import java.util.List;
......@@ -102,7 +103,6 @@ public class RequirementSourcesEditor extends OverviewEditorBase<RequirementSour
protected void addOverviewList(List<String> checkList, INamedCommentedElement element) {
if(element instanceof RequirementSourceElement) {
addOverviewContentFor(checkList, (RequirementSourceElement)element);
checkList.add(element.getComment());
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment