use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class JsonSchemaMappingsView method createUI.
private void createUI(final Project project) {
myProject = project;
myTableView = new TableView<>();
myTableView.getTableHeader().setVisible(false);
myDecorator = ToolbarDecorator.createDecorator(myTableView);
myDecorator.setRemoveAction(new AnActionButtonRunnable() {
@Override
public void run(AnActionButton button) {
final int[] rows = myTableView.getSelectedRows();
if (rows != null && rows.length > 0) {
int cnt = 0;
for (int row : rows) {
myTableView.getListTableModel().removeRow(row - cnt);
++cnt;
}
myTableView.getListTableModel().fireTableDataChanged();
myTreeUpdater.run();
}
}
}).setAddAction(new MyAddActionButtonRunnable(project)).disableUpDownActions();
mySchemaField = new TextFieldWithBrowseButton();
SwingHelper.installFileCompletionAndBrowseDialog(myProject, mySchemaField, JsonBundle.message("json.schema.add.schema.chooser.title"), FileChooserDescriptorFactory.createSingleFileDescriptor());
attachNavigateToSchema();
myError = SwingHelper.createHtmlLabel("Warning: conflicting mappings. <a href=\"#\">Show details</a>", null, s -> {
final BalloonBuilder builder = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(myErrorText, UIUtil.getBalloonWarningIcon(), MessageType.WARNING.getPopupBackground(), null);
builder.setDisposable(this);
builder.setHideOnClickOutside(true);
builder.setCloseButtonEnabled(true);
builder.createBalloon().showInCenterOf(myError);
});
final FormBuilder builder = FormBuilder.createFormBuilder();
final JBLabel label = new JBLabel("JSON schema file:");
builder.addLabeledComponent(label, mySchemaField);
label.setBorder(JBUI.Borders.empty(0, 10, 0, 10));
mySchemaField.setBorder(JBUI.Borders.empty(0, 0, 0, 10));
final JPanel wrapper = new JPanel(new BorderLayout());
wrapper.setBorder(JBUI.Borders.empty(0, 10, 0, 10));
myErrorIcon = new JBLabel(UIUtil.getBalloonWarningIcon());
wrapper.add(myErrorIcon, BorderLayout.WEST);
wrapper.add(myError, BorderLayout.CENTER);
builder.addComponent(wrapper);
builder.addComponentFillVertically(myDecorator.createPanel(), 5);
myComponent = builder.getPanel();
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project kotlin by JetBrains.
the class ChoosePathDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setGap(3);
JPanel panel = new JPanel(verticalLayout);
if (description != null) {
panel.add(new JLabel(description));
}
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
FileTextField field = FileChooserFactory.getInstance().createFileTextField(descriptor, myDisposable);
field.getField().setColumns(25);
myPathField = new TextFieldWithBrowseButton(field.getField());
myPathField.addBrowseFolderListener("Choose Destination Folder", "Choose folder", myProject, descriptor);
myPathField.setText(defaultPath);
panel.add(myPathField);
return panel;
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class MapExternalResourceDialog method createUIComponents.
private void createUIComponents() {
FileTextField field = FileChooserFactory.getInstance().createFileTextField(FILE_CHOOSER_DESCRIPTOR, getDisposable());
myFileTextField = new TextFieldWithBrowseButton(field.getField());
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class AbstractCreateVirtualEnvDialog method setupDialog.
void setupDialog(Project project, final List<Sdk> allSdks) {
myProject = project;
final GridBagLayout layout = new GridBagLayout();
myMainPanel = new JPanel(layout);
myName = new JTextField();
myDestination = new TextFieldWithBrowseButton();
myMakeAvailableToAllProjectsCheckbox = new JBCheckBox(PyBundle.message("sdk.create.venv.dialog.make.available.to.all.projects"));
if (project == null || project.isDefault() || !PlatformUtils.isPyCharm()) {
myMakeAvailableToAllProjectsCheckbox.setSelected(true);
myMakeAvailableToAllProjectsCheckbox.setVisible(false);
}
layoutPanel(allSdks);
init();
setOKActionEnabled(false);
registerValidators(new FacetValidatorsManager() {
public void registerValidator(FacetEditorValidator validator, JComponent... componentsToWatch) {
}
public void validate() {
checkValid();
}
});
myMainPanel.setPreferredSize(new Dimension(300, 50));
checkValid();
setInitialDestination();
addUpdater(myName);
new LocationNameFieldsBinding(project, myDestination, myName, myInitialPath, PyBundle.message("sdk.create.venv.dialog.select.venv.location"));
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project azure-tools-for-java by Microsoft.
the class SparkSubmissionContentPanel method addMainClassNameLineItem.
private void addMainClassNameLineItem() {
JLabel sparkMainClassLabel = new JLabel("Main class name");
sparkMainClassLabel.setToolTipText("Application's java/spark main class");
GridBagConstraints c31 = new GridBagConstraints();
c31.gridx = 0;
c31.gridy = 2;
c31.insets = new Insets(margin, margin, margin, margin);
add(sparkMainClassLabel, new GridBagConstraints(0, ++displayLayoutCurrentRow, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(margin, margin, 0, 0), 0, 0));
mainClassTextField = new TextFieldWithBrowseButton();
mainClassTextField.setToolTipText("Application's java/spark main class");
ManifestFileUtil.setupMainClassField(submitModel.getProject(), mainClassTextField);
add(mainClassTextField, new GridBagConstraints(1, displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(margin, margin, 0, margin), 0, 0));
errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()] = new JLabel("Main Class Name should not be null");
errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()].setForeground(DarkThemeManager.getInstance().getErrorMessageColor());
errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()].setVisible(true);
mainClassTextField.getTextField().getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
setVisibleForFixedErrorMessageLabel(3, e.getDocument().getLength() == 0);
}
@Override
public void removeUpdate(DocumentEvent e) {
setVisibleForFixedErrorMessageLabel(3, e.getDocument().getLength() == 0);
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
add(errorMessageLabels[ErrorMessageLabelTag.MainClass.ordinal()], new GridBagConstraints(1, ++displayLayoutCurrentRow, 0, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, margin, 0, margin), 0, 0));
}
Aggregations