Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
277,500
void (@Nullable Project project) { myProject = project; }
setProject
277,501
void (@Nullable Sdk projectJdk) { myProjectJdk = projectJdk; }
setProjectJdk
277,502
void (@NotNull AnActionEvent e) { jdksModel.doAdd(ExternalSystemJdkComboBox.this, selectedJdk, javaSdkType, updateTree); }
actionPerformed
277,503
Sdk () { String jdkName = getSelectedValue(); Sdk jdk = null; try { jdk = ExternalSystemJdkUtil.resolveJdkName(myProjectJdk, jdkName); } catch (ExternalSystemJdkException ignore) { } return jdk; }
getSelectedJdk
277,504
void (boolean highlightInternalJdk) { myHighlightInternalJdk = highlightInternalJdk; }
setHighlightInternalJdk
277,505
void (@Nullable String selectedValue) { refreshData(selectedValue, null); }
refreshData
277,506
void (@Nullable String selectedValue, @Nullable Sdk projectJdk) { myProjectJdk = projectJdk; Map<String, JdkComboBoxItem> jdkMap = collectComboBoxItem(); if (ExternalSystemJdkUtil.USE_INTERNAL_JAVA.equals(selectedValue)) { jdkMap.put(selectedValue, getInternalJdkItem()); } else if (selectedValue != null && !jdkMap.cont...
refreshData
277,507
void (@Nullable String selectedValue) { ComboBoxModel<JdkComboBoxItem> model = getModel(); for (int i = 0; i < model.getSize(); i++) { JdkComboBoxItem item = model.getElementAt(i); if (item.jdkName.equals(selectedValue)) { model.setSelectedItem(item); return; } } if (ExternalSystemJdkUtil.USE_INTERNAL_JAVA.equals(selec...
select
277,508
JdkComboBoxItem () { ExternalSystemJdkProvider jdkProvider = ExternalSystemJdkProvider.getInstance(); Sdk internalJdk = jdkProvider.getInternalJdk(); return new JdkComboBoxItem( ExternalSystemJdkUtil.USE_INTERNAL_JAVA, ExternalSystemBundle.message("external.system.java.internal.jre"), buildComment(internalJdk), !myHigh...
getInternalJdkItem
277,509
String () { final DefaultComboBoxModel model = (DefaultComboBoxModel)getModel(); final Object item = model.getSelectedItem(); return item != null ? ((JdkComboBoxItem)item).jdkName : null; }
getSelectedValue
277,510
String (@NotNull Sdk sdk) { String versionString = sdk.getVersionString(); String homePath = sdk.getHomePath(); String path = homePath == null ? null : truncateLongPath(homePath); if (versionString == null && path == null) { return ""; } if (path == null) { return versionString; } if (versionString == null) { return Ex...
buildComment
277,511
String (@NotNull String path) { if (path.length() > MAX_PATH_LENGTH) { return path.substring(0, MAX_PATH_LENGTH / 2) + "..." + path.substring(path.length() - MAX_PATH_LENGTH / 2 - 3); } return path; }
truncateLongPath
277,512
SimpleTextAttributes (final boolean valid, final boolean selected) { if (!valid) { return SimpleTextAttributes.ERROR_ATTRIBUTES; } else if (selected && !(SystemInfoRt.isWindows && UIManager.getLookAndFeel().getName().contains("Windows"))) { return SimpleTextAttributes.SELECTED_SIMPLE_CELL_ATTRIBUTES; } else { return Si...
getTextAttributes
277,513
void (ActionEvent e) { doOKAction(); myResult = null; }
actionPerformed
277,514
void () { SimpleNode node = getSelectedNode(); if (node instanceof NullNode) node = null; myResult = node instanceof ProjectNode ? ((ProjectNode)node).getData() : null; super.doOKAction(); }
doOKAction
277,515
void (@NotNull ExternalSystemNode node, @Nullable String actionId, InputEvent inputEvent) { if(node instanceof ProjectNode ) { doOKAction(); } }
handleDoubleClickOrEnter
277,516
ProjectData () { return myResult; }
getResult
277,517
void () { SimpleNode node = getSelectedNode(); if (node instanceof NullNode) node = null; myResult = node instanceof TaskNode ? Pair.create(((TaskNode)node).getModuleOwnerName(), ((TaskNode)node).getData()) : null; super.doOKAction(); }
doOKAction
277,518
void () { super.doCancelAction(); myResult = null; }
doCancelAction
277,519
void (@NotNull ExternalSystemNode node, @Nullable String actionId, InputEvent inputEvent) { if (node instanceof ProjectNode) { doOKAction(); } }
handleDoubleClickOrEnter
277,520
Object (Object rootElement) { if (!(rootElement instanceof ProjectNode)) return rootElement; ModuleNode effectiveRoot = ((ProjectNode)rootElement).getEffectiveRoot(); return effectiveRoot != null ? effectiveRoot : rootElement; }
customizeProjectsTreeRoot
277,521
String () { return myProjectName; }
getLookupString
277,522
void (@NotNull InsertionContext context) { Editor editor = context.getEditor(); final FoldingModel foldingModel = editor.getFoldingModel(); foldingModel.runBatchFoldingOperation(() -> { FoldRegion[] regions = foldingModel.getAllFoldRegions(); for (FoldRegion region : regions) { foldingModel.removeFoldRegion(region); } ...
handleInsert
277,523
String (@NotNull String targetProjectPath, @Nullable String rootProjectPath) { return new File(targetProjectPath).getParentFile().getName(); }
getProjectRepresentationName
277,524
FileChooserDescriptor () { return null; }
getExternalProjectConfigDescriptor
277,525
Icon () { return AllIcons.Nodes.IdeaProject; }
getProjectIcon
277,526
Icon () { return ExternalSystemIcons.Task; }
getTaskIcon
277,527
void (@NotNull ExternalProjectInfo projectInfo) { myProjectInfo = projectInfo; myExternalSystemUiAware = ExternalSystemUiUtil.getUiAware(myProjectInfo.getProjectSystemId()); myTree = createTree(); updateSelectionState(); myTree.addCheckboxTreeListener(new CheckboxTreeListener() { @Override public void nodeStateChanged(...
init
277,528
void (@NotNull CheckedTreeNode node) { updateSelectionState(); }
nodeStateChanged
277,529
boolean () { return myModulesCount > 1; }
hasMultipleDataToSelect
277,530
void () { myModificationTracker.incModificationCount(); mySelectionStatusLbl.setText(selectionState.getValue().message); }
updateSelectionState
277,531
JComponent () { ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTree). addExtraAction(new SelectAllButton()). addExtraAction(new UnselectAllButton()). addExtraAction(new ShowSelectedOnlyButton()). addExtraAction(new SelectRequiredButton()). setToolbarPosition(ActionToolbarPosition.BOTTOM); contentPanel....
createCenterPanel
277,532
void () { final DefaultTreeModel treeModel = (DefaultTreeModel)myTree.getModel(); final Object root = treeModel.getRoot(); if (!(root instanceof CheckedTreeNode rootNode)) return; final Couple<CheckedTreeNode> rootAndPreselectedNode = createRoot(); final CheckedTreeNode rootCopy = rootAndPreselectedNode.first; List<Tre...
reloadTree
277,533
void () { loadingPanel.setLoadingText(ExternalSystemBundle.message("please.wait")); loadingPanel.startLoading(); final DataNode<ProjectData> projectStructure = myProjectInfo.getExternalProjectStructure(); if (projectStructure != null) { final boolean[] isModified = {false}; projectStructure.visit(node -> { final DataNo...
doOKAction
277,534
void (@NotNull ProgressIndicator indicator) { ProjectDataManager.getInstance().importData(projectStructure, myProject); }
run
277,535
void () { ExternalSystemApiUtil.visit(myProjectInfo.getExternalProjectStructure(), node -> { node.removeUserData(MODIFIED_NODE_KEY); node.removeUserData(CONNECTED_UI_NODE_KEY); }); super.doCancelAction(); }
doCancelAction
277,536
CheckboxTree () { final Couple<CheckedTreeNode> rootAndPreselectedNode = createRoot(); final CheckedTreeNode root = rootAndPreselectedNode.first; final CheckboxTree tree = new CheckboxTree(new CheckboxTree.CheckboxTreeCellRenderer(true, false) { @Override public void customizeRenderer(JTree tree, Object value, boolean ...
createTree
277,537
void (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { if (!(value instanceof DataNodeCheckedTreeNode node)) { return; } String tooltip = null; boolean hasErrors = false; if (node.isChecked()) { final Enumeration children = node.children(); while (children.hasMore...
customizeRenderer
277,538
Couple<CheckedTreeNode> () { final Map<DataNode<?>, DataNodeCheckedTreeNode> treeNodeMap = new IdentityHashMap<>(); final Map<String, DataNode<?>> ideGroupingMap = new TreeMap<>(); // need order for assigning parents final DataNodeCheckedTreeNode[] preselectedNode = {null}; final DataNodeCheckedTreeNode[] rootModuleNod...
createRoot
277,539
void (final boolean checked) { super.setChecked(checked); if (checked) { DataNodeCheckedTreeNode parent = this; DataNodeCheckedTreeNode moduleNode = null; while (parent.parent instanceof DataNodeCheckedTreeNode) { if (moduleNode == null && (myDependencyAwareDataKeys.contains(parent.myDataNode.getKey()))) { moduleNode =...
setChecked
277,540
void (boolean checked) { List<DataNode<Identifiable>> selectedModules = new SmartList<>(); for (DataNode node : TreeUtil.collectSelectedObjectsOfType(myTree, DataNode.class)) { if (myDependencyAwareDataKeys.contains(node.getKey())) { //noinspection unchecked selectedModules.add(node); } } final Set<DataNode<Identifiabl...
warnAboutMissedDependencies
277,541
DataNode (@NotNull DataNode node) { DataNode modifiedDataNode = (DataNode)node.getUserData(MODIFIED_NODE_KEY); if (modifiedDataNode == null) { modifiedDataNode = node.nodeCopy(); node.putUserData(MODIFIED_NODE_KEY, modifiedDataNode); } return modifiedDataNode; }
getModifiableDataNode
277,542
SelectionState () { boolean isRequiredSelectionEnabled = computeRequiredSelectionStatus(); String stateMessage = ""; final Object root = myTree.getModel().getRoot(); if (root instanceof CheckedTreeNode) { final int[] selectedModulesCount = {0}; TreeUtil.traverse((CheckedTreeNode)root, node -> { if (node instanceof Data...
getSelectionStatus
277,543
boolean () { for (DataNode<Identifiable> node : dependentNodeMap.keySet()) { final DataNodeCheckedTreeNode uiNode = node.getUserData(CONNECTED_UI_NODE_KEY); assert uiNode != null; if (!uiNode.isChecked()) continue; for (DataNode<Identifiable> depNode : dependentNodeMap.get(node)) { final DataNodeCheckedTreeNode uiDepen...
computeRequiredSelectionStatus
277,544
void (@NotNull AnActionEvent e) { TreeModel treeModel = myTree.getModel(); Object root = treeModel.getRoot(); if (!(root instanceof CheckedTreeNode)) { return; } if (!myShowSelectedRowsOnly) { myTree.setNodeState((CheckedTreeNode)root, true); } else { myShowSelectedRowsOnly = false; reloadTree(); myTree.setNodeState((C...
actionPerformed
277,545
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
277,546
void (@NotNull AnActionEvent e) { final DefaultTreeModel treeModel = (DefaultTreeModel)myTree.getModel(); final Object root = treeModel.getRoot(); if (!(root instanceof CheckedTreeNode)) return; if (!myShowSelectedRowsOnly) { myTree.setNodeState((CheckedTreeNode)root, false); } else { myShowSelectedRowsOnly = false; re...
actionPerformed
277,547
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
277,548
boolean (AnActionEvent e) { return myShowSelectedRowsOnly; }
isSelected
277,549
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
277,550
void (AnActionEvent e, boolean state) { myShowSelectedRowsOnly = state; reloadTree(); }
setSelected
277,551
void (@NotNull AnActionEvent e) { boolean showSelectedRowsOnly = myShowSelectedRowsOnly; if (showSelectedRowsOnly) { myShowSelectedRowsOnly = false; reloadTree(); } myTree.clearSelection(); for (DataNode<Identifiable> node : dependentNodeMap.keySet()) { final DataNodeCheckedTreeNode uiNode = node.getUserData(CONNECTED_...
actionPerformed
277,552
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
277,553
boolean () { return true; }
displayTextInToolbar
277,554
boolean () { final BooleanValueHolder result = new BooleanValueHolder(false); UnindexedFilesScannerExecutor.getInstance(myProject).suspendScanningAndIndexingThenRun(ExternalSystemBundle.message("activity.name.select.external.data"), () -> result.setValue(super.showAndGet()) ); return result.getValue(); }
showAndGet
277,555
MyPathAndProjectButtonPanel (@NotNull final Project project, @NotNull final ProjectSystemId externalSystemId) { final EditorTextField textField = createTextField(project, externalSystemId); final FixedSizeButton selectRegisteredProjectButton = new FixedSizeButton(); selectRegisteredProjectButton.setIcon(AllIcons.Nodes....
createPanel
277,556
void (ActionEvent e) { final Ref<JBPopup> popupRef = new Ref<>(); final Tree tree = buildRegisteredProjectsTree(project, externalSystemId); tree.setBorder(JBUI.Borders.empty(8)); Runnable treeSelectionCallback = () -> { TreePath path = tree.getSelectionPath(); if (path != null) { Object lastPathComponent = path.getLast...
actionPerformed
277,557
Tree (@NotNull Project project, @NotNull ProjectSystemId externalSystemId) { ExternalSystemTasksTreeModel model = new ExternalSystemTasksTreeModel(externalSystemId); ExternalSystemTasksTree result = new ExternalSystemTasksTree(model, new HashMap<>(), project, externalSystemId); ExternalSystemManager<?, ?, ?, ?, ?> mana...
buildRegisteredProjectsTree
277,558
EditorTextField (@NotNull final Project project, @NotNull final ProjectSystemId externalSystemId) { ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId); assert manager != null; final AbstractExternalSystemLocalSettings<?> settings = manager.getLocalSettingsProvider().fun(pr...
createTextField
277,559
void (@NotNull String text, int offset, @NotNull String prefix, @NotNull CompletionResultSet result) { for (Map.Entry<ExternalProjectPojo, Collection<ExternalProjectPojo>> entry : settings.getAvailableProjects().entrySet()) { String rootProjectPath = entry.getKey().getPath(); String rootProjectName = uiAware.getProject...
addCompletionVariants
277,560
void (final String text) { getChildComponent().getTextField().setText(text); Editor editor = getChildComponent().getTextField().getEditor(); if (editor != null) { collapseIfPossible(editor, myExternalSystemId, myProject); } }
setText
277,561
void (@NotNull final Editor editor, @NotNull ProjectSystemId externalSystemId, @NotNull Project project) { ExternalSystemManager<?,?,?,?,?> manager = ExternalSystemApiUtil.getManager(externalSystemId); assert manager != null; final AbstractExternalSystemLocalSettings<?> settings = manager.getLocalSettingsProvider().fun...
collapseIfPossible
277,562
void (@NotNull final Editor editor, @NotNull final String placeholder) { final FoldingModel foldingModel = editor.getFoldingModel(); foldingModel.runBatchFoldingOperation(() -> { for (FoldRegion region : foldingModel.getAllFoldRegions()) { foldingModel.removeFoldRegion(region); } FoldRegion region = foldingModel.addFol...
collapse
277,563
String () { return getChildComponent().getTextField().getText(); }
getText
277,564
void (@NotNull EditorTextField pathField) { myPathField = pathField; }
setPathField
277,565
void (ActionEvent e) { if (myPathField == null) { assert false; return; } PropertiesComponent component = PropertiesComponent.getInstance(myProject); String pathToStart = myPathField.getText(); if (StringUtil.isEmpty(pathToStart)) { pathToStart = component.getValue(PROJECT_FILE_TO_START_WITH_KEY); } VirtualFile fileToS...
actionPerformed
277,566
EditorTextField () { return myTextField; }
getTextField
277,567
void (@NotNull Project project, @NotNull ExternalSystemManager<?, ?, ?, ?, ?> manager, @NotNull Collection<? extends ExternalProjectSettings> settingList) { }
onProjectsLoaded
277,568
void (@NotNull Project project, @NotNull ExternalSystemManager<?, ?, ?, ?, ?> manager, @NotNull Collection<? extends ExternalProjectSettings> __) { // https://youtrack.jetbrains.com/issue/IDEA-289729 if (project.isDefault()) { return; } StartupManager startupManager = StartupManager.getInstance(project); // show tool w...
onProjectsLinked
277,569
void (@NotNull Project project, @NotNull ExternalSystemManager<?, ?, ?, ?, ?> manager, @NotNull Set<String> linkedProjectPaths) { AbstractExternalSystemSettings<?, ?, ?> settings = manager.getSettingsProvider().fun(project); if (!settings.getLinkedProjectsSettings().isEmpty()) { return; } ToolWindow toolWindow = getToo...
onProjectsUnlinked
277,570
void (@NotNull ToolWindow toolWindow, @NotNull AbstractExternalSystemSettings<?, ?, ?> settings, boolean showToolWindow) { if (toolWindow.isAvailable() && !showToolWindow) { return; } AppUIUtil.invokeLaterIfProjectAlive(toolWindow.getProject(), () -> { boolean shouldShow = showToolWindow && settings.getLinkedProjectsSe...
activate
277,571
ProjectSystemId () { return ProjectSystemId.IDE; }
getTargetExternalSystemId
277,572
void ( @NotNull NotificationData notification, @NotNull Project project, @NotNull String externalProjectPath, @Nullable Throwable error ) { if (error == null) return; Throwable unwrapped = RemoteUtil.unwrap(error); if (unwrapped instanceof ExternalSystemException) { updateNotification(notification, project, (ExternalSy...
customize
277,573
void (@NotNull final NotificationData notificationData, @NotNull final Project project, @NotNull ExternalSystemException e) { for (String fix : e.getQuickFixes()) { if (OpenProjectJdkSettingsCallback.ID.equals(fix)) { notificationData.setListener(OpenProjectJdkSettingsCallback.ID, new OpenProjectJdkSettingsCallback(pro...
updateNotification
277,574
void (@NotNull Notification notification, @NotNull HyperlinkEvent event) { if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return; final NotificationListener notificationListener = myListenerMap.get(event.getDescription()); if (notificationListener != null) { notificationListener.hyperlinkUpdate(notific...
hyperlinkActivated
277,575
void (@NotNull @NotificationTitle String title) { myTitle = title; }
setTitle
277,576
void (@NotNull @NotificationContent String message) { myMessage = message; }
setMessage
277,577
NotificationCategory () { return myNotificationCategory; }
getNotificationCategory
277,578
void (@NotNull NotificationCategory notificationCategory) { myNotificationCategory = notificationCategory; }
setNotificationCategory
277,579
NotificationSource () { return myNotificationSource; }
getNotificationSource
277,580
NotificationListener () { return myListener; }
getListener
277,581
String () { return myFilePath; }
getFilePath
277,582
void (@Nullable String filePath) { myFilePath = filePath; }
setFilePath
277,583
Integer () { return myLine; }
getLine
277,584
void (int line) { myLine = line; }
setLine
277,585
int () { return myColumn; }
getColumn
277,586
void (int column) { myColumn = column; }
setColumn
277,587
boolean () { return myBalloonNotification; }
isBalloonNotification
277,588
void (boolean balloonNotification) { myBalloonNotification = balloonNotification; }
setBalloonNotification
277,589
void (@NotNull String listenerId, @NotNull NotificationListener listener) { myListenerMap.put(listenerId, listener); }
setListener
277,590
List<String> () { return new ArrayList<>(myListenerMap.keySet()); }
getRegisteredListenerIds
277,591
Navigatable () { if (navigatable == null || navigatable == NonNavigatable.INSTANCE) { for (String id : myListenerMap.keySet()) { if (id.startsWith("openFile:")) { return new NavigatableAdapter() { @Override public void navigate(boolean requestFocus) { NotificationListener listener = myListenerMap.get(id); if (listener ...
getNavigatable
277,592
void (boolean requestFocus) { NotificationListener listener = myListenerMap.get(id); if (listener != null) { // Notification here used only to be able to call 'NotificationListener.hyperlinkUpdate' //noinspection UnresolvedPluginConfigReference listener.hyperlinkUpdate(new Notification("", "", NotificationType.INFORMAT...
navigate
277,593
void (@Nullable Navigatable navigatable) { this.navigatable = navigatable; }
setNavigatable
277,594
NotificationGroup () { return myBalloonGroup; }
getBalloonGroup
277,595
void (NotificationGroup balloonGroup) { myBalloonGroup = balloonGroup; }
setBalloonGroup
277,596
void () { myListenerMap.clear(); }
dispose
277,597
int () { return myValue; }
getMessageCategory
277,598
NotificationType () { return convert(this); }
getNotificationType
277,599
NotificationType (NotificationCategory notificationCategory) { return switch (notificationCategory) { case ERROR -> NotificationType.ERROR; case INFO, SIMPLE -> NotificationType.INFORMATION; case WARNING -> NotificationType.WARNING; }; }
convert