private ItemWrapper(CsmOffsetableDeclaration decl){ this.decl = decl; name = decl.getContainingFile().getName(); } @Override
public static CPPParserEx getInstance(CsmFile file, TokenStream ts, int flags, CppParserActionEx callback) { assert (file != null); return getInstance(file.getName(), ts, flags, callback); }
private JMenuItem createItem(final CsmOffsetableDeclaration decl) { JMenuItem item = new JMenuItem(); CsmFile file = decl.getContainingFile(); item.setText(file.getName().toString()); item.putClientProperty(PROP_DECLARATION, decl); item.addActionListener(this); return item; }
private static CharSequence toString(CsmFunction func) { StringBuilder sb = new StringBuilder(); sb.append(func.getClass().getSimpleName()); sb.append(' '); sb.append(func.getQualifiedName()); sb.append(" ["); // NOI18N sb.append(func.getContainingFile().getName()); sb.append(':'); sb.append(func.getStartPosition().getLine()); sb.append(']'); return sb; } }
@Override public void dumpInfo(Lookup context, PrintWriter printOut) { Collection<? extends CsmFile> allFiles = context.lookupAll(CsmFile.class); for (CsmFile csmFile : allFiles) { if(csmFile instanceof FileImpl) { ASTFrameEx frame = new ASTFrameEx(csmFile.getName().toString(), ((FileImpl) csmFile).debugParse()); frame.setVisible(true); } } } }
@Override public int compare(CsmFile o1, CsmFile o2) { CsmProject prj1 = o1.getProject(); CsmProject prj2 = o2.getProject(); if (prj1 == null || prj2 == null || prj1.equals(prj2)) { return CharSequences.comparator().compare(o1.getName(), o2.getName()); } else { return CharSequences.comparator().compare(prj1.getName(), prj2.getName()); } } });
public static String getHtml(CsmObject obj) { if (CsmKindUtilities.isOffsetable(obj)) { return getHtml((CsmOffsetable)obj); } else if (CsmKindUtilities.isFile(obj)) { return CsmDisplayUtilities.htmlize(((CsmFile)obj).getName().toString()); } else { return obj.toString(); } }
protected CharSequence getPositionString() { StringBuilder sb = new StringBuilder(); sb.append('['); CsmFile containingFile = _getFile(false); if (containingFile == null) { sb.append(" NO CONTAINER ").append(fileUID);// NOI18N } else { sb.append(containingFile.getName()); } sb.append(' '); Position pos; pos = getStartPosition(); sb.append(pos.getLine()); sb.append(':'); sb.append(pos.getColumn()); sb.append('-'); pos = getEndPosition(); sb.append(pos.getLine()); sb.append(':'); sb.append(pos.getColumn()); sb.append(']'); return sb; }
private String getOffsetBasedName() { return "[" + this.getContainingFile().getName() + ":" + this.getStartOffset() + "-" + this.getEndOffset() + "]"; // NOI18N }
includeDirective.append("\""); // NOI18N String projectPath = currentFile.getAbsolutePath().toString().substring(0, currentFile.getAbsolutePath().length() - currentFile.getName().length() - 1); if (!incFilePath.startsWith(projectPath)) { projectPath = ""; // NOI18N String projectPath = currentFile.getAbsolutePath().toString().substring(0, currentFile.getAbsolutePath().length() - currentFile.getName().length()); if (incFilePath.startsWith(projectPath)) { includeDirective.append("\""); // NOI18N
public static CharSequence getNamespaceDisplayName(CsmNamespace ns){ CharSequence displayName = ns.getName(); if (displayName.length() == 0) { Collection<CsmNamespaceDefinition> definitions = ns.getDefinitions(); CharSequence fileName = null; if (definitions.size() == 1) { CsmNamespaceDefinition def = definitions.iterator().next(); CsmScope file = def.getScope(); if (file instanceof CsmFile) { fileName = ((CsmFile)file).getName(); } } displayName = ns.getQualifiedName(); int scope = CharSequenceUtils.lastIndexOf(displayName, "::"); // NOI18N if (scope != -1) { displayName = displayName.subSequence(scope + 2, displayName.length()); } int start = CharSequenceUtils.indexOf(displayName, '<'); int end = CharSequenceUtils.indexOf(displayName, '>'); if (start >=0 && end >= 0 && start < end && fileName != null) { CharSequence name = displayName.subSequence(start+1, end); displayName = name+" ("+fileName+")"; // NOI18N } else { if (CharSequenceUtils.indexOf(displayName, '<') >=0 || CharSequenceUtils.indexOf(displayName, '>') >=0) { // NOI18N displayName = displayName.toString().replace('<', ' ').replace('>', ' '); // NOI18N } } } return NameCache.getManager().getString(displayName); }
String gotoFile = decl.getContainingFile().getName().toString(); if (first) { first = false;
elapsedTime = problemDetector.getRemainingTime(); String msg = NbBundle.getMessage(ModelSupport.class, "MSG_ParsingProgressFull", ""+curWorkedUnits, ""+(maxWorkUnits + addedAfterStartParsing), file.getName().toString(), elapsedTime, problem); // NOI18N handle.progress(msg, allWork);
/** * Return the name of the context of the scope element - * either namespace or (for file-level, such as C-style statics) file * (If the element is a nested class, return containing class' namespace) */ public static String getContextName(CsmScopeElement element) { CsmScope scope = element.getScope(); if( CsmKindUtilities.isClass(scope) ) { CsmClass cls = ((CsmClass) scope); CsmNamespace ns = getClassNamespace(cls); return ns.getQualifiedName().toString(); } else if( CsmKindUtilities.isNamespace(scope) ) { return ((CsmNamespace) scope).getQualifiedName().toString(); } else if( CsmKindUtilities.isFile(scope) ) { return ((CsmFile) scope).getName().toString(); } return ""; }
void setFile(CsmFile file, boolean setClose) { if (file != null) { setName(file.getName()+" - "+NbBundle.getMessage(getClass(), "CTL_HierarchyTopComponent")); // NOI18N } else { setName(NbBundle.getMessage(getClass(), "CTL_HierarchyTopComponent")); // NOI18N } setToolTipText(NbBundle.getMessage(getClass(), "HINT_IncludeHierarchyTopComponent")); // NOI18N if (!(last instanceof IncludeHierarchyPanel)) { removeAll(); IncludeHierarchyPanel panel = new IncludeHierarchyPanel(true); add(panel, BorderLayout.CENTER); validate(); last = panel; } if (setClose) { ((IncludeHierarchyPanel)last).setClose(); } else { ((IncludeHierarchyPanel)last).clearClose(); } ((IncludeHierarchyPanel)last).setFile(file); last.requestFocusInWindow(); }
CharSequence fileName = csmFile.getName(); if (CsmKindUtilities.isMacro(csmObj)) {
LOGGER.log(Level.FINE, "KEEP NEW RESOLVED {0} ({1}) at {2}[{4}] Took {3}ms=>{5}\n", new Object[]{fullName, interestedKind, origOffset, time, file.getName(), result});