Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
18,300
|
void (boolean indent) { mySerializationHandler.setIndent(indent); }
|
setIndent
|
18,301
|
void (String mediatype) { mySerializationHandler.setMediaType(mediatype); }
|
setMediaType
|
18,302
|
void (boolean b) { mySerializationHandler.setOmitXMLDeclaration(b); }
|
setOmitXMLDeclaration
|
18,303
|
void (String standalone) { mySerializationHandler.setStandalone(standalone); }
|
setStandalone
|
18,304
|
void (String version) { mySerializationHandler.setVersion(version); }
|
setVersion
|
18,305
|
String (String name) { return mySerializationHandler.getOutputProperty(name); }
|
getOutputProperty
|
18,306
|
String (String name) { return mySerializationHandler.getOutputPropertyDefault(name); }
|
getOutputPropertyDefault
|
18,307
|
void (String name, String val) { mySerializationHandler.setOutputProperty(name, val); }
|
setOutputProperty
|
18,308
|
void (String name, String val) { mySerializationHandler.setOutputPropertyDefault(name, val); }
|
setOutputPropertyDefault
|
18,309
|
void (OutputStream output) { mySerializationHandler.setOutputStream(output); }
|
setOutputStream
|
18,310
|
OutputStream () { return mySerializationHandler.getOutputStream(); }
|
getOutputStream
|
18,311
|
void (Writer writer) { mySerializationHandler.setWriter(writer); }
|
setWriter
|
18,312
|
Writer () { return mySerializationHandler.getWriter(); }
|
getWriter
|
18,313
|
void (Properties format) { mySerializationHandler.setOutputFormat(format); }
|
setOutputFormat
|
18,314
|
Properties () { return mySerializationHandler.getOutputFormat(); }
|
getOutputFormat
|
18,315
|
boolean () { return mySerializationHandler.reset(); }
|
reset
|
18,316
|
boolean (Transformer transformer, LocalDebugger dbg) { if (transformer instanceof TransformerImpl) { try { System.out.println("XALAN: " + Class.forName("org.apache.xalan.Version", true, transformer.getClass().getClassLoader()).getMethod("getVersion") .invoke(null)); final TransformerImpl tr = (TransformerImpl)transformer; tr.setErrorListener(new DefaultErrorHandler(false) { @Override public void fatalError(TransformerException exception) throws TransformerException { if (!(exception.getCause() instanceof DebuggerStoppedException)) { super.fatalError(exception); } } }); try { tr.getTraceManager().addTraceListener(new XalanTraceListener(dbg, tr)); } catch (TooManyListenersException e) { throw new AssertionError(e); } return true; } catch (Exception e) { e.printStackTrace(); } } return false; }
|
init
|
18,317
|
TransformerFactory () { final TransformerFactoryImpl factory = new TransformerFactoryImpl(); prepareFactory(factory); return factory; }
|
createTransformerFactory
|
18,318
|
TransformerFactory (TransformerFactory factory) { try { factory.setAttribute("http://xml.apache.org/xalan/properties/source-location", Boolean.TRUE); factory.setAttribute("http://xml.apache.org/xalan/features/optimize", Boolean.FALSE); } catch (Exception e) { // ignore } return factory; }
|
prepareFactory
|
18,319
|
String (DTM dtm, int node) { String pre; switch (dtm.getNodeType(node)) { case Node.DOCUMENT_NODE: return "/"; case Node.ELEMENT_NODE: pre = getPath(dtm, dtm.getParent(node)); return (pre.equals("/") ? "" : pre) + "/" + dtm.getNodeName(node) + "[" + getNumberSimple(dtm, node) + "]"; case Node.ATTRIBUTE_NODE: return getPath(dtm, dtm.getParent(node)) + "/@" + dtm.getNodeNameX(node); case Node.TEXT_NODE: pre = getPath(dtm, dtm.getParent(node)); return (pre.equals("/") ? "" : pre) + "/text()[" + getNumberSimple(dtm, node) + "]"; case Node.COMMENT_NODE: pre = getPath(dtm, dtm.getParent(node)); return (pre.equals("/") ? "" : pre) + "/comment()[" + getNumberSimple(dtm, node) + "]"; case Node.PROCESSING_INSTRUCTION_NODE: pre = getPath(dtm, dtm.getParent(node)); return (pre.equals("/") ? "" : pre) + "/processing-instruction()[" + getNumberSimple(dtm, node) + "]"; } return "?"; }
|
getPath
|
18,320
|
int (DTM dtm, int node) { final String localName = dtm.getLocalName(node); String uri = dtm.getNamespaceURI(node); if (uri == null) uri = ""; final short type = dtm.getNodeType(node); int i = 1; int p = node; while ((p = dtm.getPreviousSibling(p)) != DTM.NULL) { if (dtm.getNodeType(p) == type) { switch (type) { case Node.TEXT_NODE: case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: i++; break; default: if (localName.equals(dtm.getLocalName(p)) && uri.equals(dtm.getNamespaceURI(p))) { i++; } } } } return i; }
|
getNumberSimple
|
18,321
|
Object () { return myValue; }
|
getValue
|
18,322
|
Type () { try { return XPathType.valueOf(myTypeString.toUpperCase(Locale.ENGLISH)); } catch (IllegalArgumentException e) { return new ObjectType(myTypeString); } }
|
getType
|
18,323
|
void (TracerEvent ev) { if (myTracing) return; myTracing = true; // prevents handling of recursive trace() events try { // init if (firstTrace) { firstTrace = false; final SerializationHandler handler = myTransformer.getSerializationHandler(); myTransformer.setSerializationHandler(new TracingSerializationHandler(myDebugger, handler)); } super.trace(ev); final DTMIterator iterator = myTransformer.getContextNodeList(); final int node = myTransformer.getMatchedNode(); final Debugger.SourceFrame sourceFrame = myDebugger.getSourceFrame(); final boolean withSource; if (sourceFrame == null || ((MySourceFrame)sourceFrame).getMatchedNode() != node) { myDebugger.pushSource(new MySourceFrame(sourceFrame, iterator.getDTM(node), node)); withSource = true; } else { withSource = false; } myDebugger.enter(new XalanStyleFrame(ev, myDebugger.getCurrentFrame(), withSource)); } finally { myTracing = false; } }
|
trace
|
18,324
|
void (TracerEvent ev) { if (myTracing) return; if (myDebugger.getCurrentFrame() == null) { return; } // xsl:choose (and maybe others) don't generate traceEnd()-events final String instr = XalanStyleFrame.getInstruction(ev.m_styleNode); while (!instr.equals(myDebugger.getCurrentFrame().getInstruction())) { leave(); } super.traceEnd(ev); leave(); }
|
traceEnd
|
18,325
|
void () { if (((XalanStyleFrame)myDebugger.getCurrentFrame()).isWithSourceFrame()) { myDebugger.popSource(); } myDebugger.leave(); }
|
leave
|
18,326
|
void (GenerateEvent ev) { if (!(myTransformer.getSerializationHandler() instanceof TracingSerializationHandler)) { // internal RTF evaluation, don't care return; } switch (ev.m_eventtype) { case SerializerTrace.EVENTTYPE_STARTDOCUMENT: myDebugger.getEventQueue().startDocument(); break; case SerializerTrace.EVENTTYPE_ENDDOCUMENT: myDebugger.getEventQueue().endDocument(); break; case SerializerTrace.EVENTTYPE_ENDELEMENT: myDebugger.getEventQueue().endElement(); break; case SerializerTrace.EVENTTYPE_CDATA: case SerializerTrace.EVENTTYPE_CHARACTERS: myDebugger.getEventQueue().characters(new String(ev.m_characters, ev.m_start, ev.m_length)); break; case SerializerTrace.EVENTTYPE_COMMENT: myDebugger.getEventQueue().comment(ev.m_data); break; case SerializerTrace.EVENTTYPE_PI: myDebugger.getEventQueue().pi(ev.m_name, ev.m_data); break; } }
|
generated
|
18,327
|
String () { return myPath; }
|
getXPath
|
18,328
|
String () { return mySystemId; }
|
getURI
|
18,329
|
int () { return myLineNumber; }
|
getLineNumber
|
18,330
|
int () { return myMatchedNode; }
|
getMatchedNode
|
18,331
|
void (boolean b) { try { super.stop(b); } finally { if (b) System.exit(0); } }
|
stop
|
18,332
|
boolean () { return myDebugger.ping(); }
|
ping
|
18,333
|
boolean () { return myDebugger.waitForDebuggee(); }
|
waitForDebuggee
|
18,334
|
boolean () { return myDebugger.start(); }
|
start
|
18,335
|
void () { myDebugger.step(); }
|
step
|
18,336
|
void () { myDebugger.stepInto(); }
|
stepInto
|
18,337
|
void () { myDebugger.resume(); }
|
resume
|
18,338
|
boolean () { return myDebugger.isStopped(); }
|
isStopped
|
18,339
|
RemoteBreakpointManager () { return myBreakpointManager; }
|
getBreakpointManager
|
18,340
|
void () { myDebugger.pause(); }
|
pause
|
18,341
|
EventQueue () { return myEventQueue; }
|
getEventQueue
|
18,342
|
UpdateCopyrightsProvider (@NotNull FileType type) { FileType acceptable = getRegisteredFileTypeFromLanguageHierarchy(type); return acceptable == null ? null : super.forFileType(acceptable); }
|
forFileType
|
18,343
|
FileType (@NotNull FileType type) { if (super.forFileType(type) != null) return type; while (type instanceof LanguageFileType) { Language language = ((LanguageFileType)type).getLanguage(); Language baseLanguage = language.getBaseLanguage(); if (baseLanguage == null) break; FileType baseFileType = FileTypeRegistry.getInstance().findFileTypeByLanguage(baseLanguage); if (baseFileType == null) break; if (super.forFileType(baseFileType) != null) return baseFileType; type = baseFileType; } return null; }
|
getRegisteredFileTypeFromLanguageHierarchy
|
18,344
|
String (FileType type, String template, LanguageOptions options) { Commenter commenter = getCommenter(type); if (commenter == null) { return "<No comments>"; } String bs = commenter.getBlockCommentPrefix(); String be = commenter.getBlockCommentSuffix(); String ls = commenter.getLineCommentPrefix(); if ((bs == null || be == null) && ls == null) { return "<No comments>"; } boolean allowBlock = bs != null && be != null; boolean allowLine = ls != null; if (allowLine && !allowBlock) { bs = ls; be = ls; } boolean allowSeparator = getInstance().allowSeparators(type); String filler = options.getFiller(); if (!allowSeparator) { if (Strings.areSameInstance(options.getFiller(), LanguageOptions.DEFAULT_FILLER)) { filler = "~"; } } boolean isBlock = options.isBlock(); boolean isPrefix = options.isPrefixLines(); if (isBlock && !allowBlock) { isPrefix = true; } boolean isBox = options.isBox() && options.isSeparateBefore() && options.isSeparateAfter() && options.getLenBefore() == options.getLenAfter(); StringBuilder preview = new StringBuilder(80); String open = isBlock ? bs : allowLine ? ls : bs; String close = isBlock ? be : allowLine ? ls : be; StringBuilder pre = new StringBuilder(5); StringBuilder leader = new StringBuilder(5); StringBuilder post = new StringBuilder(5); if (Strings.areSameInstance(filler, LanguageOptions.DEFAULT_FILLER)) { filler = open.substring(open.length() - 1); } int offset = 0; if (isBlock) { int pos = open.length() - 1; pre.append(allowBlock ? filler : open.charAt(pos)); while (pos > 0 && open.charAt(pos) == open.charAt(open.length() - 1)) { pos--; offset++; } while (open.length() > 1 && pos >= 0) { leader.append(' '); pos--; } post.append(filler); if (!isPrefix) { pre = new StringBuilder(0); } if (!allowBlock) { close = filler; } } else { if (allowLine) { close = filler; } pre.append(open); post.append(close); } int diff = 0; if (options.isSeparateBefore()) { if (isBlock && isBox && allowBlock) { diff = close.length() - offset; } preview.append(open); for (int i = open.length() + 1; i <= options.getLenBefore() - diff - post.length(); i++) { preview.append(filler); } preview.append(post); preview.append('\n'); } else if (isBlock) { preview.append(open).append('\n'); } if (!template.isEmpty()) { String[] lines = template.split("\n", -1); for (String line : lines) { if (options.isTrim()) { line = line.trim(); } line = StringUtil.trimStart(StringUtil.trimStart(line, pre.toString()), open); line = StringUtil.trimEnd(line, close); preview.append(leader).append(pre); int len = 0; if (pre.length() > 0 && !line.isEmpty()) { preview.append(' '); len++; } preview.append(line); len += line.length() + leader.length() + pre.length(); if (isBox && len < options.getLenBefore() - diff) { for (; len < options.getLenBefore() - diff - post.length(); len++) { preview.append(' '); } if (isBlock || allowLine) { preview.append(post.substring(0, options.getLenBefore() - diff - len)); } } if (!isBlock && !allowLine) { if (preview.charAt(preview.length() - 1) != ' ') { preview.append(' '); } preview.append(close); } preview.append('\n'); } } preview.append(leader); if (options.isSeparateAfter()) { preview.append(pre); for (int i = leader.length() + pre.length(); i < options.getLenAfter() - close.length(); i++) { preview.append(filler); } preview.append(close); preview.append('\n'); } else if (isBlock) { if (!allowBlock) { preview.append(pre).append('\n'); } else { preview.append(close).append('\n'); } } return preview.length() > 0 ? preview.substring(0, preview.length() - 1) : preview.toString(); }
|
buildComment
|
18,345
|
boolean (@NotNull VirtualFile file) { if (file.isDirectory()) { return false; } if (ProjectUtil.isProjectOrWorkspaceFile(file)) return false; return isSupportedType(file.getFileType()); }
|
isSupportedFile
|
18,346
|
boolean (@Nullable PsiFile file) { if (file == null || file instanceof PsiDirectory || file instanceof PsiCodeFragment) { return false; } final VirtualFile virtualFile = file.getVirtualFile(); if (virtualFile == null) return false; if (ProjectUtil.isProjectOrWorkspaceFile(virtualFile)) return false; return isSupportedType(virtualFile.getFileType()); }
|
isSupportedFile
|
18,347
|
Set<FileType> () { return CopyrightUpdaters.INSTANCE.getAllRegisteredExtensions().keySet(); }
|
getSupportedTypes
|
18,348
|
boolean (FileType fileType) { Commenter commenter = getCommenter(fileType); return commenter != null && commenter.getBlockCommentPrefix() != null; }
|
hasBlockComment
|
18,349
|
boolean (FileType fileType) { return !noSeparators.contains(fileType); }
|
allowSeparators
|
18,350
|
Commenter (FileType fileType) { if (fileType instanceof LanguageFileType) { return LanguageCommenters.INSTANCE.forLanguage(((LanguageFileType)fileType).getLanguage()); } return null; }
|
getCommenter
|
18,351
|
void () { noSeparators.add(XmlFileType.INSTANCE); noSeparators.add(HtmlFileType.INSTANCE); noSeparators.add(StdFileTypes.JSP); noSeparators.add(StdFileTypes.JSPX); }
|
createMappings
|
18,352
|
boolean (FileType type) { if (type.isBinary() || type.getName().contains("IDEA") || "GUI_DESIGNER_FORM".equals(type.getName())) { return false; } else { if (CopyrightUpdaters.INSTANCE.forFileType(type) == null) { return false; } Commenter commenter = getCommenter(type); return commenter != null && (commenter.getLineCommentPrefix() != null || commenter.getBlockCommentPrefix() != null); } }
|
isSupportedType
|
18,353
|
int (FileType a, FileType b) { return a.getName().compareToIgnoreCase(b.getName()); }
|
compare
|
18,354
|
void () { }
|
dispose
|
18,355
|
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); DataContext context = e.getDataContext(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } PsiFile file = getFile(context, project); if (!FileTypeUtil.isSupportedFile(file)) { presentation.setEnabled(false); } }
|
update
|
18,356
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
18,357
|
PsiFile (DataContext context, Project project) { PsiFile file = CommonDataKeys.PSI_FILE.getData(context); if (file == null) { Editor editor = CommonDataKeys.EDITOR.getData(context); if (editor != null) { file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); } } return file; }
|
getFile
|
18,358
|
void (@NotNull AnActionEvent e) { DataContext context = e.getDataContext(); Project project = e.getProject(); assert project != null; Module module = e.getData(PlatformCoreDataKeys.MODULE); PsiDocumentManager.getInstance(project).commitAllDocuments(); PsiFile file = getFile(context, project); assert file != null; if (CopyrightManager.getInstance(project).getCopyrightOptions(file) == null) { if (Messages.showOkCancelDialog(project, CopyrightBundle.message("dialog.message.no.copyright.configured"), CopyrightBundle.message("dialog.title.no.copyright.available"), Messages.getQuestionIcon()) == Messages.OK) { ShowSettingsUtil.getInstance().showSettingsDialog(project, new CopyrightProjectConfigurable(project).getDisplayName()); } else { return; } } new UpdateCopyrightProcessor(project, module, file).run(); }
|
actionPerformed
|
18,359
|
UpdateCopyrightCheckinHandlerState () { return this; }
|
getState
|
18,360
|
void (@NotNull UpdateCopyrightCheckinHandlerState state) { XmlSerializerUtil.copyBean(state, this); }
|
loadState
|
18,361
|
UpdateCopyrightCheckinHandlerState (Project project) { return project.getService(UpdateCopyrightCheckinHandlerState.class); }
|
getInstance
|
18,362
|
void () { if (files != null) { process(files); } else if (file != null) { process(file); } else if (myModule != null) { process(myModule); } else { process(myProject); } }
|
run
|
18,363
|
void (@NotNull PsiFile file) { if (!FileModificationService.getInstance().preparePsiElementForWrite(file)) return; execute(() -> { try { return preprocessFile(file, true); } catch (IncorrectOperationException incorrectoperationexception) { LOG.error(incorrectoperationexception); return null; } }); }
|
process
|
18,364
|
Runnable (@NotNull List<? extends PsiFile> files) { ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator(); String msg = null; double fraction = 0.0D; if (indicator != null) { msg = indicator.getText(); fraction = indicator.getFraction(); indicator.setText(message); } final Runnable[] runnables = new Runnable[files.size()]; for (int i = 0; i < files.size(); i++) { PsiFile pfile = files.get(i); if (pfile == null) { LOG.debug("Unexpected null file at " + i); continue; } if (indicator != null) { if (indicator.isCanceled()) { return null; } indicator.setFraction((double)i / (double)files.size()); } if (pfile.isWritable()) { try { runnables[i] = preprocessFile(pfile, true); } catch (IncorrectOperationException incorrectoperationexception) { LOG.error(incorrectoperationexception); } } files.set(i, null); } if (indicator != null) { indicator.setText(msg); indicator.setFraction(fraction); } return () -> { ProgressIndicator indicator1 = ProgressManager.getInstance().getProgressIndicator(); String msg1 = null; double fraction1 = 0.0D; if (indicator1 != null) { msg1 = indicator1.getText(); fraction1 = indicator1.getFraction(); indicator1.setText(message); } for (int j = 0; j < runnables.length; j++) { if (indicator1 != null) { if (indicator1.isCanceled()) { return; } indicator1.setFraction((double)j / (double)runnables.length); } Runnable runnable = runnables[j]; if (runnable != null) { runnable.run(); } runnables[j] = null; } if (indicator1 != null) { indicator1.setText(msg1); indicator1.setFraction(fraction1); } }; }
|
prepareFiles
|
18,365
|
void (final PsiFile @NotNull [] files) { execute(() -> prepareFiles(new ArrayList<>(Arrays.asList(files)))); }
|
process
|
18,366
|
void (@NotNull Project project) { final List<PsiFile> pfiles = new ArrayList<>(); runWithProgress(() -> findFiles(project, pfiles)); handleFiles(pfiles); }
|
process
|
18,367
|
void (@NotNull Module module) { final List<PsiFile> pfiles = new ArrayList<>(); runWithProgress(() -> findFiles(module, pfiles)); handleFiles(pfiles); }
|
process
|
18,368
|
void (@NotNull Project project, List<? super PsiFile> files) { Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { findFiles(module, files); } }
|
findFiles
|
18,369
|
void (@NotNull Module module, @NotNull List<? super PsiFile> files) { final ModuleFileIndex idx = ModuleRootManager.getInstance(module).getFileIndex(); final VirtualFile[] roots = ModuleRootManager.getInstance(module).getContentRoots(); for (final VirtualFile root : roots) { ApplicationManager.getApplication().runReadAction(() -> { idx.iterateContentUnderDirectory(root, dir -> { if (dir.isDirectory()) { final PsiDirectory psiDir = PsiManager.getInstance(module.getProject()).findDirectory(dir); if (psiDir != null) { findFiles(files, psiDir, false); } } return true; }); }); } }
|
findFiles
|
18,370
|
void (@NotNull List<? extends PsiFile> files) { List<VirtualFile> list = new ArrayList<>(); for (PsiFile psiFile : files) { list.add(psiFile.getVirtualFile()); } if (!ReadonlyStatusHandler.getInstance(myProject).ensureFilesWritable(list).hasReadonlyFiles()) { if (!files.isEmpty()) { execute(() -> prepareFiles(files)); } } }
|
handleFiles
|
18,371
|
void (@NotNull List<? super PsiFile> files, @NotNull PsiDirectory directory, boolean subdirs) { final Project project = directory.getProject(); PsiFile[] locals = directory.getFiles(); for (PsiFile local : locals) { CopyrightProfile opts = CopyrightManager.getInstance(project).getCopyrightOptions(local); if (opts != null && FileTypeUtil.isSupportedFile(local)) { files.add(local); } } if (subdirs) { for (PsiDirectory dir : directory.getSubdirectories()) { findFiles(files, dir, true); } } }
|
findFiles
|
18,372
|
void (@NotNull Runnable action) { if (myWithModalProgress) { ProgressManager.getInstance().runProcessWithProgressSynchronously(action, title, true, myProject); } else { ApplicationManager.getApplication().assertIsNonDispatchThread(); action.run(); } }
|
runWithProgress
|
18,373
|
void (@NotNull Computable<Runnable> readAction) { final Runnable[] writeAction = new Runnable[1]; runWithProgress(() -> ApplicationManager.getApplication().runReadAction(() -> { writeAction[0] = readAction.compute(); })); if (writeAction[0] != null) { WriteCommandAction.writeCommandAction(myProject).withName(title).run(() -> { writeAction[0].run(); }); } }
|
execute
|
18,374
|
void (@NotNull AnActionEvent event) { final boolean enabled = isEnabled(event); event.getPresentation().setEnabled(enabled); if (ActionPlaces.isPopupPlace(event.getPlace())) { event.getPresentation().setVisible(enabled); } }
|
update
|
18,375
|
boolean (AnActionEvent e) { final DataContext context = e.getDataContext(); final Project project = e.getProject(); if (project == null) { return false; } if (!CopyrightManager.getInstance(project).hasAnyCopyrights()) { return false; } final VirtualFile[] files = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(context); final Editor editor = CommonDataKeys.EDITOR.getData(context); if (editor != null) { final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); return FileTypeUtil.isSupportedFile(file); } if (files != null && areFiles(files)) { boolean copyrightEnabled = false; for (VirtualFile vfile : files) { if (vfile != null && FileTypeUtil.isSupportedFile(vfile)) { copyrightEnabled = true; break; } } return copyrightEnabled; } if ((files == null || files.length != 1) && LangDataKeys.MODULE_CONTEXT.getData(context) == null && LangDataKeys.MODULE_CONTEXT_ARRAY.getData(context) == null && PlatformCoreDataKeys.PROJECT_CONTEXT.getData(context) == null) { final PsiElement[] elems = LangDataKeys.PSI_ELEMENT_ARRAY.getData(context); if (elems != null) { boolean copyrightEnabled = false; for (PsiElement elem : elems) { if (!(elem instanceof PsiDirectory)) { final PsiFile file = elem.getContainingFile(); if (file == null || !FileTypeUtil.isSupportedFile(file.getVirtualFile())) { copyrightEnabled = true; break; } } } return copyrightEnabled; } } return true; }
|
isEnabled
|
18,376
|
JComponent (@NotNull Project project, BaseAnalysisActionDialog dialog) { myUi = new UpdateCopyrightAdditionalUi(); myUi.getUpdateExistingCopyrightsCb().setSelected(PropertiesComponent.getInstance().getBoolean(UPDATE_EXISTING_COPYRIGHTS, true)); return myUi.getPanel(); }
|
getAdditionalActionSettings
|
18,377
|
void (@NotNull final Project project, @NotNull final AnalysisScope scope) { PropertiesComponent.getInstance().setValue(UPDATE_EXISTING_COPYRIGHTS, String.valueOf(myUi.getUpdateExistingCopyrightsCb().isSelected()), "true"); Task.Backgroundable task = new UpdateCopyrightTask(project, scope, myUi.getUpdateExistingCopyrightsCb().isSelected(), PerformInBackgroundOption.ALWAYS_BACKGROUND); ProgressManager.getInstance().run(task); }
|
analyze
|
18,378
|
boolean () { return myIdx > mySize - 1; }
|
isDone
|
18,379
|
boolean () { final ProgressIndicator indicator = myProgressTask.getIndicator(); if (indicator != null) { indicator.setFraction((double) myIdx/mySize); } myRunnables.next().run(); myIdx++; return true; }
|
iteration
|
18,380
|
void () { myIdx = mySize; }
|
stop
|
18,381
|
boolean (VirtualFile @NotNull [] files) { if (files.length < 2) { return false; } for (VirtualFile file : files) { if (file.isDirectory()) { return false; } } return true; }
|
areFiles
|
18,382
|
void (@NotNull final ProgressIndicator indicator) { myScope.accept(new PsiElementVisitor() { @Override public void visitFile(@NotNull final PsiFile file) { if (indicator.isCanceled()) { return; } final Module module = ModuleUtilCore.findModuleForPsiElement(file); final UpdateCopyrightProcessor processor = new UpdateCopyrightProcessor(file.getProject(), module, file); final Runnable runnable = processor.preprocessFile(file, myAllowReplacement); if (runnable != EmptyRunnable.getInstance()) { preparations.put(file, runnable); } } }); }
|
run
|
18,383
|
void (@NotNull final PsiFile file) { if (indicator.isCanceled()) { return; } final Module module = ModuleUtilCore.findModuleForPsiElement(file); final UpdateCopyrightProcessor processor = new UpdateCopyrightProcessor(file.getProject(), module, file); final Runnable runnable = processor.preprocessFile(file, myAllowReplacement); if (runnable != EmptyRunnable.getInstance()) { preparations.put(file, runnable); } }
|
visitFile
|
18,384
|
void () { if (!preparations.isEmpty()) { if (!FileModificationService.getInstance().preparePsiElementsForWrite(preparations.keySet())) return; final SequentialModalProgressTask progressTask = new SequentialModalProgressTask(myProject, UpdateCopyrightProcessor.TITLE.get(), true); progressTask.setMinIterationTime(200); progressTask.setTask(new UpdateCopyrightSequentialTask(preparations, progressTask)); CommandProcessor.getInstance().executeCommand(myProject, () -> { CommandProcessor.getInstance().markCurrentCommandAsGlobal(myProject); ProgressManager.getInstance().run(progressTask); }, UpdateCopyrightProcessor.TITLE.get(), null); } }
|
onSuccess
|
18,385
|
boolean (@NotNull Project project) { return CopyrightOnSaveInfoProvider.isUpdateCopyrightOnSaveEnabled(project); }
|
isEnabledForProject
|
18,386
|
void (@NotNull Project project, @NotNull Document @NotNull [] documents) { if (DumbService.isDumb(project)) return; FileDocumentManager manager = FileDocumentManager.getInstance(); VirtualFile[] files = ContainerUtil.mapNotNull(documents, d -> manager.getFile(d)).toArray(VirtualFile.EMPTY_ARRAY); if (files.length == 0) { return; } AnalysisScope scope = new AnalysisScope(project, Arrays.asList(files)); UpdateCopyrightAction.UpdateCopyrightTask task = new UpdateCopyrightAction.UpdateCopyrightTask(project, scope, true, PerformInBackgroundOption.DEAF); ProgressManager.getInstance().run(task); }
|
processDocuments
|
18,387
|
boolean (@NotNull Project project) { return PropertiesComponent.getInstance(project).getBoolean(UPDATE_COPYRIGHT_ON_SAVE, UPDATE_COPYRIGHT_BY_DEFAULT); }
|
isUpdateCopyrightOnSaveEnabled
|
18,388
|
boolean () { Configurable configurable = getSettings().getConfigurableWithInitializedUiComponent(CopyrightProjectConfigurable.ID, false); CopyrightProjectConfigurable copyrightProjectConfigurable = ConfigurableWrapper.cast(CopyrightProjectConfigurable.class, configurable); if (copyrightProjectConfigurable != null) { return copyrightProjectConfigurable.hasAnyCopyrights(); } return CopyrightManager.getInstance(context.getProject()).hasAnyCopyrights(); }
|
hasCopyrights
|
18,389
|
boolean () { return hasCopyrights(); }
|
isSaveActionApplicable
|
18,390
|
ActionOnSaveComment () { return ActionOnSaveComment.info(CopyrightBundle.message(hasCopyrights() ? "label.updates.existing.copyrights.e.g.changes.year.or.updated.notice" : "label.no.copyright.configured")); }
|
getComment
|
18,391
|
Collection<String> () { return List.of(CopyrightBundle.message("checkbox.update.copyright.notice")); }
|
getSearchableOptions
|
18,392
|
void (Project project, Module module) { this.project = project; this.module = module; }
|
setup
|
18,393
|
String () { return CopyrightBundle.message("configurable.CopyrightProjectConfigurable.display.name"); }
|
getDisplayName
|
18,394
|
String () { return getId(); }
|
getHelpTopic
|
18,395
|
JComponent () { myOptionsPanel = new ProjectSettingsPanel(project, myProfilesPanel); myProfilesPanel.setUpdate(this::reloadProfiles); return myOptionsPanel.getMainComponent(); }
|
createComponent
|
18,396
|
boolean () { if (myOptionsPanel != null) { return myOptionsPanel.isModified(); } return false; }
|
isModified
|
18,397
|
void () { if (myOptionsPanel != null) { myOptionsPanel.reset(); } }
|
reset
|
18,398
|
void () { myOptionsPanel = null; }
|
disposeUIResources
|
18,399
|
boolean () { return true; }
|
hasOwnContent
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.