1 19 20 21 package org.netbeans.modules.search.types; 22 23 24 import java.util.List ; 25 import java.util.LinkedList ; 26 import java.util.Collections ; 27 import org.openide.util.HelpCtx; 28 import org.openide.util.NbBundle; 29 import org.openidex.search.SearchPattern; 30 31 32 37 public class ObjectNameCustomizer extends TextCustomizer { 38 39 40 public ObjectNameCustomizer() { 41 HelpCtx.setHelpIDString(this, ObjectNameType.class.toString()); 42 } 43 44 45 protected String getBorderLabel() { 46 return NbBundle.getBundle(ObjectNameCustomizer.class) 47 .getString("TEXT_LABEL_NAME_CONTAINS"); } 49 50 51 private static int MAX_SEARCH_HISTORY_LENGTH = 50; 52 private static LinkedList searchPatterns = new LinkedList (); 53 59 protected List getSearchPatterns() { 60 return Collections.unmodifiableList(searchPatterns); 61 } 62 63 66 protected void addSearchPattern(SearchPattern pattern) { 67 while (searchPatterns.size() > MAX_SEARCH_HISTORY_LENGTH-1) 68 searchPatterns.removeLast(); 69 searchPatterns.addFirst(pattern); 70 } 71 72 } 73 | Popular Tags |