Skip to content

Commit

Permalink
Add "Show All Views" option to Models Tree Search Filter
Browse files Browse the repository at this point in the history
- TODO: new screenshots and help in model_tree_search.html
  • Loading branch information
Phillipus committed Dec 3, 2024
1 parent 5526a98 commit 4f15749
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class Messages extends NLS {

public static String SearchWidget_16;

public static String SearchWidget_17;

public static String SearchWidget_2;

public static String SearchWidget_3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.archimatetool.editor.utils.StringUtils;
import com.archimatetool.model.IArchimateConcept;
import com.archimatetool.model.IDiagramModel;
import com.archimatetool.model.IDocumentable;
import com.archimatetool.model.IFolder;
import com.archimatetool.model.IFolderContainer;
Expand Down Expand Up @@ -42,6 +43,7 @@ public class SearchFilter extends ViewerFilter {
private Set<IProfile> fSpecializationsFilter = new HashSet<>();

private boolean fShowAllFolders = false;
private boolean fShowAllViews = false;

SearchFilter() {
}
Expand Down Expand Up @@ -94,6 +96,11 @@ private boolean isElementVisible(Object element) {
}
}

// Show all Views
if(element instanceof IDiagramModel && isShowAllViews()) {
return true;
}

return matchesFilter(element);
}

Expand All @@ -117,6 +124,7 @@ public boolean matchesFilter(Object element) {
|| (isFilteringPropertyKeys() && shouldShowProperty(element));
}


return show;
}

Expand Down Expand Up @@ -252,4 +260,13 @@ void setShowAllFolders(boolean set) {
boolean isShowAllFolders() {
return fShowAllFolders;
}

void setShowAllViews(boolean set) {
fShowAllViews = set;
}

boolean isShowAllViews() {
return fShowAllViews;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,17 @@ public void run() {
action.setChecked(fSearchFilter.isShowAllFolders());
dropDownAction.add(action);

// Show All Views
action = new Action(Messages.SearchWidget_17, IAction.AS_CHECK_BOX) {
@Override
public void run() {
fSearchFilter.setShowAllViews(isChecked());
refreshTree();
}
};
action.setChecked(fSearchFilter.isShowAllViews());
dropDownAction.add(action);

dropDownAction.add(new Separator());

// Reset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ SearchWidget_13=Reset Filters
SearchWidget_14=Other
SearchWidget_15=Strategy
SearchWidget_16=Specializations
SearchWidget_17=Show All Views
SearchWidget_2=Documentation
SearchWidget_3=Search in Documentation
SearchWidget_4=Filter Options
Expand Down

0 comments on commit 4f15749

Please sign in to comment.