mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
[project] pruning FileChooserDescriptor overrides (IJPL-150176 prerequisite)
`BrowseFolderRunnable` and `*WithBrowseButton` family: getting rid of separate "title" and "description" parameters in favor of the chooser descriptor object, to avoid cloning the latter down the road. GitOrigin-RevId: 33ec5968a1db953c60848974135055c288accf85
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5656c23f5c
commit
a5666abead
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.intellij.images.editor.actions;
|
||||
|
||||
import com.intellij.application.options.colors.ColorAndFontOptions;
|
||||
@@ -221,7 +221,7 @@ public class BackgroundImageDialog extends DialogWrapper {
|
||||
myPathField.getComboBox().setEditable(true);
|
||||
FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, true, false)
|
||||
.withFileFilter(file -> ImageFileTypeManager.getInstance().isImage(file));
|
||||
myPathField.addBrowseFolderListener(null, null, null, descriptor, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
|
||||
myPathField.addBrowseFolderListener(null, descriptor, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
|
||||
JTextComponent textComponent = getComboEditor();
|
||||
textComponent.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -45,12 +45,10 @@ class EclipseCompilerConfigurableUi(project: Project) {
|
||||
}
|
||||
.bottomGap(BottomGap.SMALL)
|
||||
row {
|
||||
pathToEcjField = textFieldWithBrowseButton(
|
||||
JavaCompilerBundle.message("path.to.ecj.compiler.tool"), project,
|
||||
object : FileChooserDescriptor(true, false, true, true, false, false) {}.withFileFilter { file ->
|
||||
FileTypeRegistry.getInstance().isFileOfType(file, ArchiveFileType.INSTANCE)
|
||||
}
|
||||
)
|
||||
val descriptor = object : FileChooserDescriptor(true, false, true, true, false, false) {}
|
||||
.withTitle(JavaCompilerBundle.message("path.to.ecj.compiler.tool"))
|
||||
.withFileFilter { file -> FileTypeRegistry.getInstance().isFileOfType(file, ArchiveFileType.INSTANCE) }
|
||||
pathToEcjField = textFieldWithBrowseButton(descriptor, project)
|
||||
.align(AlignX.FILL)
|
||||
.label(JavaCompilerBundle.message("eclipse.compiler.path.label"), LabelPosition.TOP)
|
||||
.comment(JavaCompilerBundle.message("eclipse.compiler.path.comment"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.packaging.impl.artifacts;
|
||||
|
||||
import com.intellij.openapi.compiler.JavaCompilerBundle;
|
||||
@@ -61,7 +61,7 @@ public class JarArtifactFromModulesDialog extends DialogWrapper {
|
||||
myCopyJarsRadioButton.addActionListener(actionListener);
|
||||
|
||||
updateManifestDirField();
|
||||
myManifestDirField.addBrowseFolderListener(null, null, project, ManifestFileUtil.createDescriptorForManifestDirectory());
|
||||
myManifestDirField.addBrowseFolderListener(project, ManifestFileUtil.createDescriptorForManifestDirectory());
|
||||
|
||||
setupModulesCombobox(context);
|
||||
init();
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.jar;
|
||||
|
||||
import com.intellij.application.options.ModulesComboBox;
|
||||
@@ -80,9 +66,9 @@ public class JarApplicationConfigurable extends SettingsEditor<JarApplicationCon
|
||||
|
||||
private void createUIComponents() {
|
||||
myJarPathComponent = new LabeledComponent<>();
|
||||
TextFieldWithBrowseButton textFieldWithBrowseButton = new TextFieldWithBrowseButton();
|
||||
textFieldWithBrowseButton.addBrowseFolderListener(ExecutionBundle.message("choose.jar.file"), null, myProject,
|
||||
new FileChooserDescriptor(false, false, true, true, false, false));
|
||||
var textFieldWithBrowseButton = new TextFieldWithBrowseButton();
|
||||
textFieldWithBrowseButton.addBrowseFolderListener(myProject, new FileChooserDescriptor(false, false, true, true, false, false)
|
||||
.withTitle(ExecutionBundle.message("choose.jar.file")));
|
||||
myJarPathComponent.setComponent(textFieldWithBrowseButton);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.ui.ComponentWithBrowseButton;
|
||||
@@ -74,10 +74,10 @@ public class AlternativeJREPanel extends JPanel implements PanelWithAnchor {
|
||||
}
|
||||
myFieldWithHistory.setHistory(foundJDKs);
|
||||
myPathField = new ComponentWithBrowseButton<>(myFieldWithHistory, null);
|
||||
myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
|
||||
ExecutionBundle.message("run.configuration.select.jre.dir.label"),
|
||||
null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
|
||||
TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(ExecutionBundle.message("run.configuration.select.alternate.jre.label"))
|
||||
.withDescription(ExecutionBundle.message("run.configuration.select.jre.dir.label"));
|
||||
myPathField.addBrowseFolderListener(null, descriptor, TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
|
||||
setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
|
||||
add(myCbEnabled, "shrinkx");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
@@ -6,10 +6,10 @@ import com.intellij.execution.target.TargetEnvironmentConfiguration;
|
||||
import com.intellij.execution.target.TargetEnvironmentConfigurations;
|
||||
import com.intellij.execution.target.java.JavaLanguageRuntimeConfiguration;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.ProjectJdkTable;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
@@ -224,14 +224,11 @@ public class JrePathEditor extends LabeledComponent<ComboBox<JrePathEditor.JreCo
|
||||
return model;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Runnable getBrowseRunnable() {
|
||||
return new BrowseFolderRunnable<>(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
|
||||
ExecutionBundle.message("run.configuration.select.jre.dir.label"),
|
||||
null,
|
||||
BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
|
||||
getComponent(),
|
||||
JreComboboxEditor.TEXT_COMPONENT_ACCESSOR);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(ExecutionBundle.message("run.configuration.select.alternate.jre.label"))
|
||||
.withDescription(ExecutionBundle.message("run.configuration.select.jre.dir.label"));
|
||||
return new BrowseFolderRunnable<>(null, descriptor, getComponent(), JreComboboxEditor.TEXT_COMPONENT_ACCESSOR);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -493,4 +490,3 @@ public class JrePathEditor extends LabeledComponent<ComboBox<JrePathEditor.JreCo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.facet.impl.ui.libraries;
|
||||
|
||||
import com.intellij.framework.library.DownloadableLibraryFileDescription;
|
||||
@@ -104,9 +90,9 @@ public class DownloadingOptionsDialog extends DialogWrapper {
|
||||
|
||||
myFilesList.setBorder(null);
|
||||
myFilesToDownloadLabel.setLabelFor(myFilesList);
|
||||
myDirectoryField.addBrowseFolderListener(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.title"),
|
||||
JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.description"), null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myDirectoryField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.title"))
|
||||
.withDescription(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.description")));
|
||||
|
||||
myCopyDownloadedFilesToLabel.setLabelFor(myDirectoryField);
|
||||
myDirectoryField.setText(FileUtil.toSystemDependentName(settings.getDirectoryForDownloadedLibrariesPath()));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.projectView.actions
|
||||
|
||||
import com.intellij.ide.JavaUiBundle
|
||||
@@ -51,8 +51,10 @@ class ExtractModuleFromPackageDialog(private val project: Project, moduleName: S
|
||||
}
|
||||
indent {
|
||||
row {
|
||||
pathField = textFieldWithBrowseButton(JavaUiBundle.message("dialog.title.specify.path.to.new.source.root"), project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
pathField = textFieldWithBrowseButton(
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(JavaUiBundle.message("dialog.title.specify.path.to.new.source.root")),
|
||||
project
|
||||
)
|
||||
.bindText(::sourceRootPath)
|
||||
.enabledIf(moveClassesCheckBox.selected)
|
||||
.align(AlignX.FILL)
|
||||
@@ -66,4 +68,4 @@ class ExtractModuleFromPackageDialog(private val project: Project, moduleName: S
|
||||
|
||||
internal val targetSourceRootPath: String?
|
||||
get() = if (moveToSeparateRoot) FileUtil.toSystemIndependentName(sourceRootPath) else null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.projectWizard;
|
||||
|
||||
import com.intellij.core.CoreBundle;
|
||||
@@ -6,8 +6,8 @@ import com.intellij.ide.IdeBundle;
|
||||
import com.intellij.ide.IdeCoreBundle;
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
import com.intellij.ide.highlighter.ModuleFileType;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.ide.util.projectWizard.*;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.module.ModifiableModuleModel;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleManager;
|
||||
@@ -97,9 +97,9 @@ public class ModuleNameLocationComponent implements ModuleNameLocationSettings {
|
||||
}
|
||||
});
|
||||
|
||||
myModuleContentRoot.addBrowseFolderListener(JavaUiBundle.message("project.new.wizard.module.content.root.chooser.title"),
|
||||
JavaUiBundle.message("project.new.wizard.module.content.root.chooser.description"),
|
||||
myWizardContext.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
|
||||
myModuleContentRoot.addBrowseFolderListener(myWizardContext.getProject(), FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("project.new.wizard.module.content.root.chooser.title"))
|
||||
.withDescription(JavaUiBundle.message("project.new.wizard.module.content.root.chooser.description")));
|
||||
|
||||
namePathComponent.getPathComponent().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
@@ -153,9 +153,9 @@ public class ModuleNameLocationComponent implements ModuleNameLocationSettings {
|
||||
}
|
||||
});
|
||||
|
||||
myModuleFileLocation.addBrowseFolderListener(JavaUiBundle.message("project.new.wizard.module.file.chooser.title"),
|
||||
JavaUiBundle.message("project.new.wizard.module.file.description"),
|
||||
myWizardContext.getProject(), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
|
||||
myModuleFileLocation.addBrowseFolderListener(myWizardContext.getProject(), FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("project.new.wizard.module.file.chooser.title"))
|
||||
.withDescription(JavaUiBundle.message("project.new.wizard.module.file.description")));
|
||||
myModuleFileLocation.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull final DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.projectWizard.generators
|
||||
|
||||
import com.intellij.ide.JavaUiBundle
|
||||
@@ -41,6 +41,7 @@ import com.intellij.openapi.ui.getCanonicalPath
|
||||
import com.intellij.openapi.ui.getPresentablePath
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.ui.UIBundle
|
||||
import com.intellij.ui.UIBundle.message
|
||||
import com.intellij.ui.dsl.builder.*
|
||||
import com.intellij.ui.layout.ValidationInfoBuilder
|
||||
import java.nio.file.Paths
|
||||
@@ -139,11 +140,11 @@ abstract class IntelliJNewProjectWizardStep<ParentStep>(val parent: ParentStep)
|
||||
|
||||
protected fun setupModuleContentRootUI(builder: Panel) {
|
||||
builder.row(UIBundle.message("label.project.wizard.new.project.content.root")) {
|
||||
val browseDialogTitle = UIBundle.message("label.project.wizard.new.project.content.root.title")
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(message("label.project.wizard.new.project.content.root.title"))
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
textFieldWithBrowseButton(browseDialogTitle, context.project, fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(fileChooserDescriptor, context.project)
|
||||
.bindText(contentRootProperty.toUiPathProperty())
|
||||
.align(AlignX.FILL)
|
||||
.validationOnApply { validateContentRoot() }
|
||||
@@ -154,11 +155,11 @@ abstract class IntelliJNewProjectWizardStep<ParentStep>(val parent: ParentStep)
|
||||
|
||||
protected fun setupModuleFileLocationUI(builder: Panel) {
|
||||
builder.row(UIBundle.message("label.project.wizard.new.project.module.file.location")) {
|
||||
val browseDialogTitle = UIBundle.message("label.project.wizard.new.project.module.file.location.title")
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(message("label.project.wizard.new.project.module.file.location.title"))
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
textFieldWithBrowseButton(browseDialogTitle, context.project, fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(fileChooserDescriptor, context.project)
|
||||
.bindText(moduleFileLocationProperty.toUiPathProperty())
|
||||
.align(AlignX.FILL)
|
||||
.validationOnApply { validateModuleFileLocation() }
|
||||
@@ -251,4 +252,4 @@ abstract class IntelliJNewProjectWizardStep<ParentStep>(val parent: ParentStep)
|
||||
|
||||
module?.let(::startJdkDownloadIfNeeded)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.starters.shared
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.IdeBundle.message
|
||||
import com.intellij.ide.JavaUiBundle
|
||||
import com.intellij.ide.projectWizard.generators.JdkDownloadService
|
||||
import com.intellij.ide.projectWizard.projectWizardJdkComboBox
|
||||
@@ -235,15 +235,14 @@ abstract class CommonStarterInitialStep(
|
||||
return withValidation(this, errorValidationUnits, warningValidationUnit, validatedTextComponents, parentDisposable)
|
||||
}
|
||||
|
||||
private fun Row.projectLocationField(locationProperty: GraphProperty<String>,
|
||||
wizardContext: WizardContext): Cell<TextFieldWithBrowseButton> {
|
||||
private fun Row.projectLocationField(locationProperty: GraphProperty<String>, wizardContext: WizardContext): Cell<TextFieldWithBrowseButton> {
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
.withTitle(message("title.select.project.file.directory", wizardContext.presentationName))
|
||||
.withFileFilter { it.isDirectory }
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
val title = IdeBundle.message("title.select.project.file.directory", wizardContext.presentationName)
|
||||
val property = locationProperty.transform(::getPresentablePath, ::getCanonicalPath)
|
||||
return textFieldWithBrowseButton(title, wizardContext.project, fileChooserDescriptor)
|
||||
return textFieldWithBrowseButton(fileChooserDescriptor, wizardContext.project)
|
||||
.bindText(property)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.util.newProjectWizard;
|
||||
|
||||
import com.intellij.CommonBundle;
|
||||
@@ -100,8 +100,9 @@ public class SourcePathsStep extends AbstractStepWithProgress<List<JavaModuleSou
|
||||
final JLabel srcPathLabel = new JLabel(JavaUiBundle.message("prompt.enter.relative.path.to.module.content.root", File.separator));
|
||||
panel.add(srcPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
|
||||
JBUI.insets(8, 30, 0, 0), 0, 0));
|
||||
final FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
chooserDescriptor.withTreeRootVisible(true);
|
||||
var chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("prompt.select.source.directory"))
|
||||
.withTreeRootVisible(true);
|
||||
final FieldPanel fieldPanel = createFieldPanel(myTfSourceDirectoryName, null, new BrowsePathListener(myTfSourceDirectoryName, chooserDescriptor));
|
||||
panel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
|
||||
JBUI.insets(8, 30, 0, 10), 0, 0));
|
||||
@@ -351,7 +352,7 @@ public class SourcePathsStep extends AbstractStepWithProgress<List<JavaModuleSou
|
||||
private final JTextField myField;
|
||||
|
||||
BrowsePathListener(JTextField textField, final FileChooserDescriptor chooserDescriptor) {
|
||||
super(textField, JavaUiBundle.message("prompt.select.source.directory"), "", chooserDescriptor);
|
||||
super(textField, chooserDescriptor);
|
||||
myField = textField;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.util.projectWizard;
|
||||
|
||||
import com.intellij.core.CoreBundle;
|
||||
@@ -11,14 +11,13 @@ import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.ui.MessageDialogBuilder;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import com.intellij.ui.FieldPanel;
|
||||
@@ -56,27 +55,33 @@ public final class NamePathComponent extends JPanel {
|
||||
private boolean myIsNamePathSyncEnabled = true;
|
||||
private boolean myShouldBeAbsolute;
|
||||
|
||||
public NamePathComponent(@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription) {
|
||||
public NamePathComponent(
|
||||
@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription
|
||||
) {
|
||||
this(nameLabelText, pathLabelText, pathChooserTitle, pathChooserDescription, true);
|
||||
}
|
||||
|
||||
public NamePathComponent(@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription,
|
||||
boolean hideIgnored) {
|
||||
public NamePathComponent(
|
||||
@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription,
|
||||
boolean hideIgnored
|
||||
) {
|
||||
this(nameLabelText, pathLabelText, pathChooserTitle, pathChooserDescription, hideIgnored, true);
|
||||
}
|
||||
|
||||
public NamePathComponent(@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription,
|
||||
boolean hideIgnored,
|
||||
boolean bold) {
|
||||
public NamePathComponent(
|
||||
@NlsContexts.Label String nameLabelText,
|
||||
@NlsContexts.Label String pathLabelText,
|
||||
@NlsContexts.DialogTitle String pathChooserTitle,
|
||||
@NlsContexts.Label String pathChooserDescription,
|
||||
boolean hideIgnored,
|
||||
boolean bold
|
||||
) {
|
||||
super(new GridBagLayout());
|
||||
|
||||
myTfName = new JTextField();
|
||||
@@ -91,9 +96,11 @@ public final class NamePathComponent extends JPanel {
|
||||
if (bold) myNameLabel.setFont(StartupUiUtil.getLabelFont().deriveFont(Font.BOLD));
|
||||
myNameLabel.setLabelFor(myTfName);
|
||||
|
||||
FileChooserDescriptor chooserDescriptor = (FileChooserDescriptor)BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR.clone();
|
||||
chooserDescriptor.setHideIgnored(hideIgnored);
|
||||
BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(myTfPath, pathChooserTitle, pathChooserDescription, chooserDescriptor) {
|
||||
var chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(pathChooserTitle)
|
||||
.withDescription(pathChooserDescription)
|
||||
.withHideIgnored(hideIgnored);
|
||||
BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(myTfPath, chooserDescriptor) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
super.actionPerformed(e);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.jarRepository;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDialog;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -162,11 +161,11 @@ public final class RepositoryAttachDialog extends DialogWrapper {
|
||||
mySourcesCheckBox.setSelected(storage.isTrueValue(PROPERTY_ATTACH_SOURCES));
|
||||
mySourcesCheckBox.setSelected(storage.isTrueValue(PROPERTY_ATTACH_ANNOTATIONS));
|
||||
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.title"))
|
||||
.withDescription(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.description"));
|
||||
descriptor.putUserData(FileChooserDialog.PREFER_LAST_OVER_TO_SELECT, Boolean.TRUE);
|
||||
myDirectoryField.addBrowseFolderListener(JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.title"),
|
||||
JavaUiBundle.message("file.chooser.directory.for.downloaded.libraries.description"), null,
|
||||
descriptor);
|
||||
myDirectoryField.addBrowseFolderListener(null, descriptor);
|
||||
updateInfoLabel();
|
||||
myDownloadOptionsPanel.setVisible(mode == Mode.DOWNLOAD);
|
||||
mySearchOptionsPanel.setVisible(mode == Mode.SEARCH);
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.settings;
|
||||
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
@@ -26,7 +12,6 @@ import com.intellij.openapi.externalSystem.settings.AbstractExternalSystemSettin
|
||||
import com.intellij.openapi.externalSystem.settings.ExternalProjectSettings;
|
||||
import com.intellij.openapi.externalSystem.settings.ExternalSystemSettingsListener;
|
||||
import com.intellij.openapi.externalSystem.util.*;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -94,9 +79,8 @@ public abstract class AbstractImportFromExternalSystemControl<
|
||||
myLinkedProjectPathField.setNameComponentVisible(false);
|
||||
myLinkedProjectPathField.setNameValue("untitled");
|
||||
|
||||
FileChooserDescriptor fileChooserDescriptor = manager.getExternalProjectDescriptor();
|
||||
final BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(
|
||||
myLinkedProjectPathField.getPathComponent(), projectPathTitle, "", fileChooserDescriptor);
|
||||
var fileChooserDescriptor = manager.getExternalProjectDescriptor().withTitle(projectPathTitle);
|
||||
var browseButtonActionListener = new BrowseFilesListener(myLinkedProjectPathField.getPathComponent(), fileChooserDescriptor);
|
||||
|
||||
myLinkedProjectPathField.getPathPanel().setBrowseButtonActionListener(browseButtonActionListener);
|
||||
myLinkedProjectPathField.getPathComponent().getDocument().addDocumentListener(new DocumentListener() {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
package com.intellij.openapi.roots.ui.configuration;
|
||||
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.fileChooser.FileChooserFactory;
|
||||
import com.intellij.openapi.roots.CompilerModuleExtension;
|
||||
@@ -181,10 +180,11 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
}
|
||||
|
||||
private CommittableFieldPanel createOutputPathPanel(final @NlsContexts.DialogTitle String title, final CommitPathRunnable commitPathRunnable) {
|
||||
final JTextField textField = new ExtendableTextField();
|
||||
final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
var textField = new ExtendableTextField();
|
||||
var outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(title)
|
||||
.withHideIgnored(false);
|
||||
outputPathsChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, getModel().getModule());
|
||||
outputPathsChooserDescriptor.setHideIgnored(false);
|
||||
InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
|
||||
FileChooserFactory.getInstance().installFileCompletion(textField, outputPathsChooserDescriptor, true, null);
|
||||
final Runnable commitRunnable = () -> {
|
||||
@@ -223,7 +223,7 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
}
|
||||
});
|
||||
|
||||
return new CommittableFieldPanel(textField, new BrowseFilesListener(textField, title, "", outputPathsChooserDescriptor) {
|
||||
return new CommittableFieldPanel(textField, new BrowseFilesListener(textField, outputPathsChooserDescriptor) {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
super.actionPerformed(e);
|
||||
@@ -296,4 +296,4 @@ public class BuildElementsEditor extends ModuleElementsEditor {
|
||||
myCommitRunnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.roots.ui.configuration
|
||||
|
||||
import com.intellij.core.JavaPsiBundle
|
||||
@@ -98,12 +98,7 @@ internal class ProjectConfigurableUi(private val myProjectConfigurable: ProjectC
|
||||
.bottomGap(BottomGap.SMALL)
|
||||
|
||||
row(JavaUiBundle.message("project.structure.compiler.output")) {
|
||||
textFieldWithBrowseButton(
|
||||
null,
|
||||
null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
||||
null
|
||||
)
|
||||
textFieldWithBrowseButton(FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
.bindText(compilerOutputProperty.toUiPathProperty())
|
||||
.onIsModified {
|
||||
if (!myProjectConfigurable.isFrozen)
|
||||
@@ -140,4 +135,4 @@ internal class ProjectConfigurableUi(private val myProjectConfigurable: ProjectC
|
||||
myLanguageLevelCombo.reset(myProject)
|
||||
projectName = myProject.name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.roots.ui.configuration.artifacts;
|
||||
|
||||
import com.intellij.codeInsight.hint.HintManager;
|
||||
@@ -95,10 +95,9 @@ public class ArtifactEditorImpl implements ArtifactEditorEx {
|
||||
myTopPanel.setBorder(JBUI.Borders.empty(0, 10));
|
||||
myBuildOnMakeCheckBox.setSelected(artifact.isBuildOnMake());
|
||||
final String outputPath = artifact.getOutputPath();
|
||||
myOutputDirectoryField.addBrowseFolderListener(JavaCompilerBundle.message("dialog.title.output.directory.for.artifact"),
|
||||
JavaCompilerBundle.message("chooser.description.select.output.directory.for.0.artifact",
|
||||
getArtifact().getName()), myProject,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myOutputDirectoryField.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaCompilerBundle.message("dialog.title.output.directory.for.artifact"))
|
||||
.withDescription(JavaCompilerBundle.message("chooser.description.select.output.directory.for.0.artifact", getArtifact().getName())));
|
||||
myOutputDirectoryField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.roots.ui.configuration.libraryEditor;
|
||||
|
||||
import com.intellij.ide.JavaUiBundle;
|
||||
@@ -46,8 +46,8 @@ public class ChangeLibraryLevelDialog extends DialogWrapper {
|
||||
});
|
||||
myModifiableModel = provider.getModifiableModel();
|
||||
myNameField.setText(libraryName);
|
||||
myDirectoryForFilesField.addBrowseFolderListener(JavaUiBundle.message("chooser.title.directory.for.library.files"), null, project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myDirectoryForFilesField.addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(JavaUiBundle.message("chooser.title.directory.for.library.files")));
|
||||
myDirectoryForFilesField.setText(FileUtil.toSystemDependentName(path));
|
||||
myNameField.selectAll();
|
||||
init();
|
||||
|
||||
@@ -53,9 +53,9 @@ public class LocateLibraryDialog extends DialogWrapper {
|
||||
myCopyLibraryFilesRadioButton.setText(QuickFixBundle.message("add.library.copy.files.to.radio.button", presentableName));
|
||||
@NlsSafe String path = new File(new File(module.getModuleFilePath()).getParent(), "lib").getAbsolutePath();
|
||||
myCopyToDir.setText(path);
|
||||
myCopyToDir.addBrowseFolderListener(QuickFixBundle.message("add.library.title.choose.folder"),
|
||||
QuickFixBundle.message("add.library.description.choose.folder"), myProject,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myCopyToDir.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(QuickFixBundle.message("add.library.title.choose.folder"))
|
||||
.withDescription(QuickFixBundle.message("add.library.description.choose.folder")));
|
||||
|
||||
final ItemListener listener = new ItemListener() {
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.javadoc
|
||||
|
||||
import com.intellij.java.JavaBundle
|
||||
@@ -9,7 +9,9 @@ import com.intellij.openapi.util.NlsSafe
|
||||
import com.intellij.psi.PsiKeyword
|
||||
import com.intellij.ui.dsl.builder.*
|
||||
import com.intellij.ui.layout.selected
|
||||
import javax.swing.*
|
||||
import javax.swing.JCheckBox
|
||||
import javax.swing.JPanel
|
||||
import javax.swing.JTextField
|
||||
|
||||
class JavadocGenerationAdditionalUi {
|
||||
lateinit var myIncludeLibraryCb: JCheckBox
|
||||
@@ -45,9 +47,7 @@ class JavadocGenerationAdditionalUi {
|
||||
myLinkToJdkDocs = checkBox(JavaBundle.message("javadoc.generate.link.to.jdk.documentation.option")).component
|
||||
}
|
||||
row(JavaBundle.message("javadoc.generate.output.directory")) {
|
||||
myTfOutputDir = textFieldWithBrowseButton(JavaBundle.message("javadoc.generate.output.directory.browse"),
|
||||
null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
myTfOutputDir = textFieldWithBrowseButton(FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(JavaBundle.message("javadoc.generate.output.directory.browse")))
|
||||
.align(AlignX.FILL)
|
||||
.component
|
||||
bottomGap(BottomGap.MEDIUM)
|
||||
@@ -125,4 +125,4 @@ class JavadocGenerationAdditionalUi {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.jetbrains.jsonSchema.settings.mappings;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -116,8 +116,8 @@ public final class JsonSchemaMappingsView implements Disposable {
|
||||
}
|
||||
}).showInCenterOf(urlButton);
|
||||
});
|
||||
SwingHelper.installFileCompletionAndBrowseDialog(myProject, mySchemaField, JsonBundle.message("json.schema.add.schema.chooser.title"),
|
||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withTitle(JsonBundle.message("json.schema.add.schema.chooser.title"));
|
||||
SwingHelper.installFileCompletionAndBrowseDialog(myProject, mySchemaField, descriptor);
|
||||
mySchemaField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -4,11 +4,7 @@ package com.intellij.credentialStore
|
||||
import com.intellij.credentialStore.gpg.Pgp
|
||||
import com.intellij.credentialStore.gpg.PgpKey
|
||||
import com.intellij.credentialStore.kdbx.IncorrectMainPasswordException
|
||||
import com.intellij.credentialStore.keePass.DB_FILE_NAME
|
||||
import com.intellij.credentialStore.keePass.KeePassFileManager
|
||||
import com.intellij.credentialStore.keePass.MainKeyFileStorage
|
||||
import com.intellij.credentialStore.keePass.getDefaultDbFile
|
||||
import com.intellij.credentialStore.keePass.getDefaultMainPasswordFile
|
||||
import com.intellij.credentialStore.keePass.*
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.passwordSafe.PasswordSafe
|
||||
import com.intellij.ide.passwordSafe.impl.PasswordSafeImpl
|
||||
@@ -214,18 +210,16 @@ class PasswordSafeConfigurableUi(private val settings: PasswordSafeSettings) : C
|
||||
|
||||
indent {
|
||||
row(CredentialStoreBundle.message("settings.password.database")) {
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor().withFileFilter {
|
||||
it.isDirectory || it.name.endsWith(".kdbx")
|
||||
}
|
||||
keePassDbFile = textFieldWithBrowseButton(CredentialStoreBundle.message("passwordSafeConfigurable.keepass.database.file"),
|
||||
fileChooserDescriptor = fileChooserDescriptor,
|
||||
fileChosen = {
|
||||
val path = when {
|
||||
it.isDirectory -> "${it.path}${File.separator}$DB_FILE_NAME"
|
||||
else -> it.path
|
||||
}
|
||||
return@textFieldWithBrowseButton File(path).path
|
||||
})
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
.withTitle(CredentialStoreBundle.message("passwordSafeConfigurable.keepass.database.file"))
|
||||
.withFileFilter { it.isDirectory || it.name.endsWith(".kdbx") }
|
||||
keePassDbFile = textFieldWithBrowseButton(fileChooserDescriptor, fileChosen = {
|
||||
val path = when {
|
||||
it.isDirectory -> "${it.path}${File.separator}$DB_FILE_NAME"
|
||||
else -> it.path
|
||||
}
|
||||
return@textFieldWithBrowseButton File(path).path
|
||||
})
|
||||
.resizableColumn()
|
||||
.align(AlignX.FILL)
|
||||
.gap(RightGap.SMALL)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diff.settings
|
||||
|
||||
import com.intellij.diff.tools.external.ExternalDiffSettings
|
||||
@@ -250,8 +250,7 @@ internal class ExternalToolsTreePanel(private val models: ExternalToolsModels) {
|
||||
})
|
||||
}
|
||||
private val programPathField = TextFieldWithBrowseButton().apply {
|
||||
addBrowseFolderListener(DiffBundle.message("select.external.program.dialog.title"), null, null,
|
||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor())
|
||||
addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withTitle(DiffBundle.message("select.external.program.dialog.title")))
|
||||
textField.document.addDocumentListener(object : DocumentListener {
|
||||
override fun insertUpdate(event: DocumentEvent) {
|
||||
if (isAutocompleteToolName) {
|
||||
@@ -532,4 +531,4 @@ internal class ExternalToolsTreePanel(private val models: ExternalToolsModels) {
|
||||
isDisposed = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.dvcs.ui;
|
||||
|
||||
import com.intellij.dvcs.DvcsRememberedInputs;
|
||||
import com.intellij.dvcs.repo.ClonePathProvider;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
@@ -155,14 +154,12 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
|
||||
myTestButton = new JButton(DvcsBundle.message("clone.repository.url.test.label"));
|
||||
myTestButton.addActionListener(e -> test());
|
||||
|
||||
FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
fcd.setShowFileSystemRoots(true);
|
||||
fcd.setHideIgnored(false);
|
||||
myDirectoryField = new MyTextFieldWithBrowseButton(ClonePathProvider.defaultParentDirectoryPath(myProject, getRememberedInputs()));
|
||||
myDirectoryField.addBrowseFolderListener(DvcsBundle.message("clone.destination.directory.browser.title"),
|
||||
DvcsBundle.message("clone.destination.directory.browser.description"),
|
||||
myProject,
|
||||
fcd);
|
||||
myDirectoryField.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(DvcsBundle.message("clone.destination.directory.browser.title"))
|
||||
.withDescription(DvcsBundle.message("clone.destination.directory.browser.description"))
|
||||
.withShowFileSystemRoots(true)
|
||||
.withHideIgnored(false));
|
||||
|
||||
if (defaultUrl != null) {
|
||||
myRepositoryUrlField.setText(defaultUrl);
|
||||
@@ -325,4 +322,4 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.dvcs.ui
|
||||
|
||||
import com.intellij.dvcs.DvcsRememberedInputs
|
||||
@@ -42,13 +42,11 @@ abstract class DvcsCloneDialogComponent(var project: Project,
|
||||
protected lateinit var errorComponent: BorderLayoutPanel
|
||||
|
||||
init {
|
||||
val fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
fcd.isShowFileSystemRoots = true
|
||||
fcd.isHideIgnored = false
|
||||
directoryField.addBrowseFolderListener(message("clone.destination.directory.browser.title"),
|
||||
message("clone.destination.directory.browser.description"),
|
||||
project,
|
||||
fcd)
|
||||
directoryField.addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(message("clone.destination.directory.browser.title"))
|
||||
.withDescription(message("clone.destination.directory.browser.description"))
|
||||
.withShowFileSystemRoots(true)
|
||||
.withHideIgnored(false))
|
||||
mainPanel = panel {
|
||||
row(VcsBundle.message("vcs.common.labels.url")) { cell(urlEditor).align(AlignX.FILL) }
|
||||
row(VcsBundle.message("vcs.common.labels.directory")) { cell(directoryField).align(AlignX.FILL) }
|
||||
@@ -109,4 +107,4 @@ abstract class DvcsCloneDialogComponent(var project: Project,
|
||||
protected fun updateOkActionState(dialogStateListener: VcsCloneDialogComponentStateListener) {
|
||||
dialogStateListener.onOkActionEnabled(isOkActionEnabled())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2998,9 +2998,7 @@ f:com.intellij.execution.ui.MacroComboBoxWithBrowseButton
|
||||
- com.intellij.ui.TextAccessor
|
||||
- <init>(com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.project.Project):V
|
||||
- getText():java.lang.String
|
||||
- setModule(com.intellij.openapi.module.Module):V
|
||||
- setText(java.lang.String):V
|
||||
- showModuleMacroAlways():V
|
||||
f:com.intellij.execution.ui.ProgramInputRedirectPanel
|
||||
- javax.swing.JPanel
|
||||
- com.intellij.ui.PanelWithAnchor
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
package com.intellij.diagnostic.logging;
|
||||
|
||||
@@ -37,7 +37,8 @@ public final class EditLogPatternDialog extends DialogWrapper {
|
||||
|
||||
@Override
|
||||
protected JComponent createCenterPanel() {
|
||||
myFilePattern.addBrowseFolderListener(UIBundle.message("file.chooser.default.title"), null, null, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor(), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor().withTitle(UIBundle.message("file.chooser.default.title"));
|
||||
myFilePattern.addBrowseFolderListener(null, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
myFilePattern.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diagnostic.logging;
|
||||
|
||||
import com.intellij.diagnostic.DiagnosticBundle;
|
||||
@@ -113,10 +113,10 @@ public final class LogConfigurationPanel<T extends RunConfigurationBase> extends
|
||||
myFilesTable.getSelectedObject() != null).disableUpDownActions().createPanel(), BorderLayout.CENTER);
|
||||
|
||||
myWholePanel.setPreferredSize(new Dimension(-1, 150));
|
||||
myOutputFile.addBrowseFolderListener(ExecutionBundle.message("choose.file.to.save.console.output"),
|
||||
ExecutionBundle.message("console.output.would.be.saved.to.the.specified.file"), null,
|
||||
FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor()
|
||||
.withTitle(ExecutionBundle.message("choose.file.to.save.console.output"))
|
||||
.withDescription(ExecutionBundle.message("console.output.would.be.saved.to.the.specified.file"));
|
||||
myOutputFile.addBrowseFolderListener(null, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
myRedirectOutputCb.addActionListener(e -> myOutputFile.setEnabled(myRedirectOutputCb.isSelected()));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.diagnostic.logging;
|
||||
|
||||
import com.intellij.diagnostic.DiagnosticBundle;
|
||||
@@ -17,7 +17,6 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public final class LogsGroupFragment<T extends RunConfigurationBase<?>> extends NestedGroupFragment<T> {
|
||||
|
||||
public LogsGroupFragment() {
|
||||
super("log",
|
||||
DiagnosticBundle.message("log.monitor.fragment.name"), DiagnosticBundle.message("log.monitor.fragment.group"),
|
||||
@@ -25,13 +24,13 @@ public final class LogsGroupFragment<T extends RunConfigurationBase<?>> extends
|
||||
setActionHint(ExecutionBundle.message("the.ide.will.display.the.selected.logs.in.the.run.tool.window"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
protected List<SettingsEditorFragment<T, ?>> createChildren() {
|
||||
TextFieldWithBrowseButton myOutputFile = new TextFieldWithBrowseButton();
|
||||
myOutputFile.addBrowseFolderListener(ExecutionBundle.message("choose.file.to.save.console.output"),
|
||||
ExecutionBundle.message("console.output.would.be.saved.to.the.specified.file"), null,
|
||||
FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var myOutputFile = new TextFieldWithBrowseButton();
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor()
|
||||
.withTitle(ExecutionBundle.message("choose.file.to.save.console.output"))
|
||||
.withDescription(ExecutionBundle.message("console.output.would.be.saved.to.the.specified.file"));
|
||||
myOutputFile.addBrowseFolderListener(null, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
LabeledComponent<TextFieldWithBrowseButton> component =
|
||||
LabeledComponent.create(myOutputFile, ExecutionBundle.message("save.output.console.to.file"), BorderLayout.WEST);
|
||||
SettingsEditorFragment<T, LabeledComponent<TextFieldWithBrowseButton>> fragment =
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.impl;
|
||||
|
||||
import com.intellij.configurationStore.Scheme_implKt;
|
||||
@@ -485,10 +485,7 @@ public final class RunConfigurationStorageUi {
|
||||
}
|
||||
};
|
||||
|
||||
Runnable selectFolderAction = new BrowseFolderRunnable<>(null, null, project, descriptor, comboBox,
|
||||
TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT) {
|
||||
};
|
||||
|
||||
Runnable selectFolderAction = new BrowseFolderRunnable<>(project, descriptor, comboBox, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
|
||||
comboBox.initBrowsableEditor(selectFolderAction, uiDisposable);
|
||||
return comboBox;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.CommonProgramRunConfigurationParameters;
|
||||
@@ -77,10 +77,9 @@ public final class CommonParameterFragments<Settings extends CommonProgramRunCon
|
||||
|
||||
public <S extends InputRedirectAware> SettingsEditorFragment<S, ?> createRedirectFragment() {
|
||||
TextFieldWithBrowseButton inputFile = new TextFieldWithBrowseButton();
|
||||
inputFile.addActionListener(new ComponentWithBrowseButton.BrowseFolderActionListener<>(null, null, inputFile, null,
|
||||
FileChooserDescriptorFactory
|
||||
.createSingleFileDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
|
||||
inputFile.addActionListener(new ComponentWithBrowseButton.BrowseFolderActionListener<>(
|
||||
inputFile, null, FileChooserDescriptorFactory.createSingleFileDescriptor(), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
|
||||
) {
|
||||
@Override
|
||||
protected @Nullable VirtualFile getInitialFile() {
|
||||
VirtualFile initialFile = super.getInitialFile();
|
||||
@@ -117,16 +116,11 @@ public final class CommonParameterFragments<Settings extends CommonProgramRunCon
|
||||
@NotNull Project project,
|
||||
@NotNull Computable<? extends Module> moduleProvider
|
||||
) {
|
||||
ExtendableTextField textField = new ExtendableTextField(10);
|
||||
var textField = new ExtendableTextField(10);
|
||||
MacrosDialog.addMacroSupport(textField, MacrosDialog.Filters.DIRECTORY_PATH, () -> moduleProvider.compute() != null);
|
||||
TextFieldWithBrowseButton workingDirectoryField = new TextFieldWithBrowseButton(textField);
|
||||
workingDirectoryField.addBrowseFolderListener(
|
||||
ExecutionBundle.message("select.working.directory.message"),
|
||||
null,
|
||||
project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
|
||||
);
|
||||
var workingDirectoryField = new TextFieldWithBrowseButton(textField);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ExecutionBundle.message("select.working.directory.message"));
|
||||
workingDirectoryField.addBrowseFolderListener(project, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
LabeledComponent<TextFieldWithBrowseButton> field = LabeledComponent.create(
|
||||
workingDirectoryField,
|
||||
ExecutionBundle.message("run.configuration.working.directory.label"),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.CommonProgramRunConfigurationParameters;
|
||||
@@ -82,16 +82,13 @@ public class CommonProgramParametersPanel extends JPanel implements PanelWithAnc
|
||||
// for backward compatibility: com.microsoft.tooling.msservices.intellij.azure:3.0.11
|
||||
myWorkingDirectoryField = new TextFieldWithBrowseButton();
|
||||
|
||||
myWorkingDirectoryField.addBrowseFolderListener(ExecutionBundle.message("select.working.directory.message"), null,
|
||||
getProject(),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
myWorkingDirectoryComponent = LabeledComponent.create(myWorkingDirectoryField,
|
||||
ExecutionBundle.message("run.configuration.working.directory.label"));
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ExecutionBundle.message("select.working.directory.message"));
|
||||
myWorkingDirectoryField.addBrowseFolderListener(getProject(), descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
myWorkingDirectoryComponent = LabeledComponent.create(myWorkingDirectoryField, ExecutionBundle.message("run.configuration.working.directory.label"));
|
||||
|
||||
myEnvVariablesComponent = createEnvironmentVariablesComponent();
|
||||
|
||||
myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
|
||||
|
||||
myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
|
||||
myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);
|
||||
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.openapi.actionSystem.LangDataKeys;
|
||||
@@ -27,42 +13,32 @@ import com.intellij.openapi.ui.ComboBox;
|
||||
import com.intellij.openapi.ui.TextComponentAccessor;
|
||||
import com.intellij.ui.TextAccessor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public final class MacroComboBoxWithBrowseButton extends ComboBox<String> implements TextAccessor {
|
||||
private Module module;
|
||||
private boolean always;
|
||||
private final Module myModule;
|
||||
|
||||
public MacroComboBoxWithBrowseButton(FileChooserDescriptor descriptor, Project project) {
|
||||
super(new MacroComboBoxModel());
|
||||
descriptor.withShowHiddenFiles(true);
|
||||
|
||||
Runnable action = new BrowseFolderRunnable<ComboBox<String>>(null, null, project, descriptor, this, accessor) {
|
||||
private Module getModule() {
|
||||
if (module == null) module = myFileChooserDescriptor.getUserData(LangDataKeys.MODULE_CONTEXT);
|
||||
if (module == null) module = myFileChooserDescriptor.getUserData(PlatformCoreDataKeys.MODULE);
|
||||
return module;
|
||||
}
|
||||
var module = descriptor.getUserData(LangDataKeys.MODULE_CONTEXT);
|
||||
if (module == null) module = descriptor.getUserData(PlatformCoreDataKeys.MODULE);
|
||||
myModule = module;
|
||||
|
||||
@Override
|
||||
protected @Nullable Project getProject() {
|
||||
Project project = super.getProject();
|
||||
if (project != null) return project;
|
||||
Module module = getModule();
|
||||
return module == null ? null : module.getProject();
|
||||
}
|
||||
if (project == null && module != null) {
|
||||
project = module.getProject();
|
||||
}
|
||||
|
||||
descriptor = descriptor.withShowHiddenFiles(true);
|
||||
|
||||
var action = new BrowseFolderRunnable<ComboBox<String>>(project, descriptor, this, accessor) {
|
||||
@Override
|
||||
protected @NotNull String expandPath(@NotNull String path) {
|
||||
Project project = getProject();
|
||||
var project = getProject();
|
||||
if (project != null) path = PathMacroManager.getInstance(project).expandPath(path);
|
||||
|
||||
Module module = getModule();
|
||||
if (module != null) path = PathMacroManager.getInstance(module).expandPath(path);
|
||||
|
||||
if (myModule != null) path = PathMacroManager.getInstance(myModule).expandPath(path);
|
||||
return super.expandPath(path);
|
||||
}
|
||||
};
|
||||
@@ -85,21 +61,6 @@ public final class MacroComboBoxWithBrowseButton extends ComboBox<String> implem
|
||||
accessor.setText(this, text != null ? text : "");
|
||||
}
|
||||
|
||||
public void setModule(Module module) {
|
||||
this.module = module;
|
||||
configure();
|
||||
}
|
||||
|
||||
public void showModuleMacroAlways() {
|
||||
always = true;
|
||||
configure();
|
||||
}
|
||||
|
||||
private void configure() {
|
||||
MacroComboBoxModel model = (MacroComboBoxModel)getModel();
|
||||
if (model != null) model.useModuleDir(always || module != null);
|
||||
}
|
||||
|
||||
private final TextComponentAccessor<ComboBox<String>> accessor = new TextComponentAccessor<>() {
|
||||
@Override
|
||||
public String getText(ComboBox<String> component) {
|
||||
@@ -112,4 +73,4 @@ public final class MacroComboBoxWithBrowseButton extends ComboBox<String> implem
|
||||
if (component != null) component.setSelectedItem(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.ui;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
@@ -26,9 +26,8 @@ public final class ProgramInputRedirectPanel extends JPanel implements PanelWith
|
||||
|
||||
public ProgramInputRedirectPanel() {
|
||||
super(new BorderLayout(UIUtil.DEFAULT_HGAP, 2));
|
||||
myInputFile.addBrowseFolderListener(null, null, null,
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor();
|
||||
myInputFile.addBrowseFolderListener(null, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
add(myInputFile, BorderLayout.CENTER);
|
||||
myInputFile.setEnabled(false);
|
||||
add(myCheckBox, BorderLayout.WEST);
|
||||
|
||||
@@ -1440,7 +1440,6 @@ f:com.intellij.execution.target.TargetBasedSdks
|
||||
- sf:saveTargetBasedSdkAdditionalData(org.jdom.Element,com.intellij.execution.target.ContributedConfigurationsList$ContributedStateBase):V
|
||||
- sf:saveTargetConfiguration(org.jdom.Element,com.intellij.execution.target.TargetEnvironmentConfiguration):V
|
||||
f:com.intellij.execution.target.TargetBrowserHints
|
||||
- <init>():V
|
||||
- <init>(Z):V
|
||||
- <init>(Z,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- b:<init>(Z,com.intellij.openapi.fileChooser.FileChooserDescriptor,I,kotlin.jvm.internal.DefaultConstructorMarker):V
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.target
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
@@ -12,5 +12,7 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
* [customFileChooserDescriptor] to browse files. It also might be ignored by some targets.
|
||||
**/
|
||||
|
||||
data class TargetBrowserHints @JvmOverloads constructor(val showLocalFsInBrowser: Boolean = true,
|
||||
val customFileChooserDescriptor: FileChooserDescriptor? = null)
|
||||
data class TargetBrowserHints @JvmOverloads constructor(
|
||||
val showLocalFsInBrowser: Boolean,
|
||||
val customFileChooserDescriptor: FileChooserDescriptor? = null
|
||||
)
|
||||
|
||||
@@ -1311,7 +1311,6 @@ f:com.intellij.openapi.externalSystem.service.ui.project.path.ExternalSystemWork
|
||||
- getEditorLabel():java.lang.String
|
||||
- getEmptyFieldError():java.lang.String
|
||||
- getFileChooserDescriptor():com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- getFileChooserTitle():java.lang.String
|
||||
- getSettingsName():java.lang.String
|
||||
f:com.intellij.openapi.externalSystem.service.ui.project.path.WorkingDirectoryField
|
||||
- com.intellij.openapi.externalSystem.service.ui.completion.TextCompletionField
|
||||
@@ -1336,7 +1335,6 @@ com.intellij.openapi.externalSystem.service.ui.project.path.WorkingDirectoryInfo
|
||||
- a:collectExternalProjects(kotlin.coroutines.Continuation):java.lang.Object
|
||||
- a:getEmptyFieldError():java.lang.String
|
||||
- getExternalProjectModificationTracker():com.intellij.openapi.util.ModificationTracker
|
||||
- getFileChooserDescription():java.lang.String
|
||||
- getFileChooserMacroFilter():kotlin.jvm.functions.Function1
|
||||
- getSettingsActionHint():java.lang.String
|
||||
- getSettingsGroup():java.lang.String
|
||||
@@ -1408,7 +1406,6 @@ a:com.intellij.openapi.externalSystem.service.ui.util.ObservableDialogWrapper
|
||||
com.intellij.openapi.externalSystem.service.ui.util.PathFragmentInfo
|
||||
- com.intellij.openapi.externalSystem.service.ui.util.LabeledSettingsFragmentInfo
|
||||
- com.intellij.openapi.roots.ui.distribution.FileChooserInfo
|
||||
- getFileChooserDescription():java.lang.String
|
||||
- getSettingsActionHint():java.lang.String
|
||||
- getSettingsHint():java.lang.String
|
||||
com.intellij.openapi.externalSystem.service.ui.util.SettingsFragmentInfo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.execution.configuration
|
||||
|
||||
import com.intellij.execution.ExecutionBundle
|
||||
@@ -180,8 +180,6 @@ fun <S> SettingsEditorFragmentContainer<S>.addPathFragment(
|
||||
{
|
||||
textFieldWithBrowseButton(
|
||||
project,
|
||||
pathFragmentInfo.fileChooserTitle,
|
||||
pathFragmentInfo.fileChooserDescription,
|
||||
ExtendableTextField(10).apply {
|
||||
val fileChooserMacroFilter = pathFragmentInfo.fileChooserMacroFilter
|
||||
if (fileChooserMacroFilter != null) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.ui.project.path
|
||||
|
||||
import com.intellij.openapi.externalSystem.model.ProjectSystemId
|
||||
@@ -15,16 +15,14 @@ class ExternalSystemWorkingDirectoryInfo(
|
||||
private val project: Project,
|
||||
private val externalSystemId: ProjectSystemId
|
||||
) : WorkingDirectoryInfo {
|
||||
|
||||
private val readableName = externalSystemId.readableName
|
||||
|
||||
override val editorLabel: String = ExternalSystemBundle.message("run.configuration.project.path.label", readableName)
|
||||
|
||||
override val settingsName: String = ExternalSystemBundle.message("run.configuration.project.path.name", readableName)
|
||||
|
||||
override val fileChooserTitle: String = ExternalSystemBundle.message("settings.label.select.project", readableName)
|
||||
override val fileChooserDescriptor: FileChooserDescriptor =
|
||||
ExternalSystemApiUtil.getExternalProjectConfigDescriptor(externalSystemId)
|
||||
ExternalSystemApiUtil.getExternalProjectConfigDescriptor(externalSystemId).withTitle(ExternalSystemBundle.message("settings.label.select.project", readableName))
|
||||
|
||||
override val emptyFieldError: String = ExternalSystemBundle.message("run.configuration.project.path.empty.error", readableName)
|
||||
|
||||
@@ -47,4 +45,4 @@ class ExternalSystemWorkingDirectoryInfo(
|
||||
return@blockingContext externalProjects
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.ui.project.path
|
||||
|
||||
import com.intellij.openapi.Disposable
|
||||
@@ -28,7 +28,6 @@ import javax.swing.plaf.basic.BasicTextUI
|
||||
import javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
|
||||
import javax.swing.text.Highlighter
|
||||
|
||||
|
||||
class WorkingDirectoryField(
|
||||
project: Project,
|
||||
workingDirectoryInfo: WorkingDirectoryInfo,
|
||||
@@ -254,8 +253,6 @@ class WorkingDirectoryField(
|
||||
}
|
||||
}
|
||||
val browseFolderRunnable = object : BrowseFolderRunnable<WorkingDirectoryField>(
|
||||
workingDirectoryInfo.fileChooserTitle,
|
||||
workingDirectoryInfo.fileChooserDescription,
|
||||
project,
|
||||
workingDirectoryInfo.fileChooserDescriptor,
|
||||
this,
|
||||
@@ -275,4 +272,4 @@ class WorkingDirectoryField(
|
||||
}
|
||||
|
||||
enum class Mode { PATH, NAME }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.ui.project.path
|
||||
|
||||
import com.intellij.openapi.externalSystem.service.ui.util.LabeledSettingsFragmentInfo
|
||||
@@ -12,8 +12,6 @@ interface WorkingDirectoryInfo : FileChooserInfo, LabeledSettingsFragmentInfo {
|
||||
override val settingsPriority: Int get() = -10
|
||||
override val settingsHint: String? get() = null
|
||||
override val settingsActionHint: String? get() = null
|
||||
|
||||
override val fileChooserDescription: String? get() = null
|
||||
override val fileChooserMacroFilter get() = FileChooserInfo.DIRECTORY_PATH
|
||||
|
||||
val emptyFieldError: @Nls(capitalization = Nls.Capitalization.Sentence) String
|
||||
@@ -22,4 +20,4 @@ interface WorkingDirectoryInfo : FileChooserInfo, LabeledSettingsFragmentInfo {
|
||||
get() = ModificationTracker.NEVER_CHANGED
|
||||
|
||||
suspend fun collectExternalProjects(): List<ExternalProject>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.ui.util
|
||||
|
||||
import com.intellij.openapi.roots.ui.distribution.FileChooserInfo
|
||||
@@ -6,6 +6,4 @@ import com.intellij.openapi.roots.ui.distribution.FileChooserInfo
|
||||
interface PathFragmentInfo : FileChooserInfo, LabeledSettingsFragmentInfo {
|
||||
override val settingsHint: String? get() = null
|
||||
override val settingsActionHint: String? get() = null
|
||||
|
||||
override val fileChooserDescription: String? get() = null
|
||||
}
|
||||
|
||||
@@ -21916,10 +21916,10 @@ com.intellij.openapi.roots.ui.distribution.DistributionInfo
|
||||
- a:getName():java.lang.String
|
||||
com.intellij.openapi.roots.ui.distribution.FileChooserInfo
|
||||
- sf:Companion:com.intellij.openapi.roots.ui.distribution.FileChooserInfo$Companion
|
||||
- a:getFileChooserDescription():java.lang.String
|
||||
- getFileChooserDescription():java.lang.String
|
||||
- a:getFileChooserDescriptor():com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- a:getFileChooserMacroFilter():kotlin.jvm.functions.Function1
|
||||
- a:getFileChooserTitle():java.lang.String
|
||||
- getFileChooserTitle():java.lang.String
|
||||
f:com.intellij.openapi.roots.ui.distribution.FileChooserInfo$Companion
|
||||
- f:getALL():kotlin.jvm.functions.Function1
|
||||
- f:getANY_PATH():kotlin.jvm.functions.Function1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeEditor.printing
|
||||
|
||||
import com.intellij.openapi.editor.EditorBundle
|
||||
@@ -25,9 +25,9 @@ class ExportToHTMLDialog(private val fileName: String?,
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun addBrowseDirectoryListener(targetDirectoryField: TextFieldWithBrowseButton, project: Project) {
|
||||
targetDirectoryField.addBrowseFolderListener(EditorBundle.message("export.to.html.select.output.directory.title"),
|
||||
EditorBundle.message("export.to.html.select.output.directory.description"),
|
||||
project, FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
targetDirectoryField.addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(EditorBundle.message("export.to.html.select.output.directory.title"))
|
||||
.withDescription(EditorBundle.message("export.to.html.select.output.directory.description")))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInspection.ui.actions
|
||||
|
||||
import com.intellij.codeInspection.InspectionsBundle
|
||||
@@ -8,7 +8,8 @@ import com.intellij.codeInspection.ui.InspectionResultsView
|
||||
import com.intellij.codeInspection.ui.InspectionTree
|
||||
import com.intellij.ide.util.PropertiesComponent
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.application.*
|
||||
import com.intellij.openapi.application.invokeLater
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.editor.EditorBundle
|
||||
import com.intellij.openapi.extensions.ExtensionPointName
|
||||
@@ -134,9 +135,8 @@ abstract class InspectionResultsExportActionProvider(text: Supplier<String?>,
|
||||
.bottomGap(BottomGap.SMALL)
|
||||
row(EditorBundle.message("export.to.html.output.directory.label")) {
|
||||
textFieldWithBrowseButton(
|
||||
EditorBundle.message("export.to.html.select.output.directory.title"),
|
||||
view.project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(EditorBundle.message("export.to.html.select.output.directory.title")),
|
||||
view.project
|
||||
)
|
||||
.columns(COLUMNS_LARGE)
|
||||
.bindText(locationProperty)
|
||||
@@ -158,4 +158,4 @@ abstract class InspectionResultsExportActionProvider(text: Supplier<String?>,
|
||||
super.doOKAction()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import com.intellij.lang.LangBundle;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.application.AccessToken;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.ui.*;
|
||||
@@ -359,9 +358,9 @@ public class ProjectSettingsStepBase<T> extends AbstractActionWithPanel implemen
|
||||
textField.putClientProperty(DialogWrapperPeer.HAVE_INITIAL_SELECTION, true);
|
||||
}
|
||||
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
myLocationField.addBrowseFolderListener(IdeBundle.message("directory.project.location.title"),
|
||||
IdeBundle.message("directory.project.location.description"), null, descriptor);
|
||||
myLocationField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(IdeBundle.message("directory.project.location.title"))
|
||||
.withDescription(IdeBundle.message("directory.project.location.description")));
|
||||
checkValid();
|
||||
return LabeledComponent.create(myLocationField,
|
||||
BundleBase.replaceMnemonicAmpersand(IdeBundle.message("directory.project.location.label")),
|
||||
@@ -382,4 +381,4 @@ public class ProjectSettingsStepBase<T> extends AbstractActionWithPanel implemen
|
||||
final @Nullable WizardContext getWizardContext() {
|
||||
return myProjectStep != null ? myProjectStep.getWizardContext() : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,10 +295,8 @@ internal class JdkDownloadDialog(
|
||||
isEditable = true
|
||||
initBrowsableEditor(
|
||||
BrowseFolderRunnable(
|
||||
ProjectBundle.message("dialog.title.select.path.to.install.jdk"),
|
||||
null,
|
||||
project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ProjectBundle.message("dialog.title.select.path.to.install.jdk")),
|
||||
installDirCombo,
|
||||
TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT
|
||||
), disposable)
|
||||
@@ -309,9 +307,8 @@ internal class JdkDownloadDialog(
|
||||
}
|
||||
else {
|
||||
installDirTextField = textFieldWithBrowseButton(
|
||||
project = project,
|
||||
browseDialogTitle = ProjectBundle.message("dialog.title.select.path.to.install.jdk"),
|
||||
fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ProjectBundle.message("dialog.title.select.path.to.install.jdk"))
|
||||
).apply {
|
||||
onTextChange { onTargetPathChanged(it) }
|
||||
textField.columns = 36
|
||||
|
||||
@@ -205,9 +205,8 @@ internal class RuntimeChooserDialog(
|
||||
//download row
|
||||
row(LangBundle.message("dialog.label.choose.ide.runtime.location")) {
|
||||
jdkInstallDirSelector = textFieldWithBrowseButton(
|
||||
project = project,
|
||||
browseDialogTitle = LangBundle.message("dialog.title.choose.ide.runtime.select.path.to.install.jdk"),
|
||||
fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(LangBundle.message("dialog.title.choose.ide.runtime.select.path.to.install.jdk")),
|
||||
project
|
||||
).align(AlignX.FILL)
|
||||
.comment(LangBundle.message("dialog.message.choose.ide.runtime.select.path.to.install.jdk"))
|
||||
.component
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.roots.ui.distribution
|
||||
|
||||
import com.intellij.openapi.application.ex.ClipboardUtil
|
||||
@@ -149,8 +149,6 @@ class DistributionComboBox(
|
||||
override fun setText(component: DistributionComboBox, text: String) = setSelectedDistributionUiPath(text)
|
||||
}
|
||||
val selectFolderAction = BrowseFolderRunnable<DistributionComboBox>(
|
||||
info.fileChooserTitle,
|
||||
info.fileChooserDescription,
|
||||
project,
|
||||
info.fileChooserDescriptor,
|
||||
this,
|
||||
@@ -265,4 +263,4 @@ class DistributionComboBox(
|
||||
object SpecifyDistributionAction : Item()
|
||||
data class Distribution(val info: DistributionInfo) : Item()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.roots.ui.distribution
|
||||
|
||||
import com.intellij.ide.macro.Macro
|
||||
@@ -7,8 +7,10 @@ import com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
import com.intellij.openapi.util.NlsContexts
|
||||
|
||||
interface FileChooserInfo {
|
||||
val fileChooserTitle: @NlsContexts.DialogTitle String?
|
||||
val fileChooserDescription: @NlsContexts.Label String?
|
||||
@Deprecated("Amend `fileChooserDescriptor` with `FileChooserDescriptor#withTitle`", level = DeprecationLevel.ERROR)
|
||||
val fileChooserTitle: @NlsContexts.DialogTitle String? get() = null
|
||||
@Deprecated("Amend `fileChooserDescriptor` with `FileChooserDescriptor#withDescription`", level = DeprecationLevel.ERROR)
|
||||
val fileChooserDescription: @NlsContexts.Label String? get() = null
|
||||
val fileChooserDescriptor: FileChooserDescriptor
|
||||
val fileChooserMacroFilter: ((Macro) -> Boolean)?
|
||||
|
||||
@@ -19,4 +21,4 @@ interface FileChooserInfo {
|
||||
val DIRECTORY_PATH: (Macro) -> Boolean = { it: Macro -> MacrosDialog.Filters.DIRECTORY_PATH.test(it) }
|
||||
val FILE_PATH: (Macro) -> Boolean = { it: Macro -> MacrosDialog.Filters.FILE_PATH.test(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.event.DocumentListener;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.fileChooser.impl.FileChooserUtil;
|
||||
import com.intellij.openapi.fileTypes.FileType;
|
||||
@@ -234,11 +233,10 @@ public class CopyFilesOrDirectoriesDialog extends RefactoringDialog implements D
|
||||
if (recentEntries != null) {
|
||||
getTargetDirectoryComponent().setHistory(recentEntries);
|
||||
}
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
|
||||
RefactoringBundle.message("the.file.will.be.copied.to.this.directory"),
|
||||
myProject, descriptor,
|
||||
TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(RefactoringBundle.message("select.target.directory"))
|
||||
.withDescription(RefactoringBundle.message("the.file.will.be.copied.to.this.directory"));
|
||||
myTargetDirectoryField.addBrowseFolderListener(myProject, descriptor, TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
getTargetDirectoryComponent().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -83,9 +83,9 @@ public class ExtractIncludeDialog extends DialogWrapper {
|
||||
|
||||
myTargetDirectoryField = new TextFieldWithBrowseButton();
|
||||
myTargetDirectoryField.setText(myCurrentDirectory.getVirtualFile().getPresentableUrl());
|
||||
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
|
||||
RefactoringBundle.message("select.target.directory.description"),
|
||||
null, FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myTargetDirectoryField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(RefactoringBundle.message("select.target.directory"))
|
||||
.withDescription(RefactoringBundle.message("select.target.directory.description")));
|
||||
|
||||
myTargetDirLabel.setText(RefactoringBundle.message("extract.to.directory"));
|
||||
panel.add(myTargetDirectoryField);
|
||||
@@ -166,4 +166,4 @@ public class ExtractIncludeDialog extends DialogWrapper {
|
||||
private static @NlsContexts.DialogTitle String getRefactoringName() {
|
||||
return RefactoringBundle.message("extractIncludeFile.name");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.refactoring.move.moveFilesOrDirectories;
|
||||
|
||||
import com.intellij.ide.util.DirectoryUtil;
|
||||
@@ -7,7 +7,6 @@ import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.IdeActions;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.fileChooser.FileChooserFactory;
|
||||
import com.intellij.openapi.keymap.KeymapUtil;
|
||||
@@ -101,12 +100,10 @@ public abstract class MoveFilesOrDirectoriesDialog extends RefactoringDialog {
|
||||
if (recentEntries != null) {
|
||||
myTargetDirectoryField.getChildComponent().setHistory(recentEntries);
|
||||
}
|
||||
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"),
|
||||
RefactoringBundle.message("the.file.will.be.moved.to.this.directory"),
|
||||
myProject,
|
||||
descriptor,
|
||||
TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(RefactoringBundle.message("select.target.directory"))
|
||||
.withDescription(RefactoringBundle.message("the.file.will.be.moved.to.this.directory"));
|
||||
myTargetDirectoryField.addBrowseFolderListener(myProject, descriptor, TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
final JTextField textField = myTargetDirectoryField.getChildComponent().getTextEditor();
|
||||
FileChooserFactory.getInstance().installFileCompletion(textField, descriptor, true, getDisposable());
|
||||
textField.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
|
||||
@@ -65,8 +65,8 @@ public class ToolEditorDialog extends DialogWrapper {
|
||||
|
||||
protected void fillAdditionalOptionsPanel(final @NotNull JPanel panel) {}
|
||||
|
||||
protected void addWorkingDirectoryBrowseAction(final @NotNull TextFieldWithBrowseButton workingDirField) {
|
||||
workingDirField.addBrowseFolderListener(null, null, myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
protected void addWorkingDirectoryBrowseAction(@NotNull TextFieldWithBrowseButton workingDirField) {
|
||||
workingDirField.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
}
|
||||
|
||||
protected void addProgramBrowseAction(final @NotNull TextFieldWithBrowseButton programField) {
|
||||
@@ -182,4 +182,4 @@ public class ToolEditorDialog extends DialogWrapper {
|
||||
if (s != null && s.trim().isEmpty()) return null;
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1291,6 +1291,7 @@ c:com.intellij.ide.util.BrowseFilesListener
|
||||
- sf:SINGLE_DIRECTORY_DESCRIPTOR:com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- sf:SINGLE_FILE_DESCRIPTOR:com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- pf:myChooserDescriptor:com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- <init>(javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- <init>(javax.swing.JTextField,java.lang.String,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- actionPerformed(java.awt.event.ActionEvent):V
|
||||
- p:doSetText(java.lang.String):V
|
||||
@@ -3591,16 +3592,16 @@ f:com.intellij.openapi.ui.BrowseFolderDescriptor$Companion
|
||||
- pf:myAccessor:com.intellij.openapi.ui.TextComponentAccessor
|
||||
- pf:myFileChooserDescriptor:com.intellij.openapi.fileChooser.FileChooserDescriptor
|
||||
- p:myTextComponent:javax.swing.JComponent
|
||||
- <init>(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,javax.swing.JComponent,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,javax.swing.JComponent,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- p:chooseFile(com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- p:chosenFileToResultingText(com.intellij.openapi.vfs.VirtualFile):java.lang.String
|
||||
- p:expandPath(java.lang.String):java.lang.String
|
||||
- p:getComponentText():java.lang.String
|
||||
- p:getInitialFile():com.intellij.openapi.vfs.VirtualFile
|
||||
- p:getProject():com.intellij.openapi.project.Project
|
||||
- pf:getProject():com.intellij.openapi.project.Project
|
||||
- p:onFileChosen(com.intellij.openapi.vfs.VirtualFile):V
|
||||
- run():V
|
||||
- p:setProject(com.intellij.openapi.project.Project):V
|
||||
c:com.intellij.openapi.ui.ComboBox
|
||||
- com.intellij.openapi.ui.ComboBoxWithWidePopup
|
||||
- java.awt.event.AWTEventListener
|
||||
@@ -3709,6 +3710,7 @@ c:com.intellij.openapi.ui.ComponentWithBrowseButton
|
||||
- com.intellij.openapi.Disposable
|
||||
- <init>(javax.swing.JComponent,java.awt.event.ActionListener):V
|
||||
- addActionListener(java.awt.event.ActionListener):V
|
||||
- addBrowseFolderListener(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- addBrowseFolderListener(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton$BrowseFolderActionListener):V
|
||||
- addBrowseFolderListener(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- addBrowseFolderListener(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,Z):V
|
||||
@@ -3732,6 +3734,7 @@ c:com.intellij.openapi.ui.ComponentWithBrowseButton
|
||||
c:com.intellij.openapi.ui.ComponentWithBrowseButton$BrowseFolderActionListener
|
||||
- com.intellij.openapi.ui.BrowseFolderRunnable
|
||||
- java.awt.event.ActionListener
|
||||
- <init>(com.intellij.openapi.ui.ComponentWithBrowseButton,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- <init>(java.lang.String,java.lang.String,com.intellij.openapi.ui.ComponentWithBrowseButton,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- actionPerformed(java.awt.event.ActionEvent):V
|
||||
f:com.intellij.openapi.ui.ComponentWithBrowseButton$MyDoClickAction
|
||||
@@ -4714,6 +4717,7 @@ c:com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- <init>(javax.swing.JTextField):V
|
||||
- <init>(javax.swing.JTextField,java.awt.event.ActionListener):V
|
||||
- <init>(javax.swing.JTextField,java.awt.event.ActionListener,com.intellij.openapi.Disposable):V
|
||||
- addBrowseFolderListener(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- addBrowseFolderListener(com.intellij.openapi.ui.TextBrowseFolderListener):V
|
||||
- addBrowseFolderListener(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- addDocumentListener(javax.swing.event.DocumentListener):V
|
||||
@@ -7709,6 +7713,7 @@ c:com.intellij.ui.TextFieldWithHistory$MyModel
|
||||
c:com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- com.intellij.openapi.ui.ComponentWithBrowseButton
|
||||
- <init>():V
|
||||
- addBrowseFolderListener(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- addBrowseFolderListener(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- addBrowseFolderListener(java.lang.String,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,Z):V
|
||||
- getText():java.lang.String
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.browsers.chrome;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -32,9 +32,9 @@ public class ChromeSettingsConfigurable implements Configurable {
|
||||
|
||||
public ChromeSettingsConfigurable(@NotNull ChromeSettings settings) {
|
||||
mySettings = settings;
|
||||
myUserDataDirField.addBrowseFolderListener(IdeBundle.message("chooser.title.select.user.data.directory"), IdeBundle
|
||||
.message("chooser.description.specifies.user.data.directory"), null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myUserDataDirField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(IdeBundle.message("chooser.title.select.user.data.directory"))
|
||||
.withDescription(IdeBundle.message("chooser.description.specifies.user.data.directory")));
|
||||
myUseCustomProfileCheckBox.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.browsers.firefox;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -24,8 +24,6 @@ import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FirefoxSettingsConfigurable implements Configurable {
|
||||
private static final FileChooserDescriptor PROFILES_INI_CHOOSER_DESCRIPTOR = createProfilesIniChooserDescriptor();
|
||||
|
||||
private JPanel myMainPanel;
|
||||
private JComboBox myProfileCombobox;
|
||||
private TextFieldWithBrowseButton myProfilesIniPathField;
|
||||
@@ -36,7 +34,7 @@ public class FirefoxSettingsConfigurable implements Configurable {
|
||||
|
||||
public FirefoxSettingsConfigurable(FirefoxSettings settings) {
|
||||
mySettings = settings;
|
||||
myProfilesIniPathField.addBrowseFolderListener(IdeBundle.message("chooser.title.select.profiles.ini.file"), null, null, PROFILES_INI_CHOOSER_DESCRIPTOR);
|
||||
myProfilesIniPathField.addBrowseFolderListener(null, createProfilesIniChooserDescriptor().withTitle(IdeBundle.message("chooser.title.select.profiles.ini.file")));
|
||||
myProfilesIniPathField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.util;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
@@ -16,11 +16,13 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
*/
|
||||
public class BrowseFilesListener implements ActionListener {
|
||||
/** @deprecated mutable object; use {@link FileChooserDescriptorFactory#createSingleFolderDescriptor} instead */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final FileChooserDescriptor SINGLE_DIRECTORY_DESCRIPTOR = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
|
||||
/** @deprecated mutable object; use {@link FileChooserDescriptorFactory#createSingleFileNoJarsDescriptor} instead */
|
||||
@Deprecated(forRemoval = true)
|
||||
public static final FileChooserDescriptor SINGLE_FILE_DESCRIPTOR = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor();
|
||||
|
||||
private final JTextField myTextField;
|
||||
@@ -28,20 +30,34 @@ public class BrowseFilesListener implements ActionListener {
|
||||
private final @NlsContexts.Label String myDescription;
|
||||
protected final FileChooserDescriptor myChooserDescriptor;
|
||||
|
||||
public BrowseFilesListener(JTextField textField,
|
||||
@NlsContexts.DialogTitle String title,
|
||||
@NlsContexts.Label String description,
|
||||
FileChooserDescriptor chooserDescriptor) {
|
||||
/**
|
||||
* @deprecated use {@link BrowseFilesListener#BrowseFilesListener(JTextField, FileChooserDescriptor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public BrowseFilesListener(
|
||||
JTextField textField,
|
||||
@NlsContexts.DialogTitle String title,
|
||||
@NlsContexts.Label String description,
|
||||
FileChooserDescriptor chooserDescriptor
|
||||
) {
|
||||
myTextField = textField;
|
||||
myTitle = title;
|
||||
myDescription = description;
|
||||
myChooserDescriptor = chooserDescriptor;
|
||||
}
|
||||
|
||||
public BrowseFilesListener(JTextField textField, FileChooserDescriptor chooserDescriptor) {
|
||||
myTextField = textField;
|
||||
myTitle = null;
|
||||
myDescription = null;
|
||||
myChooserDescriptor = chooserDescriptor;
|
||||
}
|
||||
|
||||
protected @Nullable VirtualFile getFileToSelect() {
|
||||
final String path = myTextField.getText().trim().replace(File.separatorChar, '/');
|
||||
if (path.length() > 0) {
|
||||
File file = new File(path);
|
||||
var path = myTextField.getText().trim().replace(File.separatorChar, '/');
|
||||
if (!path.isEmpty()) {
|
||||
var file = new File(path);
|
||||
while (file != null && !file.exists()) {
|
||||
file = file.getParentFile();
|
||||
}
|
||||
@@ -58,9 +74,13 @@ public class BrowseFilesListener implements ActionListener {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e ) {
|
||||
final VirtualFile fileToSelect = getFileToSelect();
|
||||
myChooserDescriptor.setTitle(myTitle); // important to set title and description here because a shared descriptor instance can be used
|
||||
myChooserDescriptor.setDescription(myDescription);
|
||||
var fileToSelect = getFileToSelect();
|
||||
if (myTitle != null) {
|
||||
myChooserDescriptor.setTitle(myTitle);
|
||||
}
|
||||
if (myDescription != null) {
|
||||
myChooserDescriptor.setDescription(myDescription);
|
||||
}
|
||||
FileChooser.chooseFiles(myChooserDescriptor, null, fileToSelect, files -> doSetText(FileUtil.toSystemDependentName(files.get(0).getPath())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.NlsSafe;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.io.NioFiles;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -19,60 +19,61 @@ import javax.swing.*;
|
||||
|
||||
@ApiStatus.Experimental
|
||||
public class BrowseFolderRunnable<T extends JComponent> implements Runnable {
|
||||
private final @NlsContexts.DialogTitle String myTitle;
|
||||
private final @NlsContexts.Label String myDescription;
|
||||
protected final @NotNull TextComponentAccessor<? super T> myAccessor;
|
||||
private final Project myProject;
|
||||
protected final TextComponentAccessor<? super T> myAccessor;
|
||||
protected final FileChooserDescriptor myFileChooserDescriptor;
|
||||
protected T myTextComponent;
|
||||
|
||||
protected T myTextComponent;
|
||||
private Project myProject;
|
||||
|
||||
public BrowseFolderRunnable(@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
@Nullable T component,
|
||||
@NotNull TextComponentAccessor<? super T> accessor) {
|
||||
if (fileChooserDescriptor != null && fileChooserDescriptor.isChooseMultiple()) {
|
||||
//LOG.error("multiple selection not supported");
|
||||
fileChooserDescriptor = new FileChooserDescriptor(fileChooserDescriptor) {
|
||||
@Override
|
||||
public boolean isChooseMultiple() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
public BrowseFolderRunnable(
|
||||
@Nullable Project project,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@Nullable T component,
|
||||
@NotNull TextComponentAccessor<? super T> accessor
|
||||
) {
|
||||
if (fileChooserDescriptor.isChooseMultiple()) {
|
||||
Logger.getInstance(BrowseFolderRunnable.class).warn("multiple selection not supported");
|
||||
}
|
||||
|
||||
myTitle = title;
|
||||
myDescription = description;
|
||||
myTextComponent = component;
|
||||
myProject = project;
|
||||
myFileChooserDescriptor = fileChooserDescriptor;
|
||||
myAccessor = accessor;
|
||||
}
|
||||
|
||||
protected @Nullable Project getProject() {
|
||||
return myProject;
|
||||
/**
|
||||
* @deprecated use {@link #BrowseFolderRunnable(Project, FileChooserDescriptor, JComponent, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public BrowseFolderRunnable(
|
||||
@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@Nullable T component,
|
||||
@NotNull TextComponentAccessor<? super T> accessor
|
||||
) {
|
||||
if (fileChooserDescriptor.isChooseMultiple()) {
|
||||
Logger.getInstance(BrowseFolderRunnable.class).error("multiple selection not supported");
|
||||
}
|
||||
if (title != null) {
|
||||
fileChooserDescriptor = fileChooserDescriptor.withTitle(title);
|
||||
}
|
||||
if (description != null) {
|
||||
fileChooserDescriptor = fileChooserDescriptor.withDescription(description);
|
||||
}
|
||||
myTextComponent = component;
|
||||
myProject = project;
|
||||
myFileChooserDescriptor = fileChooserDescriptor;
|
||||
myAccessor = accessor;
|
||||
}
|
||||
|
||||
protected void setProject(@Nullable Project project) {
|
||||
myProject = project;
|
||||
protected final @Nullable Project getProject() {
|
||||
return myProject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
FileChooserDescriptor fileChooserDescriptor = myFileChooserDescriptor;
|
||||
if (myTitle != null || myDescription != null) {
|
||||
fileChooserDescriptor = (FileChooserDescriptor)myFileChooserDescriptor.clone();
|
||||
if (myTitle != null) {
|
||||
fileChooserDescriptor.setTitle(myTitle);
|
||||
}
|
||||
if (myDescription != null) {
|
||||
fileChooserDescriptor.setDescription(myDescription);
|
||||
}
|
||||
}
|
||||
|
||||
chooseFile(fileChooserDescriptor);
|
||||
chooseFile(myFileChooserDescriptor);
|
||||
}
|
||||
|
||||
protected void chooseFile(FileChooserDescriptor descriptor) {
|
||||
@@ -80,29 +81,24 @@ public class BrowseFolderRunnable<T extends JComponent> implements Runnable {
|
||||
}
|
||||
|
||||
protected @Nullable VirtualFile getInitialFile() {
|
||||
@NonNls String directoryName = myAccessor.getText(myTextComponent).trim();
|
||||
if (StringUtil.isEmptyOrSpaces(directoryName)) {
|
||||
return null;
|
||||
}
|
||||
var directoryName = myAccessor.getText(myTextComponent).trim();
|
||||
if (directoryName.isBlank()) return null;
|
||||
|
||||
directoryName = FileUtil.toSystemIndependentName(directoryName);
|
||||
VirtualFile path = LocalFileSystem.getInstance().findFileByPath(expandPath(directoryName));
|
||||
while (path == null && directoryName.length() > 0) {
|
||||
int pos = directoryName.lastIndexOf('/');
|
||||
if (pos <= 0) break;
|
||||
directoryName = directoryName.substring(0, pos);
|
||||
path = LocalFileSystem.getInstance().findFileByPath(directoryName);
|
||||
var path = NioFiles.toPath(expandPath(directoryName));
|
||||
if (path == null || !path.isAbsolute()) return null;
|
||||
|
||||
while (path != null) {
|
||||
var result = LocalFileSystem.getInstance().findFileByNioFile(path);
|
||||
if (result != null) return result;
|
||||
path = path.getParent();
|
||||
}
|
||||
return path;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected @NotNull @NonNls String expandPath(@NotNull @NonNls String path) {
|
||||
protected @NotNull @NonNls String expandPath(@NotNull String path) {
|
||||
var descriptor = BrowseFolderDescriptor.asBrowseFolderDescriptor(myFileChooserDescriptor);
|
||||
var convertTextToPath = descriptor.getConvertTextToPath();
|
||||
if (convertTextToPath != null) {
|
||||
return convertTextToPath.invoke(path);
|
||||
}
|
||||
return path;
|
||||
return convertTextToPath != null ? convertTextToPath.invoke(path) : path;
|
||||
}
|
||||
|
||||
protected @NotNull @NlsSafe String chosenFileToResultingText(@NotNull VirtualFile chosenFile) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.icons.AllIcons;
|
||||
@@ -138,11 +138,8 @@ public class ComponentWithBrowseButton<Comp extends JComponent> extends JPanel i
|
||||
Dimension size = GuiUtils.getSizeByChars(charCount, comp);
|
||||
comp.setPreferredSize(size);
|
||||
Dimension preferredSize = myBrowseButton.getPreferredSize();
|
||||
|
||||
boolean keepHeight = UIUtil.isUnderWin10LookAndFeel();
|
||||
preferredSize.setSize(size.width + preferredSize.width + 2,
|
||||
keepHeight ? preferredSize.height : preferredSize.height + 2);
|
||||
|
||||
@SuppressWarnings("removal") boolean keepHeight = UIUtil.isUnderWin10LookAndFeel();
|
||||
preferredSize.setSize(size.width + preferredSize.width + 2, keepHeight ? preferredSize.height : preferredSize.height + 2);
|
||||
setPreferredSize(preferredSize);
|
||||
}
|
||||
|
||||
@@ -193,30 +190,49 @@ public class ComponentWithBrowseButton<Comp extends JComponent> extends JPanel i
|
||||
myBrowseButton.removeActionListener(listener);
|
||||
}
|
||||
|
||||
public void addBrowseFolderListener(@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super Comp> accessor) {
|
||||
addActionListener(new BrowseFolderActionListener<>(title, description, this, project, fileChooserDescriptor, accessor));
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super Comp> accessor
|
||||
) {
|
||||
addActionListener(new BrowseFolderActionListener<>(this, project, fileChooserDescriptor, accessor));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addBrowseFolderListener(String, String, Project, FileChooserDescriptor, TextComponentAccessor)} instead
|
||||
* @deprecated use {@link #addBrowseFolderListener(Project, FileChooserDescriptor, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated
|
||||
public void addBrowseFolderListener(@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super Comp> accessor, boolean autoRemoveOnHide) {
|
||||
@Deprecated(forRemoval = true)
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super Comp> accessor
|
||||
) {
|
||||
addBrowseFolderListener(project, fileChooserDescriptor.withTitle(title).withDescription(description), accessor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addBrowseFolderListener(Project, FileChooserDescriptor, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@SuppressWarnings("unused")
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super Comp> accessor,
|
||||
boolean autoRemoveOnHide
|
||||
) {
|
||||
addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addActionListener(ActionListener)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
/** @deprecated use {@link #addActionListener(ActionListener)} instead */
|
||||
@Deprecated(forRemoval = true)
|
||||
@SuppressWarnings("unused")
|
||||
public void addBrowseFolderListener(@Nullable Project project, final BrowseFolderActionListener<Comp> actionListener) {
|
||||
addActionListener(actionListener);
|
||||
}
|
||||
@@ -278,13 +294,29 @@ public class ComponentWithBrowseButton<Comp extends JComponent> extends JPanel i
|
||||
}
|
||||
|
||||
public static class BrowseFolderActionListener<T extends JComponent> extends BrowseFolderRunnable <T> implements ActionListener {
|
||||
public BrowseFolderActionListener(@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable ComponentWithBrowseButton<T> textField,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super T> accessor) {
|
||||
super(title, description, project, fileChooserDescriptor, textField != null ? textField.getChildComponent() : null, accessor);
|
||||
public BrowseFolderActionListener(
|
||||
@Nullable ComponentWithBrowseButton<T> textField,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super T> accessor
|
||||
) {
|
||||
super(project, fileChooserDescriptor, textField != null ? textField.getChildComponent() : null, accessor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #BrowseFolderActionListener(ComponentWithBrowseButton, Project, FileChooserDescriptor, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public BrowseFolderActionListener(
|
||||
@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable ComponentWithBrowseButton<T> textField,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super T> accessor
|
||||
) {
|
||||
this(textField, project, fileChooserDescriptor.withTitle(title).withDescription(description), accessor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
@@ -28,7 +14,7 @@ public class TextBrowseFolderListener extends ComponentWithBrowseButton.BrowseFo
|
||||
}
|
||||
|
||||
public TextBrowseFolderListener(@NotNull FileChooserDescriptor fileChooserDescriptor, @Nullable Project project) {
|
||||
super(null, null, null, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
super(null, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
}
|
||||
|
||||
void setOwnerComponent(@NotNull TextFieldWithBrowseButton component) {
|
||||
@@ -38,4 +24,4 @@ public class TextBrowseFolderListener extends ComponentWithBrowseButton.BrowseFo
|
||||
FileChooserDescriptor getFileChooserDescriptor() {
|
||||
return myFileChooserDescriptor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.ui;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -52,14 +52,25 @@ public class TextFieldWithBrowseButton extends ComponentWithBrowseButton<JTextFi
|
||||
this(new ExtendableTextField(10 /*to prevent infinite resize in grid-box layouts*/), browseActionListener, parent);
|
||||
}
|
||||
|
||||
public void addBrowseFolderListener(@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor) {
|
||||
addBrowseFolderListener(title, description, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
public void addBrowseFolderListener(@Nullable Project project, @NotNull FileChooserDescriptor fileChooserDescriptor) {
|
||||
addBrowseFolderListener(project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
installPathCompletion(fileChooserDescriptor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addBrowseFolderListener(Project, FileChooserDescriptor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable @NlsContexts.DialogTitle String title,
|
||||
@Nullable @NlsContexts.Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor
|
||||
) {
|
||||
addBrowseFolderListener(project, fileChooserDescriptor.withTitle(title).withDescription(description));
|
||||
}
|
||||
|
||||
public void addBrowseFolderListener(@NotNull TextBrowseFolderListener listener) {
|
||||
listener.setOwnerComponent(this);
|
||||
addActionListener(listener);
|
||||
|
||||
@@ -38,6 +38,6 @@ public class ComboboxWithBrowseButton extends ComponentWithBrowseButton<JComboBo
|
||||
}
|
||||
|
||||
public void addBrowseFolderListener(Project project, FileChooserDescriptor descriptor) {
|
||||
addBrowseFolderListener(null, null, project, descriptor, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
|
||||
addBrowseFolderListener(project, descriptor, TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -11,34 +11,56 @@ import com.intellij.openapi.util.Disposer;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static com.intellij.openapi.util.NlsContexts.DialogTitle;
|
||||
import static com.intellij.openapi.util.NlsContexts.Label;
|
||||
|
||||
public class TextFieldWithHistoryWithBrowseButton extends ComponentWithBrowseButton<TextFieldWithHistory> {
|
||||
private final Disposable myDisposable = Disposer.newDisposable();
|
||||
|
||||
public TextFieldWithHistoryWithBrowseButton() {
|
||||
super(new TextFieldWithHistory(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBrowseFolderListener(@Nullable @DialogTitle String title,
|
||||
@Nullable @Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super TextFieldWithHistory> accessor) {
|
||||
super.addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor);
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super TextFieldWithHistory> accessor
|
||||
) {
|
||||
super.addBrowseFolderListener(project, fileChooserDescriptor, accessor);
|
||||
FileChooserFactory.getInstance().installFileCompletion(getChildComponent().getTextEditor(), fileChooserDescriptor, false, myDisposable);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addBrowseFolderListener(Project, FileChooserDescriptor, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@Override
|
||||
public void addBrowseFolderListener(@Nullable @DialogTitle String title,
|
||||
@Nullable @Label String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super TextFieldWithHistory> accessor,
|
||||
boolean autoRemoveOnHide) {
|
||||
addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor);
|
||||
FileChooserFactory.getInstance().installFileCompletion(getChildComponent().getTextEditor(), fileChooserDescriptor, false, myDisposable);
|
||||
@SuppressWarnings("removal")
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable String title,
|
||||
@Nullable String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super TextFieldWithHistory> accessor
|
||||
) {
|
||||
super.addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #addBrowseFolderListener(Project, FileChooserDescriptor, TextComponentAccessor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public void addBrowseFolderListener(
|
||||
@Nullable String title,
|
||||
@Nullable String description,
|
||||
@Nullable Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor,
|
||||
TextComponentAccessor<? super TextFieldWithHistory> accessor,
|
||||
boolean autoRemoveOnHide
|
||||
) {
|
||||
super.addBrowseFolderListener(title, description, project, fileChooserDescriptor, accessor, autoRemoveOnHide);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19395,8 +19395,6 @@ c:com.intellij.platform.GeneratorPeerImpl
|
||||
- validate():com.intellij.openapi.ui.ValidationInfo
|
||||
com.intellij.platform.HideableProjectGenerator
|
||||
- a:isHidden():Z
|
||||
f:com.intellij.platform.LocationNameFieldsBinding
|
||||
- <init>(com.intellij.openapi.project.Project,com.intellij.openapi.ui.TextFieldWithBrowseButton,javax.swing.JTextField,java.lang.String,java.lang.String):V
|
||||
f:com.intellij.platform.PlatformProjectOpenProcessor
|
||||
- com.intellij.projectImport.ProjectOpenProcessor
|
||||
- com.intellij.platform.CommandLineProjectOpenProcessor
|
||||
@@ -23358,25 +23356,28 @@ f:com.intellij.ui.components.ComponentsKt
|
||||
- sf:htmlComponent(java.lang.String,java.awt.Font,java.awt.Color,java.awt.Color,Z):javax.swing.JEditorPane
|
||||
- sf:htmlComponent(java.lang.String,java.awt.Font,java.awt.Color,java.awt.Color,Z,javax.swing.event.HyperlinkListener):javax.swing.JEditorPane
|
||||
- bs:htmlComponent$default(java.lang.String,java.awt.Font,java.awt.Color,java.awt.Color,Z,javax.swing.event.HyperlinkListener,I,java.lang.Object):javax.swing.JEditorPane
|
||||
- sf:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- sf:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,java.lang.String,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- sf:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,java.lang.String,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,kotlin.jvm.functions.Function1):V
|
||||
- bs:installFileCompletionAndBrowseDialog$default(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,java.lang.String,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,kotlin.jvm.functions.Function1,I,java.lang.Object):V
|
||||
- sf:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor):V
|
||||
- sf:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,kotlin.jvm.functions.Function1):V
|
||||
- bs:installFileCompletionAndBrowseDialog$default(com.intellij.openapi.project.Project,com.intellij.openapi.ui.ComponentWithBrowseButton,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.ui.TextComponentAccessor,kotlin.jvm.functions.Function1,I,java.lang.Object):V
|
||||
- sf:noteComponent(java.lang.String):javax.swing.JComponent
|
||||
- sf:noteComponent(java.lang.String,kotlin.jvm.functions.Function1):javax.swing.JComponent
|
||||
- bs:noteComponent$default(java.lang.String,kotlin.jvm.functions.Function1,I,java.lang.Object):javax.swing.JComponent
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithBrowseButton(com.intellij.openapi.project.Project,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.openapi.project.Project,java.lang.String,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.openapi.project.Project,java.lang.String,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.openapi.project.Project,javax.swing.JTextField,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.openapi.ui.TextFieldWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0,kotlin.jvm.functions.Function1):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- sf:textFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0,kotlin.jvm.functions.Function1):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- bs:textFieldWithHistoryWithBrowseButton$default(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- bs:textFieldWithHistoryWithBrowseButton$default(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function0,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
*f:com.intellij.ui.components.DarculaSearchBorder
|
||||
- com.intellij.ide.ui.laf.darcula.ui.DarculaTextBorder
|
||||
@@ -24037,8 +24038,14 @@ com.intellij.ui.dsl.builder.Row
|
||||
- bs:text$default(com.intellij.ui.dsl.builder.Row,java.lang.String,I,com.intellij.ui.dsl.builder.HyperlinkEventAction,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- a:textArea():com.intellij.ui.dsl.builder.Cell
|
||||
- a:textField():com.intellij.ui.dsl.builder.Cell
|
||||
- a:textFieldWithBrowseButton(java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- a:textFieldWithBrowseButton(com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- textFieldWithBrowseButton(com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- textFieldWithBrowseButton(java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- textFieldWithBrowseButton(java.lang.String,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- a:threeStateCheckBox(java.lang.String):com.intellij.ui.dsl.builder.Cell
|
||||
- a:topGap(com.intellij.ui.dsl.builder.TopGap):com.intellij.ui.dsl.builder.Row
|
||||
- a:visible(Z):com.intellij.ui.dsl.builder.Row
|
||||
@@ -24061,7 +24068,13 @@ Ff:com.intellij.ui.dsl.builder.Row$DefaultImpls
|
||||
- bs:spinner$default(com.intellij.ui.dsl.builder.Row,kotlin.ranges.ClosedRange,D,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:spinner$default(com.intellij.ui.dsl.builder.Row,kotlin.ranges.IntRange,I,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:text$default(com.intellij.ui.dsl.builder.Row,java.lang.String,I,com.intellij.ui.dsl.builder.HyperlinkEventAction,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- s:textFieldWithBrowseButton(com.intellij.ui.dsl.builder.Row,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- s:textFieldWithBrowseButton(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- s:textFieldWithBrowseButton(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
- bs:textFieldWithBrowseButton$default(com.intellij.ui.dsl.builder.Row,java.lang.String,com.intellij.openapi.project.Project,kotlin.jvm.functions.Function1,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell
|
||||
e:com.intellij.ui.dsl.builder.RowLayout
|
||||
- java.lang.Enum
|
||||
- sf:INDEPENDENT:com.intellij.ui.dsl.builder.RowLayout
|
||||
@@ -26429,11 +26442,14 @@ f:com.intellij.util.ui.SwingHelper
|
||||
- s:buildHtml(java.lang.String,java.lang.String):java.lang.String
|
||||
- s:createHtmlLabel(java.lang.String,java.lang.String,com.intellij.util.Consumer):javax.swing.JEditorPane
|
||||
- s:createHtmlViewer(Z,java.awt.Font,java.awt.Color,java.awt.Color):javax.swing.JEditorPane
|
||||
- s:createTextFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,com.intellij.openapi.fileChooser.FileChooserDescriptor,java.util.function.Supplier):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- s:createTextFieldWithHistoryWithBrowseButton(com.intellij.openapi.project.Project,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor,com.intellij.util.NotNullProducer):com.intellij.ui.TextFieldWithHistoryWithBrowseButton
|
||||
- s:createWebHyperlink(java.lang.String):com.intellij.ui.HyperlinkLabel
|
||||
- s:createWebHyperlink(java.lang.String,java.lang.String):com.intellij.ui.HyperlinkLabel
|
||||
- s:getComponentFromRecentMouseEvent():java.awt.Component
|
||||
- s:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.TextFieldWithBrowseButton,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- s:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.openapi.ui.TextFieldWithBrowseButton,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- s:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.ui.TextFieldWithHistoryWithBrowseButton,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- s:installFileCompletionAndBrowseDialog(com.intellij.openapi.project.Project,com.intellij.ui.TextFieldWithHistoryWithBrowseButton,java.lang.String,com.intellij.openapi.fileChooser.FileChooserDescriptor):V
|
||||
- s:newHorizontalPanel(F,java.awt.Component[]):javax.swing.JPanel
|
||||
- s:newLeftAlignedVerticalPanel(java.util.Collection):javax.swing.JPanel
|
||||
|
||||
@@ -40,22 +40,22 @@ public final class PathMacroEditor extends DialogWrapper {
|
||||
};
|
||||
myNameField.getDocument().addDocumentListener(documentListener);
|
||||
myValueField.setText(value);
|
||||
myValueField.addBrowseFolderListener(null, null, null, new FileChooserDescriptor(false, true, true, false, true, false),
|
||||
new TextComponentAccessor<>() {
|
||||
@Override
|
||||
public String getText(JTextField component) {
|
||||
return component.getText();
|
||||
}
|
||||
var descriptor = new FileChooserDescriptor(false, true, true, false, true, false);
|
||||
myValueField.addBrowseFolderListener(null, descriptor, new TextComponentAccessor<>() {
|
||||
@Override
|
||||
public String getText(JTextField component) {
|
||||
return component.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText(JTextField component, @NotNull String text) {
|
||||
final int len = text.length();
|
||||
if (len > 0 && text.charAt(len - 1) == File.separatorChar) {
|
||||
text = text.substring(0, len - 1);
|
||||
}
|
||||
component.setText(text);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void setText(JTextField component, @NotNull String text) {
|
||||
final int len = text.length();
|
||||
if (len > 0 && text.charAt(len - 1) == File.separatorChar) {
|
||||
text = text.substring(0, len - 1);
|
||||
}
|
||||
component.setText(text);
|
||||
}
|
||||
});
|
||||
myValueField.getTextField().getDocument().addDocumentListener(documentListener);
|
||||
|
||||
init();
|
||||
@@ -117,4 +117,4 @@ public final class PathMacroEditor extends DialogWrapper {
|
||||
protected JComponent createCenterPanel() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.browsers
|
||||
|
||||
import com.intellij.ide.GeneralLocalSettings
|
||||
@@ -137,7 +137,7 @@ internal class BrowserSettingsPanel {
|
||||
}
|
||||
}.component
|
||||
alternativeBrowserPathField = cell(TextFieldWithBrowseButton()).applyToComponent {
|
||||
addBrowseFolderListener(IdeBundle.message("title.select.path.to.browser"), null, null, APP_FILE_CHOOSER_DESCRIPTOR)
|
||||
addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor().withTitle(IdeBundle.message("title.select.path.to.browser")))
|
||||
}.align(AlignX.FILL)
|
||||
.component
|
||||
}
|
||||
@@ -252,7 +252,6 @@ internal class BrowserSettingsPanel {
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val APP_FILE_CHOOSER_DESCRIPTOR = FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor()
|
||||
private val PATH_COLUMN_INFO: EditableColumnInfo<ConfigurableWebBrowser, String> = object : EditableColumnInfo<ConfigurableWebBrowser, String>(
|
||||
IdeBundle.message("settings.browsers.column.path")) {
|
||||
override fun valueOf(item: ConfigurableWebBrowser): String? {
|
||||
@@ -264,7 +263,7 @@ internal class BrowserSettingsPanel {
|
||||
}
|
||||
|
||||
override fun getEditor(item: ConfigurableWebBrowser): TableCellEditor? {
|
||||
return LocalPathCellEditor().fileChooserDescriptor(APP_FILE_CHOOSER_DESCRIPTOR).normalizePath(true)
|
||||
return LocalPathCellEditor().fileChooserDescriptor(FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor()).normalizePath(true)
|
||||
}
|
||||
}
|
||||
private val ACTIVE_COLUMN_INFO: EditableColumnInfo<ConfigurableWebBrowser, Boolean> = object : EditableColumnInfo<ConfigurableWebBrowser, Boolean>() {
|
||||
@@ -328,4 +327,4 @@ internal class BrowserSettingsPanel {
|
||||
// if system default browser policy cannot be used
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.impl
|
||||
|
||||
import com.intellij.ide.IdeBundle
|
||||
@@ -80,8 +80,7 @@ class TrustedHostsConfigurable : BoundConfigurable(IdeBundle.message("configurab
|
||||
private fun getPathFromUser(parent: Component): String? {
|
||||
val pathField = TextFieldWithBrowseButton(null, disposable)
|
||||
pathField.textField.columns = Messages.InputDialog.INPUT_DIALOG_COLUMNS
|
||||
pathField.addBrowseFolderListener(IdeBundle.message("trusted.hosts.settings.new.trusted.folder.file.chooser.title"), null, null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor())
|
||||
pathField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(IdeBundle.message("trusted.hosts.settings.new.trusted.folder.file.chooser.title")))
|
||||
val ok = DialogBuilder(parent)
|
||||
.title(IdeBundle.message("trusted.hosts.settings.new.trusted.folder.dialog.title"))
|
||||
.setNorthPanel(pathField)
|
||||
@@ -100,4 +99,4 @@ class TrustedHostsConfigurable : BoundConfigurable(IdeBundle.message("configurab
|
||||
@ApiStatus.Internal
|
||||
interface TrustedHostsConfigurableProvider {
|
||||
fun buildContent(panel: Panel)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ide.wizard
|
||||
|
||||
import com.intellij.ide.IdeBundle
|
||||
import com.intellij.ide.IdeBundle.message
|
||||
import com.intellij.ide.projectWizard.NewProjectWizardCollector.Base.logLocationChanged
|
||||
import com.intellij.ide.projectWizard.NewProjectWizardCollector.Base.logNameChanged
|
||||
import com.intellij.ide.util.installNameGenerators
|
||||
@@ -113,11 +113,11 @@ class NewProjectWizardBaseStep(parent: NewProjectWizardStep) : AbstractNewProjec
|
||||
|
||||
val locationRow = row(UIBundle.message("label.project.wizard.new.project.location")) {
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
.withTitle(message("title.select.project.file.directory", context.presentationName))
|
||||
.withFileFilter { it.isDirectory }
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
val title = IdeBundle.message("title.select.project.file.directory", context.presentationName)
|
||||
textFieldWithBrowseButton(title, context.project, fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(fileChooserDescriptor, context.project)
|
||||
.bindText(pathProperty.toUiPathProperty())
|
||||
.align(AlignX.FILL)
|
||||
.trimmedTextValidation(CHECK_NON_EMPTY, CHECK_DIRECTORY)
|
||||
@@ -195,4 +195,4 @@ class NewProjectWizardBaseStep(parent: NewProjectWizardStep) : AbstractNewProjec
|
||||
|
||||
fun newProjectWizardBaseStepWithoutGap(parent: NewProjectWizardStep): NewProjectWizardBaseStep {
|
||||
return NewProjectWizardBaseStep(parent).apply { bottomGap = false }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal
|
||||
|
||||
import com.intellij.ide.util.BrowseFilesListener
|
||||
import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory.createSingleLocalFileDescriptor
|
||||
import com.intellij.openapi.fileChooser.FileChooserFactory
|
||||
import com.intellij.openapi.fileChooser.FileTextField
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
@@ -75,10 +75,9 @@ internal class ShowUpdateInfoDialogAction : DumbAwareAction() {
|
||||
textArea.wrapStyleWord = true
|
||||
textArea.lineWrap = true
|
||||
|
||||
fileField = FileChooserFactory.getInstance().createFileTextField(BrowseFilesListener.SINGLE_FILE_DESCRIPTOR, disposable)
|
||||
fileField = FileChooserFactory.getInstance().createFileTextField(FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), disposable)
|
||||
val fileCombo = TextFieldWithBrowseButton(fileField.field)
|
||||
val fileDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
fileCombo.addBrowseFolderListener("Patch File", "Patch file", project, fileDescriptor)
|
||||
fileCombo.addBrowseFolderListener(project, createSingleLocalFileDescriptor().withTitle("Patch File").withDescription("Patch file"))
|
||||
|
||||
val panel = JPanel(BorderLayout(0, JBUI.scale(10)))
|
||||
panel.add(ScrollPaneFactory.createScrollPane(textArea), BorderLayout.CENTER)
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.intellij.openapi.actionSystem.ActionUpdateThread
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.application.PluginAutoUpdateRepository.PluginUpdateInfo
|
||||
import com.intellij.openapi.application.PluginAutoUpdateRepository.PluginUpdatesData
|
||||
import com.intellij.openapi.application.PluginAutoUpdateRepository.getAutoUpdateDirPath
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.components.service
|
||||
@@ -40,14 +39,10 @@ import org.jetbrains.annotations.ApiStatus
|
||||
import java.awt.Dimension
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.Collections
|
||||
import java.util.*
|
||||
import javax.swing.JComponent
|
||||
import kotlin.Result
|
||||
import kotlin.io.path.absolutePathString
|
||||
import kotlin.io.path.deleteExisting
|
||||
import kotlin.io.path.exists
|
||||
import kotlin.io.path.isReadable
|
||||
import kotlin.io.path.isRegularFile
|
||||
import kotlin.io.path.*
|
||||
|
||||
@ApiStatus.Internal
|
||||
object PluginAutoUpdateRepository {
|
||||
@@ -204,7 +199,8 @@ private class PluginsAutoUpdateRepositoryViewAction : AnAction() {
|
||||
it?.name ?: it?.pluginId?.idString ?: "<unnamed plugin>"
|
||||
})
|
||||
ComboboxSpeedSearch.installOn(pluginCombobox.component)
|
||||
val updateChooser = textFieldWithBrowseButton("Select Update File", project, FileChooserDescriptorFactory.createSingleFileDescriptor())
|
||||
val descriptor = FileChooserDescriptorFactory.createSingleFileDescriptor().withTitle("Select Update File")
|
||||
val updateChooser = textFieldWithBrowseButton(descriptor, project)
|
||||
button("Add") {
|
||||
val selectedPlugin = pluginCombobox.component.selectedItem as? IdeaPluginDescriptorImpl ?: return@button
|
||||
val updateFilePath = updateChooser.component.text
|
||||
@@ -219,4 +215,4 @@ private class PluginsAutoUpdateRepositoryViewAction : AnAction() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,138 +0,0 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.ComponentWithBrowseButton.BrowseFolderActionListener;
|
||||
import com.intellij.openapi.ui.TextComponentAccessor;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.util.NlsContexts;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.DocumentAdapter;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.text.AttributeSet;
|
||||
import javax.swing.text.BadLocationException;
|
||||
import javax.swing.text.PlainDocument;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Logic for updating 2 fields: name for new directory and it's base location
|
||||
*
|
||||
* @author catherine
|
||||
*/
|
||||
public final class LocationNameFieldsBinding {
|
||||
private boolean myModifyingLocation = false;
|
||||
private boolean myModifyingProjectName = false;
|
||||
private boolean myExternalModify = false;
|
||||
private String myBaseDir;
|
||||
private final String mySuggestedProjectName;
|
||||
|
||||
public LocationNameFieldsBinding(@Nullable Project project,
|
||||
final TextFieldWithBrowseButton locationField,
|
||||
final JTextField nameField,
|
||||
String baseDir,
|
||||
@NlsContexts.DialogTitle String title) {
|
||||
myBaseDir = baseDir;
|
||||
File suggestedProjectDirectory = FileUtil.findSequentNonexistentFile(new File(baseDir), "untitled", "");
|
||||
locationField.setText(suggestedProjectDirectory.getPath());
|
||||
nameField.setDocument(new NameFieldDocument(nameField, locationField));
|
||||
mySuggestedProjectName = suggestedProjectDirectory.getName();
|
||||
nameField.setText(mySuggestedProjectName);
|
||||
nameField.selectAll();
|
||||
|
||||
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
BrowseFolderActionListener<JTextField> listener =
|
||||
new BrowseFolderActionListener<>(title, "", locationField, project, descriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
|
||||
@Override
|
||||
protected void onFileChosen(@NotNull VirtualFile chosenFile) {
|
||||
myBaseDir = chosenFile.getPath();
|
||||
if (isProjectNameChanged(nameField.getText()) && !nameField.getText().equals(chosenFile.getName())) {
|
||||
myExternalModify = true;
|
||||
locationField.setText(new File(chosenFile.getPath(), nameField.getText()).getPath());
|
||||
myExternalModify = false;
|
||||
}
|
||||
else {
|
||||
myExternalModify = true;
|
||||
locationField.setText(chosenFile.getPath());
|
||||
nameField.setText(chosenFile.getName());
|
||||
myExternalModify = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
locationField.addActionListener(listener);
|
||||
locationField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
if (myExternalModify) {
|
||||
return;
|
||||
}
|
||||
myModifyingLocation = true;
|
||||
String path = locationField.getText().trim();
|
||||
path = StringUtil.trimEnd(path, File.separator);
|
||||
int ind = path.lastIndexOf(File.separator);
|
||||
if (ind != -1) {
|
||||
String projectName = path.substring(ind + 1);
|
||||
if (!nameField.getText().trim().isEmpty()) {
|
||||
myBaseDir = path.substring(0, ind);
|
||||
}
|
||||
if (!projectName.equals(nameField.getText())) {
|
||||
if (!myModifyingProjectName) {
|
||||
nameField.setText(projectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
myModifyingLocation = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isProjectNameChanged(@NotNull String currentName) {
|
||||
return !currentName.equals(mySuggestedProjectName);
|
||||
}
|
||||
|
||||
private final class NameFieldDocument extends PlainDocument {
|
||||
NameFieldDocument(final JTextField projectNameTextField, final TextFieldWithBrowseButton locationField) {
|
||||
addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(final @NotNull DocumentEvent e) {
|
||||
if (!myModifyingLocation && !myExternalModify) {
|
||||
myModifyingProjectName = true;
|
||||
File f = new File(myBaseDir);
|
||||
locationField.setText(new File(f, projectNameTextField.getText()).getPath());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
|
||||
StringBuilder sb = null;
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
char c = str.charAt(i);
|
||||
boolean replace = c == '\\' || c == '/' || SystemInfo.isWindows && (c == '|' || c == ':');
|
||||
if (replace) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder(str.length());
|
||||
sb.append(str, 0, i);
|
||||
}
|
||||
sb.append('_');
|
||||
}
|
||||
else if (sb != null) {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
if (sb != null) {
|
||||
str = sb.toString();
|
||||
}
|
||||
super.insertString(offs, str, a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:Suppress("FunctionName")
|
||||
package com.intellij.ui.components
|
||||
|
||||
@@ -254,46 +254,41 @@ fun <T : JComponent> installFileCompletionAndBrowseDialog(
|
||||
project: Project?,
|
||||
component: ComponentWithBrowseButton<T>,
|
||||
textField: JTextField,
|
||||
@DialogTitle browseDialogTitle: String?,
|
||||
@Label browseDialogDescription: String? = null,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
textComponentAccessor: TextComponentAccessor<T>,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
) {
|
||||
if (ApplicationManager.getApplication() == null) {
|
||||
// tests
|
||||
return
|
||||
return // tests
|
||||
}
|
||||
|
||||
val browseFolderDescriptor = fileChooserDescriptor.asBrowseFolderDescriptor()
|
||||
if (fileChosen != null) {
|
||||
browseFolderDescriptor.convertFileToText = fileChosen
|
||||
}
|
||||
|
||||
component.addActionListener(
|
||||
BrowseFolderActionListener(
|
||||
browseDialogTitle,
|
||||
browseDialogDescription,
|
||||
component,
|
||||
project,
|
||||
browseFolderDescriptor,
|
||||
textComponentAccessor
|
||||
)
|
||||
)
|
||||
FileChooserFactory.getInstance().installFileCompletion(
|
||||
textField,
|
||||
fileChooserDescriptor,
|
||||
true,
|
||||
null /* infer disposable from UI context */
|
||||
)
|
||||
component.addActionListener(BrowseFolderActionListener(component, project, browseFolderDescriptor, textComponentAccessor))
|
||||
FileChooserFactory.getInstance().installFileCompletion(textField, fileChooserDescriptor, true, null /*infer disposable from context*/)
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
"Use `textFieldWithHistoryWithBrowseButton(Project, FileChooserDescriptor, () -> List<String>, (VirtualFile) -> String)` together with `FileChooserDescriptor#withTitle`",
|
||||
level = DeprecationLevel.ERROR
|
||||
)
|
||||
@JvmOverloads
|
||||
fun textFieldWithHistoryWithBrowseButton(project: Project?,
|
||||
@DialogTitle browseDialogTitle: String,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
historyProvider: (() -> List<String>)? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null): TextFieldWithHistoryWithBrowseButton {
|
||||
fun textFieldWithHistoryWithBrowseButton(
|
||||
project: Project?,
|
||||
@DialogTitle browseDialogTitle: String,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
historyProvider: (() -> List<String>)? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): TextFieldWithHistoryWithBrowseButton = textFieldWithHistoryWithBrowseButton(project, fileChooserDescriptor.withTitle(browseDialogTitle), historyProvider, fileChosen)
|
||||
|
||||
@JvmOverloads
|
||||
fun textFieldWithHistoryWithBrowseButton(
|
||||
project: Project?,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
historyProvider: (() -> List<String>)? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): TextFieldWithHistoryWithBrowseButton {
|
||||
val component = TextFieldWithHistoryWithBrowseButton()
|
||||
val textFieldWithHistory = component.childComponent
|
||||
textFieldWithHistory.setHistorySize(-1)
|
||||
@@ -301,67 +296,49 @@ fun textFieldWithHistoryWithBrowseButton(project: Project?,
|
||||
if (historyProvider != null) {
|
||||
addHistoryOnExpansion(textFieldWithHistory, historyProvider)
|
||||
}
|
||||
installFileCompletionAndBrowseDialog(
|
||||
project = project,
|
||||
component = component,
|
||||
textField = component.childComponent.textEditor,
|
||||
browseDialogTitle = browseDialogTitle,
|
||||
fileChooserDescriptor = fileChooserDescriptor,
|
||||
textComponentAccessor = TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT,
|
||||
fileChosen = fileChosen
|
||||
)
|
||||
val textField = component.childComponent.textEditor
|
||||
val textComponentAccessor = TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT
|
||||
installFileCompletionAndBrowseDialog(project, component, textField, fileChooserDescriptor, textComponentAccessor, fileChosen)
|
||||
return component
|
||||
}
|
||||
|
||||
@Deprecated(
|
||||
"Use `textFieldWithBrowseButton(Project, FileChooserDescriptor, (VirtualFile) -> String)` together with `FileChooserDescriptor#withTitle`",
|
||||
level = DeprecationLevel.ERROR
|
||||
)
|
||||
@JvmOverloads
|
||||
fun textFieldWithBrowseButton(project: Project?,
|
||||
@DialogTitle browseDialogTitle: String?,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null): TextFieldWithBrowseButton {
|
||||
fun textFieldWithBrowseButton(
|
||||
project: Project?,
|
||||
@DialogTitle browseDialogTitle: String?,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): TextFieldWithBrowseButton = textFieldWithBrowseButton(project, fileChooserDescriptor.withTitle(browseDialogTitle), fileChosen)
|
||||
|
||||
@JvmOverloads
|
||||
fun textFieldWithBrowseButton(
|
||||
project: Project?,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): TextFieldWithBrowseButton {
|
||||
val component = TextFieldWithBrowseButton()
|
||||
installFileCompletionAndBrowseDialog(
|
||||
project = project,
|
||||
component = component,
|
||||
textField = component.textField,
|
||||
browseDialogTitle = browseDialogTitle,
|
||||
fileChooserDescriptor = fileChooserDescriptor,
|
||||
textComponentAccessor = TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT,
|
||||
fileChosen = fileChosen
|
||||
)
|
||||
val textComponentAccessor = TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
|
||||
installFileCompletionAndBrowseDialog(project, component, component.textField, fileChooserDescriptor, textComponentAccessor, fileChosen)
|
||||
return component
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun textFieldWithBrowseButton(project: Project?,
|
||||
@DialogTitle browseDialogTitle: String?,
|
||||
textField: JTextField,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null): TextFieldWithBrowseButton {
|
||||
return textFieldWithBrowseButton(project, browseDialogTitle, null, textField, fileChooserDescriptor, fileChosen)
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun textFieldWithBrowseButton(project: Project?,
|
||||
@DialogTitle browseDialogTitle: String?,
|
||||
@Label browseDialogDescription: String?,
|
||||
textField: JTextField,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null): TextFieldWithBrowseButton {
|
||||
fun textFieldWithBrowseButton(
|
||||
project: Project?,
|
||||
textField: JTextField,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): TextFieldWithBrowseButton {
|
||||
val component = TextFieldWithBrowseButton(textField)
|
||||
installFileCompletionAndBrowseDialog(
|
||||
project = project,
|
||||
component = component,
|
||||
textField = component.textField,
|
||||
browseDialogTitle = browseDialogTitle,
|
||||
browseDialogDescription = browseDialogDescription,
|
||||
fileChooserDescriptor = fileChooserDescriptor,
|
||||
textComponentAccessor = TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT,
|
||||
fileChosen = fileChosen
|
||||
)
|
||||
val textComponentAccessor = TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
|
||||
installFileCompletionAndBrowseDialog(project, component, component.textField, fileChooserDescriptor, textComponentAccessor, fileChosen)
|
||||
return component
|
||||
}
|
||||
|
||||
|
||||
val JPasswordField.chars: CharSequence?
|
||||
get() {
|
||||
val doc = document
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui.dsl.builder
|
||||
|
||||
import com.intellij.icons.AllIcons
|
||||
@@ -94,7 +94,6 @@ enum class BottomGap {
|
||||
@LayoutDslMarker
|
||||
@JvmDefaultWithCompatibility
|
||||
interface Row {
|
||||
|
||||
/**
|
||||
* Layout of the row.
|
||||
* Default value is [RowLayout.LABEL_ALIGNED] when label is provided for the row, [RowLayout.INDEPENDENT] otherwise
|
||||
@@ -323,12 +322,43 @@ interface Row {
|
||||
/**
|
||||
* Creates text field with browse button and [columns] set to [COLUMNS_SHORT]
|
||||
*/
|
||||
fun textFieldWithBrowseButton(
|
||||
project: Project? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): Cell<TextFieldWithBrowseButton> =
|
||||
textFieldWithBrowseButton(FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(), project, fileChosen)
|
||||
|
||||
/**
|
||||
* Creates text field with browse button and [columns] set to [COLUMNS_SHORT]
|
||||
*/
|
||||
fun textFieldWithBrowseButton(
|
||||
browseDialogTitle: @NlsContexts.DialogTitle String,
|
||||
project: Project? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): Cell<TextFieldWithBrowseButton> =
|
||||
textFieldWithBrowseButton(FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withTitle(browseDialogTitle), project, fileChosen)
|
||||
|
||||
/**
|
||||
* Creates text field with browse button and [columns] set to [COLUMNS_SHORT]
|
||||
*/
|
||||
fun textFieldWithBrowseButton(
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
project: Project? = null,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): Cell<TextFieldWithBrowseButton>
|
||||
|
||||
@Deprecated(
|
||||
"Use [Row.textFieldWithBrowseButton(String, Project?, ((VirtualFile) -> String)?)] " +
|
||||
"or [Row.textFieldWithBrowseButton(FileChooserDescriptor, Project?, ((VirtualFile) -> String)?)] together with [FileChooserDescriptor.withTitle]",
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
fun textFieldWithBrowseButton(
|
||||
@NlsContexts.DialogTitle browseDialogTitle: String? = null,
|
||||
project: Project? = null,
|
||||
fileChooserDescriptor: FileChooserDescriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)? = null
|
||||
): Cell<TextFieldWithBrowseButton>
|
||||
): Cell<TextFieldWithBrowseButton> =
|
||||
textFieldWithBrowseButton(fileChooserDescriptor.withTitle(browseDialogTitle), project, fileChosen)
|
||||
|
||||
/**
|
||||
* Creates password field with [columns] set to [COLUMNS_SHORT]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.ui.dsl.builder.impl
|
||||
|
||||
import com.intellij.BundleBase
|
||||
@@ -301,11 +301,12 @@ internal open class RowImpl(private val dialogPanelConfig: DialogPanelConfig,
|
||||
return result
|
||||
}
|
||||
|
||||
override fun textFieldWithBrowseButton(browseDialogTitle: String?,
|
||||
project: Project?,
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)?): Cell<TextFieldWithBrowseButton> {
|
||||
val result = cell(textFieldWithBrowseButton(project, browseDialogTitle, fileChooserDescriptor, fileChosen)).applyToComponent {
|
||||
override fun textFieldWithBrowseButton(
|
||||
fileChooserDescriptor: FileChooserDescriptor,
|
||||
project: Project?,
|
||||
fileChosen: ((chosenFile: VirtualFile) -> String)?
|
||||
): Cell<TextFieldWithBrowseButton> {
|
||||
val result = cell(com.intellij.ui.components.textFieldWithBrowseButton(project, fileChooserDescriptor, fileChosen)).applyToComponent {
|
||||
isOpaque = false
|
||||
textField.isOpaque = false
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.ide.BrowserUtil;
|
||||
@@ -62,6 +62,7 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public final class SwingHelper {
|
||||
|
||||
@@ -385,41 +386,61 @@ public final class SwingHelper {
|
||||
}
|
||||
}
|
||||
|
||||
public static void installFileCompletionAndBrowseDialog(@Nullable Project project,
|
||||
@NotNull TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor) {
|
||||
doInstall(project,
|
||||
textFieldWithHistoryWithBrowseButton,
|
||||
textFieldWithHistoryWithBrowseButton.getChildComponent().getTextEditor(),
|
||||
browseDialogTitle,
|
||||
fileChooserDescriptor,
|
||||
TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
/**
|
||||
* @deprecated use {@link #installFileCompletionAndBrowseDialog(Project, TextFieldWithHistoryWithBrowseButton, FileChooserDescriptor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void installFileCompletionAndBrowseDialog(
|
||||
@Nullable Project project,
|
||||
@NotNull TextFieldWithHistoryWithBrowseButton textField,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor
|
||||
) {
|
||||
installFileCompletionAndBrowseDialog(project, textField, fileChooserDescriptor.withTitle(browseDialogTitle));
|
||||
}
|
||||
|
||||
public static void installFileCompletionAndBrowseDialog(@Nullable Project project,
|
||||
@NotNull TextFieldWithBrowseButton textFieldWithBrowseButton,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor) {
|
||||
doInstall(project,
|
||||
textFieldWithBrowseButton,
|
||||
textFieldWithBrowseButton.getTextField(),
|
||||
browseDialogTitle,
|
||||
fileChooserDescriptor,
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
public static void installFileCompletionAndBrowseDialog(
|
||||
@Nullable Project project,
|
||||
@NotNull TextFieldWithHistoryWithBrowseButton textField,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor
|
||||
) {
|
||||
doInstall(project, textField, textField.getChildComponent().getTextEditor(), fileChooserDescriptor, TextComponentAccessors.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);
|
||||
}
|
||||
|
||||
private static <T extends JComponent> void doInstall(@Nullable Project project,
|
||||
@NotNull ComponentWithBrowseButton<T> componentWithBrowseButton,
|
||||
@NotNull JTextField textField,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@NotNull TextComponentAccessor<T> textComponentAccessor) {
|
||||
/**
|
||||
* @deprecated use {@link #installFileCompletionAndBrowseDialog(Project, TextFieldWithBrowseButton, FileChooserDescriptor)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void installFileCompletionAndBrowseDialog(
|
||||
@Nullable Project project,
|
||||
@NotNull TextFieldWithBrowseButton textField,
|
||||
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor
|
||||
) {
|
||||
installFileCompletionAndBrowseDialog(project, textField, fileChooserDescriptor.withTitle(browseDialogTitle));
|
||||
}
|
||||
|
||||
public static void installFileCompletionAndBrowseDialog(
|
||||
@Nullable Project project,
|
||||
@NotNull TextFieldWithBrowseButton textField,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor
|
||||
) {
|
||||
doInstall(project, textField, textField.getTextField(), fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
}
|
||||
|
||||
private static <T extends JComponent> void doInstall(
|
||||
@Nullable Project project,
|
||||
@NotNull ComponentWithBrowseButton<T> componentWithBrowseButton,
|
||||
@NotNull JTextField textField,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@NotNull TextComponentAccessor<T> textComponentAccessor
|
||||
) {
|
||||
ComponentsKt.installFileCompletionAndBrowseDialog(
|
||||
project,
|
||||
componentWithBrowseButton,
|
||||
textField,
|
||||
browseDialogTitle,
|
||||
fileChooserDescriptor.withShowHiddenFiles(SystemInfo.isUnix),
|
||||
textComponentAccessor
|
||||
);
|
||||
@@ -640,11 +661,26 @@ public final class SwingHelper {
|
||||
).toString();
|
||||
}
|
||||
|
||||
public static @NotNull TextFieldWithHistoryWithBrowseButton createTextFieldWithHistoryWithBrowseButton(@Nullable Project project,
|
||||
@NotNull @NlsContexts.DialogTitle String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@Nullable NotNullProducer<? extends List<String>> historyProvider) {
|
||||
return ComponentsKt.textFieldWithHistoryWithBrowseButton(project, browseDialogTitle, fileChooserDescriptor, historyProvider == null ? null : () -> historyProvider.produce());
|
||||
/**
|
||||
* @deprecated use {@link #createTextFieldWithHistoryWithBrowseButton(Project, FileChooserDescriptor, Supplier)}
|
||||
* together with {@link FileChooserDescriptor#withTitle} and {@link FileChooserDescriptor#withDescription}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static @NotNull TextFieldWithHistoryWithBrowseButton createTextFieldWithHistoryWithBrowseButton(
|
||||
@Nullable Project project,
|
||||
@NotNull @NlsContexts.DialogTitle String browseDialogTitle,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@SuppressWarnings("UsagesOfObsoleteApi") @Nullable NotNullProducer<? extends List<String>> historyProvider
|
||||
) {
|
||||
return createTextFieldWithHistoryWithBrowseButton(project, fileChooserDescriptor.withTitle(browseDialogTitle), historyProvider);
|
||||
}
|
||||
|
||||
public static @NotNull TextFieldWithHistoryWithBrowseButton createTextFieldWithHistoryWithBrowseButton(
|
||||
@Nullable Project project,
|
||||
@NotNull FileChooserDescriptor fileChooserDescriptor,
|
||||
@Nullable Supplier<? extends List<String>> historyProvider
|
||||
) {
|
||||
return ComponentsKt.textFieldWithHistoryWithBrowseButton(project, fileChooserDescriptor, historyProvider != null ? () -> historyProvider.get() : null);
|
||||
}
|
||||
|
||||
public static @NotNull <C extends JComponent> ComponentWithBrowseButton<C> wrapWithInfoButton(final @NotNull C component,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.internal.statistic.devkit.actions
|
||||
|
||||
import com.intellij.internal.statistic.devkit.StatisticsDevKitUtil.getLogProvidersInTestMode
|
||||
@@ -48,8 +48,7 @@ class EventsSchemeConfigurationModel {
|
||||
}.layout(RowLayout.LABEL_ALIGNED)
|
||||
}
|
||||
|
||||
pathField.addBrowseFolderListener("Select Events Scheme Location ", null, null,
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor())
|
||||
pathField.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFileDescriptor().withTitle("Select Events Scheme Location"))
|
||||
|
||||
updatePanel()
|
||||
}
|
||||
@@ -136,4 +135,4 @@ class EventsSchemeConfigurationModel {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.structuralsearch.plugin.ui;
|
||||
|
||||
import com.intellij.find.FindBundle;
|
||||
@@ -80,7 +80,7 @@ public class DirectoryComboBoxWithButtons extends JPanel {
|
||||
}
|
||||
comboBox.setMaximumRowCount(8);
|
||||
|
||||
myDirectoryComboBox.addBrowseFolderListener(null, null, project, descriptor, new TextComponentAccessor<>() {
|
||||
myDirectoryComboBox.addBrowseFolderListener(project, descriptor, new TextComponentAccessor<>() {
|
||||
@Override
|
||||
public String getText(ComboBox comboBox) {
|
||||
return comboBox.getEditor().getItem().toString();
|
||||
@@ -176,4 +176,3 @@ public class DirectoryComboBoxWithButtons extends JPanel {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.testframework.export;
|
||||
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
@@ -57,18 +57,16 @@ public class ExportTestResultsForm {
|
||||
|
||||
myFileNameField.setText(defaultFileName);
|
||||
|
||||
myCustomTemplateField.addBrowseFolderListener(ExecutionBundle.message("export.test.results.custom.template.chooser.title"), null, null,
|
||||
new FileChooserDescriptor(true, false, false, false, false, false) {
|
||||
@Override
|
||||
public boolean isFileSelectable(@Nullable VirtualFile file) {
|
||||
return file != null &&
|
||||
("xsl".equalsIgnoreCase(file.getExtension()) || "xslt".equalsIgnoreCase(file.getExtension()));
|
||||
}
|
||||
}, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var templateDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
|
||||
@Override
|
||||
public boolean isFileSelectable(@Nullable VirtualFile file) {
|
||||
return file != null && ("xsl".equalsIgnoreCase(file.getExtension()) || "xslt".equalsIgnoreCase(file.getExtension()));
|
||||
}
|
||||
}.withTitle(ExecutionBundle.message("export.test.results.custom.template.chooser.title"));
|
||||
myCustomTemplateField.addBrowseFolderListener(null, templateDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
|
||||
myFolderField.addBrowseFolderListener(ExecutionBundle.message("export.test.results.output.folder.chooser.title"), null, null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(),
|
||||
TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
var outputDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(ExecutionBundle.message("export.test.results.output.folder.chooser.title"));
|
||||
myFolderField.addBrowseFolderListener(null, outputDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
|
||||
myFileNameField.getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.vcs.changes.patch;
|
||||
|
||||
import com.intellij.diff.DiffDialogHints;
|
||||
@@ -155,9 +155,6 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper {
|
||||
setVerticalStretch(2);
|
||||
setTitle(applyPatchMode.getTitle());
|
||||
|
||||
final FileChooserDescriptor descriptor = createSelectPatchDescriptor();
|
||||
descriptor.setTitle(VcsBundle.message("patch.apply.select.title"));
|
||||
|
||||
myProject = project;
|
||||
myPatches = new ArrayList<>();
|
||||
myRecentPathFileChange = new AtomicReference<>();
|
||||
@@ -197,7 +194,7 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper {
|
||||
myChangesTreeLoadingPanel.add(myChangesTreeList, BorderLayout.CENTER);
|
||||
myShouldUpdateChangeListName = defaultList == null && externalCommitMessage == null;
|
||||
myPatchFile = new TextFieldWithBrowseButton();
|
||||
myPatchFile.addBrowseFolderListener(VcsBundle.message("patch.apply.select.title"), "", project, descriptor);
|
||||
myPatchFile.addBrowseFolderListener(project, createSelectPatchDescriptor().withTitle(VcsBundle.message("patch.apply.select.title")));
|
||||
myPatchFile.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.vcs.configurable;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
@@ -53,10 +53,9 @@ public class ShelfStorageConfigurationDialog extends DialogWrapper {
|
||||
}
|
||||
myUseDefaultShelfDirectory = new JBRadioButton(VcsBundle.message("change.shelves.location.dialog.default.label"), true);
|
||||
myShelfDirectoryPath = new TextFieldWithBrowseButton();
|
||||
myShelfDirectoryPath.addBrowseFolderListener(VcsBundle.message("shelf.tab"),
|
||||
VcsBundle.message("change.shelves.location.dialog.location.browser.title"),
|
||||
myProject,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myShelfDirectoryPath.addBrowseFolderListener(myProject, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(VcsBundle.message("shelf.tab"))
|
||||
.withDescription(VcsBundle.message("change.shelves.location.dialog.location.browser.title")));
|
||||
myMoveShelvesCheckBox = new JBCheckBox(VcsBundle.message("vcs.shelf.move.text"));
|
||||
setOKButtonText(VcsBundle.message("change.shelves.location.dialog.action.button"));
|
||||
initComponents();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.vcs.configurable;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
@@ -36,7 +35,7 @@ import static com.intellij.util.containers.UtilKt.getIfSingle;
|
||||
import static com.intellij.xml.util.XmlStringUtil.wrapInHtml;
|
||||
|
||||
public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
@NotNull private final Project myProject;
|
||||
private final @NotNull Project myProject;
|
||||
private ComboBox<AbstractVcs> myVCSComboBox;
|
||||
private TextFieldWithBrowseButton myDirectoryTextField;
|
||||
private JPanel myPanel;
|
||||
@@ -53,12 +52,10 @@ public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
super(project, false);
|
||||
myProject = project;
|
||||
myVcsManager = ProjectLevelVcsManager.getInstance(myProject);
|
||||
myDirectoryTextField.addActionListener(
|
||||
new MyBrowseFolderListener(VcsBundle.message("settings.vcs.mapping.browser.select.directory.title"),
|
||||
VcsBundle.message("settings.vcs.mapping.browser.select.directory.description"),
|
||||
myDirectoryTextField,
|
||||
project,
|
||||
createSingleFolderDescriptor()));
|
||||
var descriptor = createSingleFolderDescriptor()
|
||||
.withTitle(VcsBundle.message("settings.vcs.mapping.browser.select.directory.title"))
|
||||
.withDescription(VcsBundle.message("settings.vcs.mapping.browser.select.directory.description"));
|
||||
myDirectoryTextField.addActionListener(new MyBrowseFolderListener(myDirectoryTextField, project, descriptor));
|
||||
setMapping(suggestDefaultMapping(project));
|
||||
initProjectMessage();
|
||||
setTitle(title);
|
||||
@@ -66,8 +63,7 @@ public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
myVCSComboBox.addActionListener(e -> updateVcsConfigurable());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static VcsDirectoryMapping suggestDefaultMapping(@NotNull Project project) {
|
||||
private static @NotNull VcsDirectoryMapping suggestDefaultMapping(@NotNull Project project) {
|
||||
AbstractVcs[] vcses = ProjectLevelVcsManager.getInstance(project).getAllSupportedVcss();
|
||||
ContainerUtil.sort(vcses, SuggestedVcsComparator.create(project));
|
||||
String defaultVcsName = vcses.length > 0 ? vcses[0].getName() : "";
|
||||
@@ -93,8 +89,7 @@ public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
myDirectoryTextField.setEnabled(myDirectoryRadioButton.isSelected());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public VcsDirectoryMapping getMapping() {
|
||||
public @NotNull VcsDirectoryMapping getMapping() {
|
||||
AbstractVcs vcs = myVCSComboBox.getItem();
|
||||
String vcsName = vcs != null ? vcs.getName() : "";
|
||||
String directory = myProjectRadioButton.isSelected() ? "" : toSystemIndependentName(myDirectoryTextField.getText());
|
||||
@@ -151,13 +146,8 @@ public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
private class MyBrowseFolderListener extends ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> {
|
||||
|
||||
MyBrowseFolderListener(@NlsContexts.DialogTitle String title,
|
||||
@NlsContexts.Label String description,
|
||||
TextFieldWithBrowseButton textField,
|
||||
Project project,
|
||||
FileChooserDescriptor fileChooserDescriptor) {
|
||||
super(title, description, textField, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
MyBrowseFolderListener(TextFieldWithBrowseButton textField, Project project, FileChooserDescriptor fileChooserDescriptor) {
|
||||
super(textField, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,7 +164,7 @@ public class VcsMappingConfigurationDialog extends DialogWrapper {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFileChosen(@NotNull final VirtualFile chosenFile) {
|
||||
protected void onFileChosen(final @NotNull VirtualFile chosenFile) {
|
||||
String oldText = myDirectoryTextField.getText();
|
||||
super.onFileChosen(chosenFile);
|
||||
AbstractVcs vcs = myVCSComboBox.getItem();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.util.ui;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -38,11 +38,8 @@ public class VcsExecutablePathSelector {
|
||||
BorderLayoutPanel panel = JBUI.Panels.simplePanel(UIUtil.DEFAULT_HGAP, 0);
|
||||
|
||||
myPathSelector = new TextFieldWithBrowseButton(null, disposable);
|
||||
myPathSelector.addBrowseFolderListener(VcsBundle.message("executable.select.title"),
|
||||
null,
|
||||
null,
|
||||
FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor(),
|
||||
new MyTextComponentAccessor(handler));
|
||||
var descriptor = FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withTitle(VcsBundle.message("executable.select.title"));
|
||||
myPathSelector.addBrowseFolderListener(null, descriptor, new MyTextComponentAccessor(handler));
|
||||
myPathSelector.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
|
||||
@Override
|
||||
protected void textChanged(@NotNull DocumentEvent e) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.devkit.actions.updateFromSources
|
||||
|
||||
import com.intellij.CommonBundle
|
||||
@@ -90,8 +90,10 @@ class UpdateFromSourcesDialog(private val project: Project,
|
||||
|
||||
internal fun Panel.optionsPanel(project: Project, state: UpdateFromSourcesSettingsState): TextFieldWithHistoryWithBrowseButton {
|
||||
val pathField = textFieldWithHistoryWithBrowseButton(
|
||||
project, DevKitBundle.message("action.UpdateIdeFromSourcesAction.settings.installation.choose.ide.directory.title"),
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor(), { state.workIdePathsHistory })
|
||||
project,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor().withTitle(DevKitBundle.message("action.UpdateIdeFromSourcesAction.settings.installation.choose.ide.directory.title")),
|
||||
historyProvider = { state.workIdePathsHistory }
|
||||
)
|
||||
row(DevKitBundle.message("action.UpdateIdeFromSourcesAction.settings.row.ide.installation")) {
|
||||
cell(pathField)
|
||||
.align(AlignX.FILL)
|
||||
@@ -102,4 +104,4 @@ internal fun Panel.optionsPanel(project: Project, state: UpdateFromSourcesSettin
|
||||
.bindSelected({ !state.buildDisabledPlugins }, { state.buildDisabledPlugins = !it })
|
||||
}
|
||||
return pathField
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.devkit.build;
|
||||
|
||||
import com.intellij.ide.util.BrowseFilesListener;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleConfigurationEditor;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
@@ -28,29 +15,24 @@ import com.intellij.openapi.util.Comparing;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.ui.IdeBorderFactory;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.idea.devkit.DevKitBundle;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.File;
|
||||
|
||||
public class PluginModuleBuildConfEditor implements ModuleConfigurationEditor {
|
||||
private final JPanel myWholePanel = new JPanel(new GridBagLayout());
|
||||
@NonNls private final JLabel myPluginXMLLabel = new JLabel(DevKitBundle.message("deployment.view.meta-inf.label", "META-INF" + File.separator + "plugin.xml:"));
|
||||
private final TextFieldWithBrowseButton myPluginXML = new TextFieldWithBrowseButton();
|
||||
private static final String META_INF = "META-INF";
|
||||
private static final String PLUGIN_XML = "plugin.xml";
|
||||
private static final String MANIFEST_MF = "manifest.mf";
|
||||
|
||||
private final JPanel myWholePanel = new JPanel(new GridBagLayout());
|
||||
private final JLabel myPluginXMLLabel = new JLabel(DevKitBundle.message("deployment.view.meta-inf.label", "META-INF" + File.separator + "plugin.xml:"));
|
||||
private final TextFieldWithBrowseButton myPluginXML = new TextFieldWithBrowseButton();
|
||||
private final TextFieldWithBrowseButton myManifest = new TextFieldWithBrowseButton();
|
||||
private final JCheckBox myUseUserManifest = new JCheckBox(DevKitBundle.message("manifest.use.user.defined"));
|
||||
|
||||
private final PluginBuildConfiguration myBuildProperties;
|
||||
|
||||
private final Module myModule;
|
||||
@NonNls private static final String META_INF = "META-INF";
|
||||
@NonNls private static final String PLUGIN_XML = "plugin.xml";
|
||||
@NonNls private static final String MANIFEST_MF = "manifest.mf";
|
||||
|
||||
public PluginModuleBuildConfEditor(ModuleConfigurationState state) {
|
||||
myModule = state.getCurrentRootModel().getModule();
|
||||
@@ -59,17 +41,14 @@ public class PluginModuleBuildConfEditor implements ModuleConfigurationEditor {
|
||||
|
||||
@Override
|
||||
public JComponent createComponent() {
|
||||
myPluginXML.addActionListener(new BrowseFilesListener(myPluginXML.getTextField(), DevKitBundle.message("deployment.directory.location", META_INF), DevKitBundle.message("saved.message.common", META_INF + File.separator + PLUGIN_XML), BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR));
|
||||
myManifest.addActionListener(new BrowseFilesListener(myManifest.getTextField(), DevKitBundle.message("deployment.view.select", MANIFEST_MF), DevKitBundle.message("manifest.selection", MANIFEST_MF), BrowseFilesListener.SINGLE_FILE_DESCRIPTOR));
|
||||
myPluginXML.addActionListener(new BrowseFilesListener(myPluginXML.getTextField(), FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(DevKitBundle.message("deployment.directory.location", META_INF))
|
||||
.withDescription(DevKitBundle.message("saved.message.common", META_INF + File.separator + PLUGIN_XML))));
|
||||
myManifest.addActionListener(new BrowseFilesListener(myManifest.getTextField(), FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor()
|
||||
.withTitle(DevKitBundle.message("deployment.view.select", MANIFEST_MF))
|
||||
.withDescription(DevKitBundle.message("manifest.selection", MANIFEST_MF))));
|
||||
myManifest.setEnabled(myBuildProperties.isUseUserManifest());
|
||||
myUseUserManifest.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final boolean selected = myUseUserManifest.isSelected();
|
||||
|
||||
myManifest.setEnabled(selected);
|
||||
}
|
||||
});
|
||||
myUseUserManifest.addActionListener(e -> myManifest.setEnabled(myUseUserManifest.isSelected()));
|
||||
final GridBagConstraints gc = new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST,
|
||||
GridBagConstraints.HORIZONTAL, JBUI.insets(2), 0, 0);
|
||||
myWholePanel.add(myPluginXMLLabel, gc);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.eclipse.export;
|
||||
|
||||
import com.intellij.ide.util.ElementsChooser;
|
||||
@@ -31,8 +31,9 @@ public class ExportEclipseProjectsDialog extends DialogWrapper {
|
||||
setTitle(EclipseBundle.message("eclipse.export.dialog.title"));
|
||||
init();
|
||||
myUserLibrariesTF.setText(project.getBasePath() + File.separator + project.getName() + ".userlibraries");
|
||||
myUserLibrariesTF.addBrowseFolderListener(EclipseBundle.message("button.browse.dialog.title.locate.user.libraries"), EclipseBundle
|
||||
.message("button.browse.dialog.description.locate.user.libraries.file"), project, FileChooserDescriptorFactory.createSingleLocalFileDescriptor());
|
||||
myUserLibrariesTF.addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
.withTitle(EclipseBundle.message("button.browse.dialog.title.locate.user.libraries"))
|
||||
.withDescription(EclipseBundle.message("button.browse.dialog.description.locate.user.libraries.file")));
|
||||
myExportProjectLibrariesCb.setSelected(true);
|
||||
myExportProjectLibrariesCb.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.eclipse.importWizard;
|
||||
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
@@ -36,11 +36,11 @@ public class EclipseWorkspaceRootStep extends ProjectImportWizardStep {
|
||||
|
||||
public EclipseWorkspaceRootStep(final WizardContext context) {
|
||||
super(context);
|
||||
myWorkspaceRootComponent.addBrowseFolderListener(EclipseBundle.message("eclipse.import.title.select.workspace"), "", null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myWorkspaceRootComponent.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(EclipseBundle.message("eclipse.import.title.select.workspace")));
|
||||
|
||||
myDirComponent.addBrowseFolderListener(EclipseBundle.message("eclipse.import.title.module.dir"), "", null,
|
||||
FileChooserDescriptorFactory.createSingleFolderDescriptor());
|
||||
myDirComponent.addBrowseFolderListener(null, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(EclipseBundle.message("eclipse.import.title.module.dir")));
|
||||
|
||||
ActionListener listener = new ActionListener() {
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.github.ui.cloneDialog
|
||||
|
||||
import com.intellij.collaboration.auth.ui.CompactAccountsPanelFactory
|
||||
@@ -91,13 +91,11 @@ internal abstract class GHCloneDialogExtensionComponentBase(
|
||||
|
||||
private val searchField: SearchTextField
|
||||
private val directoryField = TextFieldWithBrowseButton().apply {
|
||||
val fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
fcd.isShowFileSystemRoots = true
|
||||
fcd.isHideIgnored = false
|
||||
addBrowseFolderListener(message("clone.destination.directory.browser.title"),
|
||||
message("clone.destination.directory.browser.description"),
|
||||
project,
|
||||
fcd)
|
||||
addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withShowFileSystemRoots(true)
|
||||
.withHideIgnored(false)
|
||||
.withTitle(message("clone.destination.directory.browser.title"))
|
||||
.withDescription(message("clone.destination.directory.browser.description")))
|
||||
}
|
||||
private val cloneDirectoryChildHandle = FilePathDocumentChildPathHandle
|
||||
.install(directoryField.textField.document, ClonePathProvider.defaultParentDirectoryPath(project, GitRememberedInputs.getInstance()))
|
||||
@@ -435,4 +433,4 @@ internal abstract class GHCloneDialogExtensionComponentBase(
|
||||
internal val <E> ListModel<E>.itemsSet
|
||||
get() = items.toSet()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gitlab.ui.clone
|
||||
|
||||
import com.intellij.collaboration.async.launchNow
|
||||
@@ -188,16 +188,12 @@ internal object GitLabCloneRepositoriesComponentFactory {
|
||||
cs: CoroutineScope,
|
||||
repositoriesVm: GitLabCloneRepositoriesViewModel
|
||||
): TextFieldWithBrowseButton {
|
||||
val fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor().apply {
|
||||
isShowFileSystemRoots = true
|
||||
isHideIgnored = false
|
||||
}
|
||||
val directoryField = TextFieldWithBrowseButton().apply {
|
||||
addBrowseFolderListener(
|
||||
DvcsBundle.message("clone.destination.directory.browser.title"),
|
||||
DvcsBundle.message("clone.destination.directory.browser.description"),
|
||||
project,
|
||||
fcd
|
||||
addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withShowFileSystemRoots(true)
|
||||
.withHideIgnored(false)
|
||||
.withTitle(DvcsBundle.message("clone.destination.directory.browser.title"))
|
||||
.withDescription(DvcsBundle.message("clone.destination.directory.browser.description"))
|
||||
)
|
||||
addDocumentListener(object : DocumentAdapter() {
|
||||
override fun textChanged(e: DocumentEvent) {
|
||||
@@ -231,4 +227,4 @@ internal object GitLabCloneRepositoriesComponentFactory {
|
||||
|
||||
override fun createActions(): Collection<AccountMenuItem.Action> = listOf(loginWithTokenAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.service.project.wizard
|
||||
|
||||
import com.intellij.CommonBundle
|
||||
@@ -65,6 +65,7 @@ import org.jetbrains.plugins.gradle.service.settings.PlaceholderGroup.Companion.
|
||||
import org.jetbrains.plugins.gradle.settings.DistributionType
|
||||
import org.jetbrains.plugins.gradle.settings.GradleDefaultProjectSettings
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle.message
|
||||
import org.jetbrains.plugins.gradle.util.GradleConstants
|
||||
import org.jetbrains.plugins.gradle.util.suggestGradleVersion
|
||||
import javax.swing.Icon
|
||||
@@ -172,10 +173,10 @@ abstract class GradleNewProjectWizardStep<ParentStep>(parent: ParentStep) :
|
||||
label(GradleBundle.message("gradle.project.settings.distribution.local.location.npw"))
|
||||
.applyToComponent { minimumWidth = MINIMUM_LABEL_WIDTH }
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(message("gradle.project.settings.distribution.local.location.dialog"))
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
val title = GradleBundle.message("gradle.project.settings.distribution.local.location.dialog")
|
||||
textFieldWithBrowseButton(title, context.project, fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(fileChooserDescriptor, context.project)
|
||||
.applyToComponent { setEmptyState(GradleBundle.message("gradle.project.settings.distribution.local.location.empty.state")) }
|
||||
.bindText(gradleHomeProperty.toUiPathProperty())
|
||||
.trimmedTextValidation(CHECK_NON_EMPTY, CHECK_DIRECTORY)
|
||||
@@ -528,4 +529,4 @@ abstract class GradleNewProjectWizardStep<ParentStep>(parent: ParentStep) :
|
||||
|
||||
private val MINIMUM_LABEL_WIDTH = JBUI.scale(120)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.execution.target
|
||||
|
||||
import com.intellij.execution.target.*
|
||||
@@ -75,12 +75,14 @@ class GradleRuntimeTargetUI<C : TargetEnvironmentConfiguration>(private val conf
|
||||
return this
|
||||
}
|
||||
|
||||
private fun TargetPathFieldWithBrowseButton.addLocalActionListener(project: Project,
|
||||
@NlsContexts.DialogTitle title: String): TargetPathFieldWithBrowseButton {
|
||||
private fun TargetPathFieldWithBrowseButton.addLocalActionListener(
|
||||
project: Project,
|
||||
title: @NlsContexts.DialogTitle String
|
||||
): TargetPathFieldWithBrowseButton {
|
||||
addTargetActionListener(null, ActionListener(BrowseFolderActionListener(
|
||||
title, null, this, project, createSingleFolderDescriptor(), TEXT_FIELD_WHOLE_TEXT
|
||||
this, project, createSingleFolderDescriptor().withTitle(title), TEXT_FIELD_WHOLE_TEXT
|
||||
)::actionPerformed))
|
||||
return this
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.gradle.service.settings
|
||||
|
||||
import com.intellij.openapi.externalSystem.service.ui.completion.TextCompletionComboBox
|
||||
@@ -33,6 +33,7 @@ import org.jetbrains.plugins.gradle.service.settings.PlaceholderGroup.Companion.
|
||||
import org.jetbrains.plugins.gradle.settings.DistributionType
|
||||
import org.jetbrains.plugins.gradle.settings.GradleDefaultProjectSettings
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle
|
||||
import org.jetbrains.plugins.gradle.util.GradleBundle.message
|
||||
import org.jetbrains.plugins.gradle.util.suggestGradleVersion
|
||||
|
||||
class IdeaGradleDefaultProjectSettingsControl : GradleSettingsControl() {
|
||||
@@ -91,10 +92,10 @@ class IdeaGradleDefaultProjectSettingsControl : GradleSettingsControl() {
|
||||
label(GradleBundle.message("gradle.project.settings.distribution.local.location"))
|
||||
.applyToComponent { minimumWidth = MINIMUM_LABEL_WIDTH }
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor()
|
||||
.withTitle(message("gradle.project.settings.distribution.local.location.dialog"))
|
||||
.withPathToTextConvertor(::getPresentablePath)
|
||||
.withTextToPathConvertor(::getCanonicalPath)
|
||||
val title = GradleBundle.message("gradle.project.settings.distribution.local.location.dialog")
|
||||
textFieldWithBrowseButton(title, null, fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(fileChooserDescriptor)
|
||||
.applyToComponent { setEmptyState(GradleBundle.message("gradle.project.settings.distribution.local.location.empty.state")) }
|
||||
.bindText(gradleHomeProperty.toUiPathProperty())
|
||||
.trimmedTextValidation(CHECK_NON_EMPTY, CHECK_DIRECTORY)
|
||||
@@ -201,4 +202,4 @@ class IdeaGradleDefaultProjectSettingsControl : GradleSettingsControl() {
|
||||
|
||||
private val MINIMUM_LABEL_WIDTH = JBUI.scale(90)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.groovy.compiler
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory.createSingleLocalFileDescriptor
|
||||
import com.intellij.openapi.options.Configurable
|
||||
import com.intellij.openapi.ui.DialogPanel
|
||||
import com.intellij.openapi.util.NlsContexts.ConfigurableName
|
||||
@@ -12,6 +12,7 @@ import com.intellij.ui.dsl.builder.panel
|
||||
import org.jetbrains.annotations.Nls
|
||||
import org.jetbrains.jps.incremental.groovy.GreclipseSettings
|
||||
import org.jetbrains.plugins.groovy.GroovyBundle
|
||||
import org.jetbrains.plugins.groovy.GroovyBundle.message
|
||||
import javax.swing.JComponent
|
||||
|
||||
class GreclipseConfigurable(val settings: GreclipseSettings) : Configurable {
|
||||
@@ -23,9 +24,7 @@ class GreclipseConfigurable(val settings: GreclipseSettings) : Configurable {
|
||||
val panel: DialogPanel = panel {
|
||||
group(GroovyBundle.message("configurable.greclipse.border.title")) {
|
||||
row(GroovyBundle.message("configurable.greclipse.path.label")) {
|
||||
val fileChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor()
|
||||
textFieldWithBrowseButton(browseDialogTitle = GroovyBundle.message("configurable.greclipse.path.chooser.description"),
|
||||
fileChooserDescriptor = fileChooserDescriptor)
|
||||
textFieldWithBrowseButton(createSingleLocalFileDescriptor().withTitle(message("configurable.greclipse.path.chooser.description")))
|
||||
.align(AlignX.FILL)
|
||||
.bindText(settings::greclipsePath)
|
||||
}
|
||||
@@ -68,4 +67,4 @@ class GreclipseConfigurable(val settings: GreclipseSettings) : Configurable {
|
||||
override fun apply() {
|
||||
panel.apply()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.groovy.compiler
|
||||
|
||||
import com.intellij.compiler.options.JavaCompilersTab
|
||||
@@ -45,9 +45,8 @@ class GroovyCompilerConfigurable(private val project: Project) : BoundSearchable
|
||||
cell(textField)
|
||||
.align(AlignX.FILL)
|
||||
.applyToComponent {
|
||||
val descriptor = FileChooserDescriptor(true, false, false, false, false, false)
|
||||
addBrowseFolderListener(null, GroovyBundle.message("settings.compiler.select.path.to.groovy.compiler.configscript"), null,
|
||||
descriptor)
|
||||
val descriptor = FileChooserDescriptor(true, false, false, false, false, false).withDescription(GroovyBundle.message("settings.compiler.select.path.to.groovy.compiler.configscript"))
|
||||
addBrowseFolderListener(null, descriptor)
|
||||
}.onReset {
|
||||
textField.text = normalizePath(config.configScript)
|
||||
}.onIsModified {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:JvmName("GroovyProjectWizardUtils")
|
||||
package org.jetbrains.plugins.groovy.config.wizard
|
||||
|
||||
@@ -36,9 +36,7 @@ private const val MAIN_GROOVY_TEMPLATE = "template.groovy"
|
||||
fun <S> S.setupGroovySdkUI(builder: Panel) where S : NewProjectWizardStep, S : BuildSystemGroovyNewProjectWizardData {
|
||||
val groovyLibraryDescription = GroovyLibraryDescription()
|
||||
val comboBox = DistributionComboBox(context.project, object : FileChooserInfo {
|
||||
override val fileChooserTitle = GroovyBundle.message("dialog.title.select.groovy.sdk")
|
||||
override val fileChooserDescription: String? = null
|
||||
override val fileChooserDescriptor = groovyLibraryDescription.createFileChooserDescriptor()
|
||||
override val fileChooserDescriptor = groovyLibraryDescription.createFileChooserDescriptor().withTitle(GroovyBundle.message("dialog.title.select.groovy.sdk"))
|
||||
override val fileChooserMacroFilter = FileChooserInfo.DIRECTORY_PATH
|
||||
})
|
||||
comboBox.specifyLocationActionName = GroovyBundle.message("dialog.title.specify.groovy.sdk")
|
||||
@@ -176,4 +174,4 @@ private fun getGroovySdkVersion(sdk: DistributionInfo?): String? {
|
||||
class FrameworkLibraryDistributionInfo(val version: FrameworkLibraryVersion) : AbstractDistributionInfo() {
|
||||
override val name: String = version.versionString
|
||||
override val description: String? = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
|
||||
package org.jetbrains.plugins.groovy.runner;
|
||||
|
||||
@@ -28,7 +28,6 @@ import javax.swing.*;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
|
||||
public class GroovyRunConfigurationEditor extends SettingsEditor<GroovyScriptRunConfiguration> implements PanelWithAnchor {
|
||||
|
||||
private JPanel myMainPanel;
|
||||
|
||||
private LabeledComponent<TextFieldWithBrowseButton> myScriptPathComponent;
|
||||
@@ -43,13 +42,10 @@ public class GroovyRunConfigurationEditor extends SettingsEditor<GroovyScriptRun
|
||||
private JComponent myAnchor;
|
||||
|
||||
public GroovyRunConfigurationEditor(@NotNull Project project) {
|
||||
final TextFieldWithBrowseButton scriptPath = myScriptPathComponent.getComponent();
|
||||
scriptPath.addBrowseFolderListener(
|
||||
GroovyBundle.message("script.runner.chooser.title"),
|
||||
GroovyBundle.message("script.runner.chooser.description"),
|
||||
project,
|
||||
FileChooserDescriptorFactory.createSingleFileDescriptor(GroovyFileType.GROOVY_FILE_TYPE)
|
||||
);
|
||||
var scriptPath = myScriptPathComponent.getComponent();
|
||||
scriptPath.addBrowseFolderListener(project, FileChooserDescriptorFactory.createSingleFileDescriptor(GroovyFileType.GROOVY_FILE_TYPE)
|
||||
.withTitle(GroovyBundle.message("script.runner.chooser.title"))
|
||||
.withDescription(GroovyBundle.message("script.runner.chooser.description")));
|
||||
|
||||
final ModulesComboBox modulesComboBox = myModulesComboBoxComponent.getComponent();
|
||||
modulesComboBox.addActionListener(e -> myCommonJavaParametersPanel.setModuleContext(modulesComboBox.getSelectedModule()));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.groovy.util;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooserDescriptor;
|
||||
@@ -43,13 +43,12 @@ public abstract class SdkHomeConfigurable implements SearchableConfigurable {
|
||||
contentPanel.add(new JLabel(GroovyBundle.message("framework.0.home.label", myFrameworkName)), BorderLayout.WEST);
|
||||
myPathField = new TextFieldWithBrowseButton();
|
||||
contentPanel.add(myPathField);
|
||||
myPathField
|
||||
.addBrowseFolderListener(GroovyBundle.message("select.framework.0.home.title", myFrameworkName), "", myProject, new FileChooserDescriptor(false, true, false, false, false, false) {
|
||||
@Override
|
||||
public boolean isFileSelectable(@Nullable VirtualFile file) {
|
||||
return file != null && isSdkHome(file);
|
||||
}
|
||||
});
|
||||
myPathField.addBrowseFolderListener(myProject, new FileChooserDescriptor(false, true, false, false, false, false) {
|
||||
@Override
|
||||
public boolean isFileSelectable(@Nullable VirtualFile file) {
|
||||
return file != null && isSdkHome(file);
|
||||
}
|
||||
}.withTitle(GroovyBundle.message("select.framework.0.home.title", myFrameworkName)));
|
||||
return myPanel;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.zmlx.hg4idea.ui;
|
||||
|
||||
import com.intellij.openapi.fileChooser.FileChooser;
|
||||
@@ -55,8 +55,10 @@ public class HgInitDialog extends DialogWrapper {
|
||||
}
|
||||
updateEverything();
|
||||
}
|
||||
};
|
||||
myFileDescriptor.setHideIgnored(false);
|
||||
}
|
||||
.withHideIgnored(false)
|
||||
.withTitle(HgBundle.message("hg4idea.init.destination.directory.title"))
|
||||
.withDescription(HgBundle.message("hg4idea.init.destination.directory.description"));
|
||||
|
||||
init();
|
||||
}
|
||||
@@ -89,10 +91,7 @@ public class HgInitDialog extends DialogWrapper {
|
||||
updateEverything();
|
||||
}
|
||||
});
|
||||
|
||||
myTextFieldBrowser.addBrowseFolderListener(HgBundle.message("hg4idea.init.destination.directory.title"),
|
||||
HgBundle.message("hg4idea.init.destination.directory.description"),
|
||||
myProject, myFileDescriptor);
|
||||
myTextFieldBrowser.addBrowseFolderListener(myProject, myFileDescriptor);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -162,5 +161,4 @@ public class HgInitDialog extends DialogWrapper {
|
||||
setErrorText(HgBundle.message("hg4idea.init.dialog.incorrect.path"), myTextFieldBrowser);
|
||||
setOKActionEnabled(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.plugins.javaFX;
|
||||
|
||||
import com.intellij.ide.IdeBundle;
|
||||
@@ -77,8 +77,7 @@ public final class JavaFxSettingsConfigurable implements SearchableConfigurable,
|
||||
private JPanel myWholePanel;
|
||||
|
||||
public JavaFxConfigurablePanel() {
|
||||
final FileChooserDescriptor descriptor = createSceneBuilderDescriptor();
|
||||
myPathField.addBrowseFolderListener(descriptor.getTitle(), descriptor.getDescription(), null, descriptor);
|
||||
myPathField.addBrowseFolderListener(null, createSceneBuilderDescriptor());
|
||||
}
|
||||
|
||||
private void reset(JavaFxSettings settings) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user