@Override public Iterator<CsmEnumerator> getEnumerators(CsmEnum en, CsmFilter filter) { if (en instanceof FilterableEnumerators){ return ((FilterableEnumerators)en).getEnumerators(filter); } return en.getEnumerators().iterator(); }
@Override public String getItemText() { return displayFQN ? enm.getQualifiedName().toString() : enm.getName().toString(); }
public void putHotSpotEnum(Collection<CsmEnumerator> enumerators) { if (isCleaned()){ return; } if (hotSpotEnumerators == null) { hotSpotEnumerators = new HashMap<String, CsmEnumerator>(); } Set<CsmEnum> enums = new HashSet<CsmEnum>(); for(CsmEnumerator e : enumerators) { CsmEnum parent = e.getEnumeration(); if (parent != null) { enums.add(parent); } } for(CsmEnum e : enums) { if (!e.isStronglyTyped()) { for(CsmEnumerator i : e.getEnumerators()) { hotSpotEnumerators.put(i.getName().toString(), i); } } } }
@Override public String getItemText() { // TODO: do we need name of enum? return (displayFQN ? enmtr.getEnumeration().getQualifiedName() + CsmCompletion.SCOPE : "") + enmtr.getName(); //NOI18N }
if (!context.isCpp() || !en.isStronglyTyped() && en.getName().length()==0){ addEnumerators(res, en, strPrefix, match, caseSensitive); if (!en.isStronglyTyped() && en.getName().length()==0){ addEnumerators(res, en, strPrefix, match, caseSensitive); if (!context.isCpp() || !en.isStronglyTyped() && en.getName().length()==0){ addEnumerators(res, en, strPrefix, match, caseSensitive);
if (cls.isValid()) { CsmFile file = cls.getContainingFile(); if (file != null && file.isValid()) { return hosts.get(PersistentKey.createKey(cls));
protected String getName() { return enm.getName().toString(); }
objScope = ((CsmEnumerator) obj).getEnumeration().getScope(); } else if (CsmKindUtilities.isScopeElement(obj)) { objScope = ((CsmScopeElement) obj).getScope();
@Override public CsmEnum getCsmEnum() { CsmEnum enm = UIDCsmConverter.UIDtoDeclaration(enumDefinition); // we need to replace i.e. ForwardEnum stub if (enm != null && enm.isValid() && !ForwardEnum.isForwardEnum(enm)) { return enm; } else { enm = super.getCsmEnum(); setCsmEnum(enm); } return enm; }
@Override public CharSequence getQualifiedName() { CsmEnum e = _getEnumeration(); return CharSequences.create(CharSequenceUtils.concatenate(e.getQualifiedName(), "::", getQualifiedNamePostfix())); // NOI18N }
if (cls.isValid()) { CsmFile file = cls.getContainingFile(); if (file != null && file.isValid()) { UpdatebleHost host = hosts.get(PersistentKey.createKey(cls));
CsmScope scope = context.get(i).getScope(); if (CsmKindUtilities.isEnum(scope)) { enumScope = ((CsmEnum)scope).getScope();
private void init(CsmEnum enumeration){ final CharSequence old = name; name = enumeration.getName(); final CharSequence oldQ = qname; qname = enumeration.getQualifiedName(); if( enumImage == null ) { enumImage = CsmImageLoader.getImage(enumeration); } final Runnable runnable = new Runnable() { @Override public void run() { if ((old == null) || !old.equals(name)) { fireNameChange(old == null ? null : old.toString(), name == null ? null : name.toString()); fireDisplayNameChange(old == null ? null : old.toString(), name == null ? null : name.toString()); } if ((oldQ == null) || !oldQ.equals(qname)) { fireShortDescriptionChange(oldQ == null ? null : oldQ.toString(), qname == null ? null : qname.toString()); } } }; if (SwingUtilities.isEventDispatchThread()) { runnable.run(); } else { SwingUtilities.invokeLater(runnable); } }
@SuppressWarnings("unchecked") private static void addEnumerators(List resList, CsmEnum en, String strPrefix, boolean match, boolean caseSensitive){ for(Iterator i = en.getEnumerators().iterator(); i.hasNext();){ CsmNamedElement scpElem = (CsmNamedElement) i.next(); if (CsmSortUtilities.matchName(scpElem.getName(), strPrefix, match, caseSensitive)) { resList.add(scpElem); } } }
if (elemEnum != null && !elemEnum.isStronglyTyped()) { for (Iterator<CsmEnumerator> enmtrIter = elemEnum.getEnumerators().iterator(); enmtrIter.hasNext();) { CsmEnumerator elem = enmtrIter.next(); if (matchName(elem.getName(), strPrefix, match)) {
tooltipText = getHtmlizedString("DSC_TypedefTooltip", tdName, ((CsmTypedef) item).getText()); // NOI18N } else if (CsmKindUtilities.isEnum(item)) { tooltipText = getHtmlizedString("DSC_EnumTooltip", ((CsmEnum) item).getQualifiedName()); // NOI18N } else if (CsmKindUtilities.isEnumerator(item)) { CsmEnumerator enmtr = ((CsmEnumerator) item); tooltipText = getHtmlizedString("DSC_EnumeratorTooltip", enmtr.getName(), enmtr.getEnumeration().getQualifiedName()); // NOI18N } else if (CsmKindUtilities.isField(item)) { CharSequence fieldName = ((CsmField) item).getName();
labelText = getString("DSC_TypeAliasUsages", taName); // NOI18N } else if (CsmKindUtilities.isEnum(refObject)) { labelText = getString("DSC_EnumUsages", ((CsmEnum)refObject).getQualifiedName().toString()); // NOI18N } else if (CsmKindUtilities.isEnumerator(refObject)) { CsmEnumerator enmtr = ((CsmEnumerator)refObject); labelText = getString("DSC_EnumeratorUsages", enmtr.getName().toString(), enmtr.getEnumeration().getName().toString()); // NOI18N } else if (CsmKindUtilities.isField(refObject)) { String fieldName = ((CsmField)refObject).getName().toString();
private void initEnum(CsmEnum en, java.util.Map<PersistentKey, SortedName> res){ for (CsmEnumerator val : en.getEnumerators()) { PersistentKey key = PersistentKey.createKey(val); if (key != null) { res.put(key, new SortedName(0,val.getName(),0)); } } }
if (CsmKindUtilities.isEnum(elem)) { CsmEnum e = (CsmEnum) elem; if (!e.isStronglyTyped()) { for (CsmEnumerator enumerator : e.getEnumerators()) { if(lastName.toString().equals(enumerator.getName().toString())) { referencedDeclaration = enumerator;
private static boolean findInner(CsmEnum enumm, int offset, CsmContext context) { CsmContextUtilities.updateContext(enumm, offset, context); CsmEnumerator enumerator = CsmOffsetUtilities.findObject(enumm.getEnumerators(), context, offset); if (enumerator != null && !CsmOffsetUtilities.sameOffsets(enumm, enumerator)) { CsmContextUtilities.updateContext(enumerator, offset, context); } return true; }