Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
291,000
|
int () { return selectedConfigurationType != HIDDEN_ITEMS_STUB ? typesToShow.indexOf(selectedConfigurationType) : super.getDefaultOptionIndex(); }
|
getDefaultOptionIndex
|
291,001
|
String (final ConfigurationFactory value) { return value.getName(); }
|
getTextFor
|
291,002
|
Icon (final ConfigurationFactory factory) { return factory.getIcon(); }
|
getIconFor
|
291,003
|
boolean (final ConfigurationType type) { return type.getConfigurationFactories().length > 1; }
|
hasSubstep
|
291,004
|
void () { List<ConfigurationType> values = step.getValues(); values.clear(); values.addAll(RunConfigurable.Companion.configurationTypeSorted(project, false, ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList(), true)); getListModel().updateOriginalList(); super.onSpeedSearchPatternChanged(); }
|
onSpeedSearchPatternChanged
|
291,005
|
JBPopup (@NotNull Project project, final @NotNull Consumer<? super ConfigurationFactory> creator, final @Nullable ConfigurationType selectedConfigurationType, boolean showTitle) { NewRunConfigurationTreePopupFactory treePopupFactory = ApplicationManager.getApplication().getService(NewRunConfigurationTreePopupFactory.class); treePopupFactory.initStructure(project); AbstractTreeStructure structure = new AbstractTreeStructure() { private final Map<NodeDescriptor<?>, NodeDescriptor<?>[]> myCache = new HashMap<>(); @Override public @NotNull Object getRootElement() { return treePopupFactory.getRootElement(); } @Override public NodeDescriptor<?> @NotNull [] getChildElements(@NotNull Object element) { NodeDescriptor<?> nodeDescriptor = (NodeDescriptor<?>)element; if (!myCache.containsKey(nodeDescriptor)) { myCache.put(nodeDescriptor, treePopupFactory.createChildElements(project, nodeDescriptor)); } return myCache.get(nodeDescriptor); } @Override public @Nullable Object getParentElement(@NotNull Object element) { return ((NodeDescriptor<?>)element).getParentDescriptor(); } @Override public @NotNull NodeDescriptor<?> createDescriptor(@NotNull Object element, @Nullable NodeDescriptor parentDescriptor) { return treePopupFactory.createDescriptor(project, element, parentDescriptor, NodeDescriptor.DEFAULT_WEIGHT); } @Override public void commit() { } @Override public boolean hasSomethingToCommit() { return false; } }; final AtomicBoolean isAutoSelectionPassed = new AtomicBoolean(selectedConfigurationType == null); BaseTreePopupStep<Object> treePopupStep = new BaseTreePopupStep<>( project, showTitle ? ExecutionBundle.message("add.new.run.configuration.action2.name") : null, structure ) { @Override public boolean isSelectable(Object node, Object userData) { if (!(userData instanceof NodeDescriptor)) return false; if (getStructure().getChildElements(userData).length > 0) return false; userData = ((NodeDescriptor<?>)userData).getElement(); if (!project.isDefault() && DumbService.getInstance(project).isDumb() && !NewRunConfigurationTreePopupFactory.isEditableInDumbMode(userData)) { return false; } return isAutoSelectionPassed.get() || userData == selectedConfigurationType; } @Override public PopupStep<?> onChosen(Object selectedValue, boolean finalChoice) { Object element = ((NodeDescriptor<?>)selectedValue).getElement(); if (element instanceof ConfigurationType) { ConfigurationFactory[] factories = ((ConfigurationType)element).getConfigurationFactories(); if (factories.length == 1) { creator.consume(factories[0]); return FINAL_CHOICE; } } if (element instanceof ConfigurationFactory) { creator.consume((ConfigurationFactory)element); return FINAL_CHOICE; } return super.onChosen(selectedValue, finalChoice); } }; TreePopupImpl treePopup = new TreePopupImpl(project, null, treePopupStep, null) { @Override protected void afterShow() { super.afterShow(); isAutoSelectionPassed.set(true); scrollToSelection(); } @Override public boolean shouldBeShowing(Object value) { NodeDescriptor<?> parent = (value instanceof NodeDescriptor) ? ((NodeDescriptor<?>)value).getParentDescriptor() : null; return super.shouldBeShowing(value) || (parent != null && super.shouldBeShowing(parent)); } }; DumbAwareAction collapseAllAction = new DumbAwareAction(UIBundle.message("tree.view.collapse.all.action.name"), null, AllIcons.Actions.Collapseall) { @Override public void actionPerformed(@NotNull AnActionEvent e) { treePopup.collapseAll(); } }; ActionToolbarImpl toolbar = (ActionToolbarImpl)ActionManager.getInstance() .createActionToolbar(ActionPlaces.POPUP, new DefaultActionGroup(collapseAllAction), true); toolbar.setTargetComponent(treePopup.getComponent()); toolbar.setMiniMode(true); var toolbarInsets = JBUI.CurrentTheme.Popup.headerInsets(); if (toolbarInsets instanceof JBInsets scaledInsets) { toolbarInsets = scaledInsets.getUnscaled(); // JBUI.Borders.empty() will scale, need this to avoid double scaling } JBEmptyBorder toolbarBorder = ExperimentalUI.isNewUI() ? JBUI.Borders.empty(toolbarInsets.top, 1, toolbarInsets.bottom, 1) : JBUI.Borders.empty(2, 1, 0, 1); treePopup.getTitle().setButtonComponent(new ActiveComponent() { @Override public void setActive(boolean active) { } @Override public @NotNull JComponent getComponent() { return toolbar.getComponent(); } }, toolbarBorder); return treePopup; }
|
createAddTreePopup
|
291,006
|
Object () { return treePopupFactory.getRootElement(); }
|
getRootElement
|
291,007
|
void () { }
|
commit
|
291,008
|
boolean () { return false; }
|
hasSomethingToCommit
|
291,009
|
boolean (Object node, Object userData) { if (!(userData instanceof NodeDescriptor)) return false; if (getStructure().getChildElements(userData).length > 0) return false; userData = ((NodeDescriptor<?>)userData).getElement(); if (!project.isDefault() && DumbService.getInstance(project).isDumb() && !NewRunConfigurationTreePopupFactory.isEditableInDumbMode(userData)) { return false; } return isAutoSelectionPassed.get() || userData == selectedConfigurationType; }
|
isSelectable
|
291,010
|
void () { super.afterShow(); isAutoSelectionPassed.set(true); scrollToSelection(); }
|
afterShow
|
291,011
|
boolean (Object value) { NodeDescriptor<?> parent = (value instanceof NodeDescriptor) ? ((NodeDescriptor<?>)value).getParentDescriptor() : null; return super.shouldBeShowing(value) || (parent != null && super.shouldBeShowing(parent)); }
|
shouldBeShowing
|
291,012
|
void (@NotNull AnActionEvent e) { treePopup.collapseAll(); }
|
actionPerformed
|
291,013
|
void (boolean active) { }
|
setActive
|
291,014
|
JComponent () { return toolbar.getComponent(); }
|
getComponent
|
291,015
|
void (JPanel addTo, @Nullable JLabel nameLabel) { addTo.setBorder(JBUI.Borders.emptyLeft(5)); UI.PanelFactory.panel(myPanel) .withLabel(ExecutionBundle.message("run.on")) .withComment(ExecutionBundle.message("edit.run.configuration.run.configuration.run.on.comment")) .addToPanel(addTo, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0), false); JLabel runOnLabel = UIUtil.findComponentOfType(addTo, JLabel.class); if (runOnLabel != null && nameLabel != null) { runOnLabel.setLabelFor(myRunOnComboBox); Dimension nameSize = nameLabel.getPreferredSize(); Dimension runOnSize = runOnLabel.getPreferredSize(); double width = Math.max(nameSize.getWidth(), runOnSize.getWidth()); nameLabel.setPreferredSize(new Dimension((int)width, (int)nameSize.getHeight())); runOnLabel.setPreferredSize(new Dimension((int)width, (int)runOnSize.getHeight())); } myRunOnComboBox.addActionListener(e -> { String chosenTarget = myRunOnComboBox.getSelectedTargetName(); if (!StringUtil.equals(myDefaultTargetName, chosenTarget)) { setTargetName(chosenTarget); } }); }
|
buildUi
|
291,016
|
void () { RunConfiguration configuration = mySettings.getConfiguration(); boolean targetAware = configuration instanceof TargetEnvironmentAwareRunProfile && ((TargetEnvironmentAwareRunProfile)configuration).getDefaultLanguageRuntimeType() != null && RunTargetsEnabled.get(); myPanel.getParent().setVisible(targetAware); if (targetAware) { String defaultTargetName = ((TargetEnvironmentAwareRunProfile)configuration).getDefaultTargetName(); LanguageRuntimeType<?> defaultRuntime = ((TargetEnvironmentAwareRunProfile)configuration).getDefaultLanguageRuntimeType(); myRunOnComboBox.setDefaultLanguageRuntimeType(defaultRuntime); resetRunOnComboBox(defaultTargetName); setTargetName(defaultTargetName); } }
|
reset
|
291,017
|
void () { RunConfiguration runConfiguration = mySettings.getConfiguration(); if (runConfiguration instanceof TargetEnvironmentAwareRunProfile) { ((TargetEnvironmentAwareRunProfile)runConfiguration).setDefaultTargetName(myDefaultTargetName); } }
|
apply
|
291,018
|
void (String chosenTarget) { myDefaultTargetName = chosenTarget; if (myEditor instanceof TargetAwareRunConfigurationEditor) { ((TargetAwareRunConfigurationEditor)myEditor).targetChanged(chosenTarget); } }
|
setTargetName
|
291,019
|
void (@Nullable String targetNameToChoose) { myRunOnComboBox.initModel(); List<TargetEnvironmentConfiguration> configs = TargetEnvironmentsManager.getInstance(myProject).getTargets().resolvedConfigs(); myRunOnComboBox.addTargets(ContainerUtil.filter(configs, configuration -> { return TargetEnvironmentConfigurationKt.getTargetType(configuration).isSystemCompatible(); })); myRunOnComboBox.selectTarget(targetNameToChoose); }
|
resetRunOnComboBox
|
291,020
|
boolean (final Project project, @NotNull RunnerAndConfigurationSettings configuration, @NlsContexts.DialogTitle String title) { return editConfiguration(project, configuration, title, null); }
|
editConfiguration
|
291,021
|
boolean (@NotNull ExecutionEnvironment environment, @NotNull @NlsContexts.DialogTitle String title) { //noinspection ConstantConditions return editConfiguration(environment.getProject(), environment.getRunnerAndConfigurationSettings(), title, environment.getExecutor()); }
|
editConfiguration
|
291,022
|
boolean (final Project project, @NotNull RunnerAndConfigurationSettings configuration, @NlsContexts.DialogTitle String title, final @Nullable Executor executor) { SingleConfigurationConfigurable<RunConfiguration> configurable = SingleConfigurationConfigurable.editSettings(configuration, executor); final SingleConfigurableEditor dialog = new SingleConfigurableEditor(project, configurable, null, DialogWrapper.IdeModalityType.IDE) { { if (executor != null) { setOKButtonText(executor.getActionName()); //setOKButtonIcon(executor.getIcon()); } } @Override public Dimension getInitialSize() { return new Dimension(650, 500); } }; dialog.setTitle(title); return dialog.showAndGet(); }
|
editConfiguration
|
291,023
|
Dimension () { return new Dimension(650, 500); }
|
getInitialSize
|
291,024
|
void (@NotNull DocumentEvent event) { setModified(true); if (!myChangingNameFromCode) { RunConfiguration runConfiguration = getSettings().getConfiguration(); if (runConfiguration instanceof LocatableConfigurationBase) { ((LocatableConfigurationBase<?>)runConfiguration).setNameChangedByUser(true); } } }
|
textChanged
|
291,025
|
void (@NotNull SettingsEditor<RunnerAndConfigurationSettings> settingsEditor) { requestToUpdateWarning(); }
|
stateChanged
|
291,026
|
void () { RunnerAndConfigurationSettings configuration = getSettings(); setNameText(configuration.getName()); super.reset(); if (myComponent == null) { myComponent = new MyValidatableComponent(); } myComponent.doReset(); myRunOnTargetPanel.reset(); }
|
reset
|
291,027
|
void () { if (myComponent == null) return; ModalityState modalityState = ModalityState.stateForComponent(myComponent.myWholePanel); if (modalityState == ModalityState.nonModal()) return; myValidationRequested = true; myValidationAlarm.cancelAllRequests(); myValidationAlarm.addRequest(() -> { if (myComponent != null) { if (!getEditor().isReadyForApply()) { addValidationRequest(); return; } try { RunnerAndConfigurationSettings snapshot = createSnapshot(false); snapshot.setName(getNameText()); validateResultOnBackgroundThread(snapshot); } catch (ConfigurationException e) { setValidationResult(createValidationResult(null, e)); } } }, 100, modalityState); }
|
addValidationRequest
|
291,028
|
boolean () { return getEditor() instanceof RunnerAndConfigurationSettingsEditor && ((RunnerAndConfigurationSettingsEditor)getEditor()).isInplaceValidationSupported(); }
|
isInplaceValidationSupported
|
291,029
|
JComponent () { myComponent.myNameText.setEnabled(!myBrokenConfiguration); JComponent result = myComponent.getWholePanel(); DataManager.registerDataProvider(result, dataId -> { if (myComponent == null) { return null; // disposed } if (ConfigurationSettingsEditorWrapper.CONFIGURATION_EDITOR_KEY.is(dataId)) { return getEditor(); } if (RUN_ON_TARGET_NAME_KEY.is(dataId)) { return TargetEnvironmentConfigurations.getEffectiveTargetName(myRunOnTargetPanel.getDefaultTargetName(), myProject); } if (RunConfigurationSelector.KEY.is(dataId)) { return new RunConfigurationSelector() { @Override public void select(@NotNull RunConfiguration configuration) { RunnerAndConfigurationSettingsImpl settings = RunManagerImpl.getInstanceImpl(myProject).getSettings(configuration); RunDialog.editConfiguration(myProject, Objects.requireNonNull(settings), ExecutionBundle.message("edit.run.configuration.for.item.dialog.title", configuration.getName())); } }; } return null; }); Dimension size = result.getPreferredSize(); result.setPreferredSize(new Dimension(Math.min(size.width, 800), Math.min(size.height, 600))); return result; }
|
createComponent
|
291,030
|
void (@NotNull RunConfiguration configuration) { RunnerAndConfigurationSettingsImpl settings = RunManagerImpl.getInstanceImpl(myProject).getSettings(configuration); RunDialog.editConfiguration(myProject, Objects.requireNonNull(settings), ExecutionBundle.message("edit.run.configuration.for.item.dialog.title", configuration.getName())); }
|
select
|
291,031
|
boolean () { return myComponent != null && myComponent.myRCStorageUi != null && myComponent.myRCStorageUi.isStoredInFile(); }
|
isStoredInFile
|
291,032
|
void (RunnerAndConfigurationSettings snapshot) { getValidateAction(snapshot) .expireWith(getEditor()) .coalesceBy(getEditor()) .finishOnUiThread(ModalityState.current(), this::setValidationResult) .submit(NonUrgentExecutor.getInstance()); }
|
validateResultOnBackgroundThread
|
291,033
|
void (ValidationResult result) { myLastValidationResult = result; if (myComponent != null && !isInplaceValidationSupported()) { myComponent.updateValidationResultVisibility(result); } for (ValidationListener listener : myValidationListeners) { listener.validationCompleted(result); } }
|
setValidationResult
|
291,034
|
boolean () { if (!myValidationRequested) { addValidationRequest(); } return myLastValidationResult == null; }
|
isValid
|
291,035
|
NonBlockingReadAction<ValidationResult> (RunnerAndConfigurationSettings snapshot) { return ReadAction.nonBlocking(() -> { try { snapshot.checkSettings(myExecutor); for (Executor executor : Executor.EXECUTOR_EXTENSION_NAME.getExtensionList()) { ProgramRunner<?> runner = ProgramRunner.getRunner(executor.getId(), snapshot.getConfiguration()); if (runner != null) { checkConfiguration(runner, snapshot); } } } catch (ConfigurationException e) { return createValidationResult(snapshot, e); } return null; }); }
|
getValidateAction
|
291,036
|
ValidationResult (RunnerAndConfigurationSettings snapshot, ConfigurationException e) { if (!e.shouldShowInDumbMode() && DumbService.isDumb(myProject)) return null; return new ValidationResult( e.getLocalizedMessage(), e instanceof RuntimeConfigurationException ? e.getTitle() : ExecutionBundle.message("invalid.data.dialog.title"), getQuickFix(snapshot, e)); }
|
createValidationResult
|
291,037
|
void () { super.disposeUIResources(); myComponent = null; }
|
disposeUIResources
|
291,038
|
String () { try { return myNameDocument.getText(0, myNameDocument.getLength()); } catch (BadLocationException e) { LOG.error(e); return ""; } }
|
getNameText
|
291,039
|
void (DocumentListener listener) { myNameDocument.addDocumentListener(listener); }
|
addNameListener
|
291,040
|
void (ActionListener listener) { if (myComponent.myRCStorageUi != null) { myComponent.myRCStorageUi.addStoreAsFileCheckBoxListener(listener); } }
|
addSharedListener
|
291,041
|
void (final String name) { myChangingNameFromCode = true; try { try { if (!myNameDocument.getText(0, myNameDocument.getLength()).equals(name)) { myNameDocument.replace(0, myNameDocument.getLength(), name, null); } } catch (BadLocationException e) { LOG.error(e); } } finally { myChangingNameFromCode = false; } }
|
setNameText
|
291,042
|
JTextField () { return myComponent.myNameText; }
|
getNameTextField
|
291,043
|
String () { return myDisplayName; }
|
getDisplayName
|
291,044
|
String () { return myHelpTopic; }
|
getHelpTopic
|
291,045
|
Config () { //noinspection unchecked return (Config)getSettings().getConfiguration(); }
|
getConfiguration
|
291,046
|
String () { return myDisplayName; }
|
toString
|
291,047
|
void (@Nullable String folderName) { if (!Objects.equals(myFolderName, folderName)) { myFolderName = folderName; setModified(true); } }
|
setFolderName
|
291,048
|
void (final ActionEvent e) { if (myQuickFix == null) { return; } myQuickFix.run(); requestToUpdateWarning(); }
|
actionPerformed
|
291,049
|
void () { RunConfiguration configuration = getSettings().getConfiguration(); boolean isManagedRunConfiguration = configuration.getType().isManaged(); if (myRCStorageUi != null) { myRCStorageUi.reset(getSettings()); } myRunOnTargetPanel.reset(); myIsAllowRunningInParallel = configuration.isAllowRunningInParallel(); myIsAllowRunningInParallelCheckBox.setEnabled(isManagedRunConfiguration); myIsAllowRunningInParallelCheckBox.setSelected(myIsAllowRunningInParallel); myIsAllowRunningInParallelCheckBox.setVisible(hasParallelCheckBox()); }
|
doReset
|
291,050
|
JComponent () { return myWholePanel; }
|
getWholePanel
|
291,051
|
JComponent () { return getEditor().getComponent(); }
|
getEditorComponent
|
291,052
|
void (ValidationResult configurationException) { if (configurationException != null) { mySeparator.setVisible(true); myWarningLabel.setVisible(true); myWarningLabel.setText(generateWarningLabelText(configurationException)); final Runnable quickFix = configurationException.getQuickFix(); if (quickFix == null) { myFixButton.setVisible(false); } else { myFixButton.setVisible(true); myQuickFix = quickFix; } myValidationPanel.setVisible(true); Window window = ComponentUtil.getWindow(myWholePanel); if (!myWindowResizedOnce && window != null && window.isShowing()) { Dimension size = window.getSize(); window.setSize(size.width, size.height + myValidationPanel.getPreferredSize().height); myWindowResizedOnce = true; } } else { mySeparator.setVisible(false); myWarningLabel.setVisible(false); myFixButton.setVisible(false); myValidationPanel.setVisible(false); } }
|
updateValidationResultVisibility
|
291,053
|
void () { myComponentPlace = new NonOpaquePanel(); myJBScrollPane = wrapWithScrollPane(null); }
|
createUIComponents
|
291,054
|
boolean () { return getEditor() instanceof ConfigurationSettingsEditorWrapper && getSettings().getFactory().getSingletonPolicy().isPolicyConfigurable(); }
|
hasParallelCheckBox
|
291,055
|
boolean () { return !"disabled".equalsIgnoreCase(System.getProperty("idea.cycle.buffer.size")); }
|
useCycleBuffer
|
291,056
|
int () { UISettings uiSettings = UISettings.getInstance(); if (uiSettings.getOverrideConsoleCycleBufferSize()) { return Math.min(Integer.MAX_VALUE / 1024, uiSettings.getConsoleCycleBufferSizeKb()) * 1024; } return getLegacyCycleBufferSize(); }
|
getCycleBufferSize
|
291,057
|
int () { return Math.max(0, SystemProperties.getIntProperty("idea.cycle.buffer.size", 1024)) * 1024; }
|
getLegacyCycleBufferSize
|
291,058
|
void () { if (myProject.isDisposed()) { LOG.error("Disposed" + "\n" + StringUtil.getThrowableText(myAllocationPlace)); } }
|
performCheck
|
291,059
|
void () { super.init(); setTitle(ExecutionBundle.message("execute.before.run.debug.dialog.title", getTargetDisplayString())); }
|
init
|
291,060
|
JComponent () { JPanel panel = new JPanel(new BorderLayout()); myRoot = buildNodes(); final Tree tree = new Tree(myRoot); final MyTreeCellRenderer cellRenderer = new MyTreeCellRenderer(); tree.setCellRenderer(cellRenderer); tree.setRootVisible(false); tree.setShowsRootHandles(true); TreeUtil.installActions(tree); TreeUIHelper.getInstance().installTreeSpeedSearch(tree); tree.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row >= 0) { Rectangle rowBounds = tree.getRowBounds(row); cellRenderer.setBounds(rowBounds); Rectangle checkBounds = cellRenderer.myCheckbox.getBounds(); checkBounds.setLocation(rowBounds.getLocation()); if (checkBounds.contains(e.getPoint())) { toggleNode(tree, (DefaultMutableTreeNode)tree.getPathForRow(row).getLastPathComponent()); e.consume(); tree.setSelectionRow(row); } } } }); tree.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { TreePath treePath = tree.getLeadSelectionPath(); DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent(); toggleNode(tree, node); e.consume(); } } }); expandChecked(tree); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(tree); scrollPane.setPreferredSize(JBUI.size(400, 400)); panel.add(scrollPane, BorderLayout.CENTER); return panel; }
|
createCenterPanel
|
291,061
|
void (MouseEvent e) { int row = tree.getRowForLocation(e.getX(), e.getY()); if (row >= 0) { Rectangle rowBounds = tree.getRowBounds(row); cellRenderer.setBounds(rowBounds); Rectangle checkBounds = cellRenderer.myCheckbox.getBounds(); checkBounds.setLocation(rowBounds.getLocation()); if (checkBounds.contains(e.getPoint())) { toggleNode(tree, (DefaultMutableTreeNode)tree.getPathForRow(row).getLastPathComponent()); e.consume(); tree.setSelectionRow(row); } } }
|
mousePressed
|
291,062
|
void (KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_SPACE) { TreePath treePath = tree.getLeadSelectionPath(); DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent(); toggleNode(tree, node); e.consume(); } }
|
keyPressed
|
291,063
|
void (Tree tree) { TreeNode root = (TreeNode)tree.getModel().getRoot(); Enumeration<?> factories = root.children(); ArrayList<TreeNode[]> toExpand = new ArrayList<>(); while (factories.hasMoreElements()) { DefaultMutableTreeNode factoryNode = (DefaultMutableTreeNode)factories.nextElement(); Enumeration<?> configurations = factoryNode.children(); while (configurations.hasMoreElements()) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)configurations.nextElement(); Descriptor config = (Descriptor)node.getUserObject(); if (config.isChecked()) { toExpand.add(factoryNode.getPath()); break; } } } for (TreeNode[] treeNodes : toExpand) { tree.expandPath(new TreePath(treeNodes)); } }
|
expandChecked
|
291,064
|
void (JTree tree, DefaultMutableTreeNode node) { Descriptor descriptor = (Descriptor)node.getUserObject(); descriptor.setChecked(!descriptor.isChecked()); if (descriptor instanceof GroupConfigurationDescriptor) { TreeUtil.treeNodeTraverser(node).forEach(child -> { ((Descriptor)((DefaultMutableTreeNode)child).getUserObject()).setChecked(descriptor.isChecked()); }); } else if (descriptor instanceof ConfigurationDescriptor) { DefaultMutableTreeNode parent = (DefaultMutableTreeNode)node.getParent(); GroupConfigurationDescriptor groupConfigurationDescriptor = (GroupConfigurationDescriptor)parent.getUserObject(); ThreeStateCheckBox.State state = getStateFromChildren(parent); groupConfigurationDescriptor.setChecked(state == ThreeStateCheckBox.State.SELECTED); } tree.repaint(); }
|
toggleNode
|
291,065
|
DefaultMutableTreeNode () { DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Descriptor()); RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(myProject); for (Map.Entry<ConfigurationType, Map<String, List<RunnerAndConfigurationSettings>>> entry : runManager.getConfigurationsGroupedByTypeAndFolder(false).entrySet()) { ConfigurationType type = entry.getKey(); final Icon icon = type.getIcon(); boolean selectedAll = true; GroupConfigurationDescriptor groupConfigurationDescriptor = new GroupConfigurationDescriptor(type, icon); DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(groupConfigurationDescriptor); root.add(typeNode); Set<String> addedNames = CollectionFactory.createSmallMemoryFootprintSet(); for (List<RunnerAndConfigurationSettings> list : entry.getValue().values()) { for (RunnerAndConfigurationSettings configuration : list) { final String configurationName = configuration.getName(); if (!addedNames.add(configurationName)) { // add only the first configuration if more than one has the same name continue; } boolean assigned = isConfigurationAssigned(configuration.getConfiguration()); selectedAll = selectedAll && assigned; typeNode.add(new DefaultMutableTreeNode(new ConfigurationDescriptor(configuration.getConfiguration(), assigned))); } groupConfigurationDescriptor.setChecked(selectedAll); } } buildTemplatesNode(root); return root; }
|
buildNodes
|
291,066
|
void (DefaultMutableTreeNode root) { DefaultMutableTreeNode node = new DefaultMutableTreeNode(TEMPLATE_ROOT); root.add(node); for (ConfigurationType type : ConfigurationType.CONFIGURATION_TYPE_EP.getExtensionList()) { if (!(type instanceof VirtualConfigurationType)) { Icon icon = type.getIcon(); DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(new ConfigurationTypeDescriptor(type, icon, isConfigurationAssigned(type))); node.add(typeNode); } } }
|
buildTemplatesNode
|
291,067
|
boolean (ConfigurationType type) { final RunManager runManager = RunManager.getInstance(myProject); for (ConfigurationFactory factory : type.getConfigurationFactories()) { final RunnerAndConfigurationSettings settings = ((RunManagerImpl)runManager).getConfigurationTemplate(factory); if (isConfigurationAssigned(settings.getConfiguration())) return true; } return false; }
|
isConfigurationAssigned
|
291,068
|
boolean (RunConfiguration configuration) { for (T task : RunManagerEx.getInstanceEx(myProject).getBeforeRunTasks(configuration, getTaskId())) { if (isRunning(task)) return true; } return false; }
|
isConfigurationAssigned
|
291,069
|
void () { final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(myProject); for (Enumeration<?> nodes = myRoot.depthFirstEnumeration(); nodes.hasMoreElements(); ) { final DefaultMutableTreeNode node = (DefaultMutableTreeNode)nodes.nextElement(); Object object = node.getUserObject(); if (!(object instanceof Descriptor descriptor)) { continue; } final boolean isChecked = descriptor.isChecked(); if (descriptor instanceof ConfigurationTypeDescriptor typeDesc) { for (ConfigurationFactory factory : typeDesc.getConfigurationType().getConfigurationFactories()) { RunnerAndConfigurationSettings settings = runManager.getConfigurationTemplate(factory); update(settings.getConfiguration(), isChecked, runManager); } } else if (descriptor instanceof ConfigurationDescriptor configDesc) { update(configDesc.getConfiguration(), isChecked, runManager); } } RunManagerImpl.getInstanceImpl(myProject).fireBeforeRunTasksUpdated(); close(OK_EXIT_CODE); }
|
doOKAction
|
291,070
|
void (RunConfiguration config, boolean enabled, RunManagerImpl runManager) { List<BeforeRunTask<?>> tasks = RunManagerImplKt.doGetBeforeRunTasks(config); BeforeRunTaskProvider<T> provider = BeforeRunTaskProvider.getProvider(myProject, getTaskId()); if (provider == null) { return; } T task = Objects.requireNonNull(provider.createTask(config)); update(task); task.setEnabled(true); if (enabled) { if (!tasks.contains(task)) { tasks = new SmartList<>(tasks); tasks.add(task); } } else { if (tasks.contains(task)) { tasks = new SmartList<>(tasks); tasks.remove(task); } } runManager.setBeforeRunTasks(config, tasks); }
|
update
|
291,071
|
boolean () { return myChecked; }
|
isChecked
|
291,072
|
void (boolean checked) { myChecked = checked; }
|
setChecked
|
291,073
|
ConfigurationType () { return myConfigurationType; }
|
getConfigurationType
|
291,074
|
Icon () { return myIcon; }
|
getIcon
|
291,075
|
ConfigurationType () { return myConfigurationType; }
|
getConfigurationType
|
291,076
|
Icon () { return myIcon; }
|
getIcon
|
291,077
|
ConfigurationType () { return myConfiguration.getType(); }
|
getConfigurationFactory
|
291,078
|
RunConfiguration () { return myConfiguration; }
|
getConfiguration
|
291,079
|
Component (JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { DefaultMutableTreeNode node = (DefaultMutableTreeNode)value; Object object = node.getUserObject(); myCheckbox.setBackground(UIUtil.getTreeBackground()); setBackground(UIUtil.getTreeBackground(selected, true)); Color foreground = UIUtil.getTreeForeground(selected, true); setForeground(foreground); myCheckbox.setForeground(foreground); myLabel.setForeground(foreground); if (object == TEMPLATE_ROOT) { myCheckbox.setVisible(false); myLabel.setIcon(AllIcons.General.Settings); myLabel.setText(ExecutionBundle.message("run.configuration.edit.default.configuration.settings.text")); return this; } Descriptor descriptor = (Descriptor)object; myCheckbox.setVisible(true); myCheckbox.setSelected(descriptor.isChecked()); myCheckbox.setEnabled(true); if (descriptor instanceof ConfigurationTypeDescriptor) { ConfigurationTypeDescriptor configurationTypeDescriptor = (ConfigurationTypeDescriptor)descriptor; myLabel.setFont(tree.getFont()); myLabel.setText(configurationTypeDescriptor.getConfigurationType().getDisplayName()); myLabel.setIcon(configurationTypeDescriptor.getIcon()); } else if (descriptor instanceof GroupConfigurationDescriptor groupConfigurationDescriptor) { myLabel.setIcon(groupConfigurationDescriptor.getIcon()); myLabel.setText(groupConfigurationDescriptor.getConfigurationType().getDisplayName()); myLabel.setFont(tree.getFont()); myCheckbox.setState(getStateFromChildren(node)); } else if (descriptor instanceof ConfigurationDescriptor configurationTypeDescriptor) { myLabel.setFont(tree.getFont()); myLabel.setText(configurationTypeDescriptor.getName()); myLabel.setIcon(null); if (((GroupConfigurationDescriptor)((DefaultMutableTreeNode)node.getParent()).getUserObject()).isChecked()) { myCheckbox.setSelected(true); } } return this; }
|
getTreeCellRendererComponent
|
291,080
|
CompositeSettingsBuilder<RunnerAndConfigurationSettings> () { init(); myGroupSettingsBuilder = new GroupSettingsBuilder<>(myCompound); return myGroupSettingsBuilder; }
|
getBuilder
|
291,081
|
void () { if (myCompound == null) { myCompound = new SettingsEditorGroup<>(); Disposer.register(this, myCompound); if (myConfigurationEditor instanceof SettingsEditorGroup<RunConfiguration> group) { List<Pair<@TabTitle String, SettingsEditor<RunConfiguration>>> editors = group.getEditors(); for (Pair<@TabTitle String, SettingsEditor<RunConfiguration>> pair : editors) { myCompound.addEditor(pair.getFirst(), new ConfigToSettingsWrapper(pair.getSecond())); } } else { myCompound.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new ConfigToSettingsWrapper(myConfigurationEditor)); } myRunnersComponent = new RunnersEditorComponent(); for (Executor executor : Executor.EXECUTOR_EXTENSION_NAME.getExtensionList()) { ProgramRunner<RunnerSettings> runner = getRunner(executor, myConfiguration); if (runner != null) { JComponent perRunnerSettings = createCompositePerRunnerSettings(executor, runner); if (perRunnerSettings != null) { myRunnersComponent.addExecutorComponent(executor, perRunnerSettings); } } } if (myRunnerEditors.size() > 0) { myCompound.addEditor(getRunnersTabName(), new CompositeSettingsEditor<>(getFactory()) { @Override public @NotNull CompositeSettingsBuilder<RunnerAndConfigurationSettings> getBuilder() { return new CompositeSettingsBuilder<>() { @Override public @NotNull Collection<SettingsEditor<RunnerAndConfigurationSettings>> getEditors() { return myRunnerEditors; } @Override public @NotNull JComponent createCompoundEditor() { return myRunnersComponent.getComponent(); } }; } }); } } }
|
init
|
291,082
|
CompositeSettingsBuilder<RunnerAndConfigurationSettings> () { return new CompositeSettingsBuilder<>() { @Override public @NotNull Collection<SettingsEditor<RunnerAndConfigurationSettings>> getEditors() { return myRunnerEditors; } @Override public @NotNull JComponent createCompoundEditor() { return myRunnersComponent.getComponent(); } }; }
|
getBuilder
|
291,083
|
Collection<SettingsEditor<RunnerAndConfigurationSettings>> () { return myRunnerEditors; }
|
getEditors
|
291,084
|
JComponent () { return myRunnersComponent.getComponent(); }
|
createCompoundEditor
|
291,085
|
void (String targetName) { for (SettingsEditor<RunnerAndConfigurationSettings> editor : myEditors) { if (editor instanceof TargetAwareRunConfigurationEditor) { ((TargetAwareRunConfigurationEditor)editor).targetChanged(targetName); } } }
|
targetChanged
|
291,086
|
void (ListSelectionEvent e) { updateRunnerComponent(); }
|
valueChanged
|
291,087
|
void () { Executor executor = myRunnersList.getSelectedValue(); myLayout.show(myRunnerPanel, executor != null ? executor.getId() : NO_RUNNER_COMPONENT); myRunnersPanel.revalidate(); }
|
updateRunnerComponent
|
291,088
|
void (Executor executor, JComponent component) { myRunnerPanel.add(component, executor.getId()); myListModel.addElement(executor); ScrollingUtil.ensureSelectionExists(myRunnersList); }
|
addExecutorComponent
|
291,089
|
List<Executor> () { return Collections.list(myListModel.elements()); }
|
getExecutors
|
291,090
|
void (Executor executor) { myRunnersList.setSelectedValue(executor, true); }
|
selectExecutor
|
291,091
|
JComponent () { return myRunnersPanel; }
|
getComponent
|
291,092
|
SettingsEditor<RunConfiguration> () { return myConfigEditor; }
|
getConfigEditor
|
291,093
|
void (@NotNull RunnerAndConfigurationSettings configurationSettings) { myConfigEditor.resetFrom(configurationSettings.getConfiguration()); }
|
resetEditorFrom
|
291,094
|
JComponent () { JComponent component = myConfigEditor.getComponent(); if (myConfigEditor instanceof AdjustingTabSettingsEditor) { JPanel panel = new JPanel(new BorderLayout()); UiNotifyConnector connector = UiNotifyConnector.installOn(panel, new Activatable() { private boolean myIsEmpty = true; @Override public void showNotify() { if (myIsEmpty) { panel.add(component, BorderLayout.CENTER); panel.revalidate(); panel.repaint(); myIsEmpty = false; } } @Override public void hideNotify() { if (!myIsEmpty) { panel.removeAll(); panel.revalidate(); panel.repaint(); myIsEmpty = true; } } }); Disposer.register(this, connector); return panel; } return component; }
|
createEditor
|
291,095
|
void () { if (myIsEmpty) { panel.add(component, BorderLayout.CENTER); panel.revalidate(); panel.repaint(); myIsEmpty = false; } }
|
showNotify
|
291,096
|
void () { if (!myIsEmpty) { panel.removeAll(); panel.revalidate(); panel.repaint(); myIsEmpty = true; } }
|
hideNotify
|
291,097
|
void () { Disposer.dispose(myConfigEditor); }
|
disposeEditor
|
291,098
|
void (String targetName) { if (myConfigEditor instanceof TargetAwareRunConfigurationEditor) { ((TargetAwareRunConfigurationEditor)myConfigEditor).targetChanged(targetName); } }
|
targetChanged
|
291,099
|
void (@NotNull PsiElement newElement) { boolean hasGeneratedName = myConfiguration.isGeneratedName(); myListener.elementMoved(newElement); if (hasGeneratedName) { updateSuggestedName(); } }
|
elementMoved
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.