mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix backward compatibility: com.microsoft.tooling.msservices.intellij.azure:3.0.11
This commit is contained in:
@@ -41,11 +41,14 @@ import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class CommonProgramParametersPanel extends JPanel implements PanelWithAnchor {
|
||||
private LabeledComponent<RawCommandLineEditor> myProgramParametersComponent;
|
||||
private LabeledComponent<JComponent> myWorkingDirectoryComponent;
|
||||
protected MacroComboBoxWithBrowseButton myWorkingDirectoryComboBox;
|
||||
@Deprecated
|
||||
protected TextFieldWithBrowseButton myWorkingDirectoryField;
|
||||
private MacroComboBoxWithBrowseButton myWorkingDirectoryComboBox;
|
||||
private EnvironmentVariablesComponent myEnvVariablesComponent;
|
||||
protected JComponent myAnchor;
|
||||
|
||||
@@ -89,6 +92,10 @@ public class CommonProgramParametersPanel extends JPanel implements PanelWithAnc
|
||||
fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
|
||||
myWorkingDirectoryComboBox = new MacroComboBoxWithBrowseButton(fileChooserDescriptor, getProject());
|
||||
|
||||
// for backward compatibility: com.microsoft.tooling.msservices.intellij.azure:3.0.11
|
||||
myWorkingDirectoryField = new TextFieldWithBrowseButton();
|
||||
addWorkingDirectoryListener(myWorkingDirectoryField::setText);
|
||||
|
||||
myWorkingDirectoryComponent = LabeledComponent.create(myWorkingDirectoryComboBox, ExecutionBundle.message("run.configuration.working.directory.label"));
|
||||
myEnvVariablesComponent = new EnvironmentVariablesComponent();
|
||||
|
||||
@@ -148,6 +155,14 @@ public class CommonProgramParametersPanel extends JPanel implements PanelWithAnc
|
||||
myProgramParametersComponent.getComponent().setText(params);
|
||||
}
|
||||
|
||||
public TextAccessor getWorkingDirectoryAccessor() {
|
||||
return myWorkingDirectoryComboBox;
|
||||
}
|
||||
|
||||
public void addWorkingDirectoryListener(Consumer<String> onTextChange) {
|
||||
myWorkingDirectoryComboBox.getChildComponent().addActionListener(event -> onTextChange.accept(myWorkingDirectoryComboBox.getText()));
|
||||
}
|
||||
|
||||
public void setWorkingDirectory(String dir) {
|
||||
myWorkingDirectoryComboBox.setText(dir);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user