1 19 20 package org.netbeans.modules.retouche.navigation.base; 21 22 import java.util.ArrayList ; 23 import java.util.List ; 24 import javax.swing.Icon ; 25 26 35 public final class FiltersDescription { 36 37 public static FiltersManager createManager (FiltersDescription descr) { 38 return FiltersManager.create(descr); 39 } 40 41 42 private List <FilterItem> filters; 43 44 45 public FiltersDescription() { 46 filters = new ArrayList <FilterItem>(); 47 } 48 49 public void addFilter (String name, String displayName, String tooltip, 50 boolean isSelected, Icon selectedIcon, Icon unselectedIcon) { 51 FilterItem newItem = new FilterItem(name, displayName, tooltip, 52 isSelected, selectedIcon, unselectedIcon); 53 filters.add(newItem); 54 } 55 56 public int getFilterCount () { 57 return filters.size(); 58 } 59 60 public String getName (int index) { 61 return filters.get(index).name; 62 } 63 64 public String getDisplayName (int index) { 65 return filters.get(index).displayName; 66 } 67 68 public String getTooltip (int index) { 69 return filters.get(index).tooltip; 70 } 71 72 public Icon getSelectedIcon (int index) { 73 return filters.get(index).selectedIcon; 74 } 75 76 public Icon getUnselectedIcon (int index) { 77 return filters.get(index).unselectedIcon; 78 } 79 80 public boolean isSelected (int index) { 81 return filters.get(index).isSelected; 82 } 83 84 static class FilterItem { 85 String name; 86 String displayName; 87 String tooltip; 88 Icon selectedIcon; 89 Icon unselectedIcon; 90 boolean isSelected; 91 92 FilterItem (String name, String displayName, String tooltip, 93 boolean isSelected, Icon selectedIcon, Icon unselectedIcon) { 94 this.name = name; 95 this.displayName = displayName; 96 this.tooltip = tooltip; 97 this.selectedIcon = selectedIcon; 98 this.unselectedIcon = unselectedIcon; 99 this.isSelected = isSelected; 100 } 101 102 } 103 104 } 105 | Popular Tags |