use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class CommonProgramParametersPanel method initComponents.
protected void initComponents() {
myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), ExecutionBundle.message("run.configuration.program.parameters"));
FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
//noinspection DialogTitleCapitalization
fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
myWorkingDirectoryField = new TextFieldWithBrowseButton();
myWorkingDirectoryField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(fileChooserDescriptor, getProject()) {
@Override
public void actionPerformed(ActionEvent e) {
myFileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
setProject(getProject());
super.actionPerformed(e);
}
});
myWorkingDirectoryComponent = LabeledComponent.create(createComponentWithMacroBrowse(myWorkingDirectoryField), ExecutionBundle.message("run.configuration.working.directory.label"));
myEnvVariablesComponent = new EnvironmentVariablesComponent();
myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);
addComponents();
setPreferredSize(new Dimension(10, 10));
copyDialogCaption(myProgramParametersComponent);
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class ExportToHTMLDialog method createNorthPanel.
@Override
protected JComponent createNorthPanel() {
OptionGroup optionGroup = new OptionGroup();
myRbCurrentFile = new JRadioButton(CodeEditorBundle.message("export.to.html.file.name.radio", (myFileName != null ? myFileName : "")));
optionGroup.add(myRbCurrentFile);
myRbSelectedText = new JRadioButton(CodeEditorBundle.message("export.to.html.selected.text.radio"));
optionGroup.add(myRbSelectedText);
myRbCurrentPackage = new JRadioButton(CodeEditorBundle.message("export.to.html.all.files.in.directory.radio", (myDirectoryName != null ? myDirectoryName : "")));
optionGroup.add(myRbCurrentPackage);
myCbIncludeSubpackages = new JCheckBox(CodeEditorBundle.message("export.to.html.include.subdirectories.checkbox"));
optionGroup.add(myCbIncludeSubpackages, true);
FileTextField field = FileChooserFactory.getInstance().createFileTextField(FileChooserDescriptorFactory.createSingleFolderDescriptor(), myDisposable);
myTargetDirectoryField = new TextFieldWithBrowseButton(field.getField());
LabeledComponent<TextFieldWithBrowseButton> labeledComponent = assignLabel(myTargetDirectoryField, myProject);
optionGroup.add(labeledComponent);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(myRbCurrentFile);
buttonGroup.add(myRbSelectedText);
buttonGroup.add(myRbCurrentPackage);
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
myCbIncludeSubpackages.setEnabled(myRbCurrentPackage.isSelected());
}
};
myRbCurrentFile.addActionListener(actionListener);
myRbSelectedText.addActionListener(actionListener);
myRbCurrentPackage.addActionListener(actionListener);
return optionGroup.createPanel();
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class ExtractIncludeDialog method createCenterPanel.
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new VerticalFlowLayout());
JLabel nameLabel = new JLabel();
panel.add(nameLabel);
myNameField = new JTextField();
nameLabel.setLabelFor(myNameField);
myNameField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent e) {
validateOKButton();
}
});
panel.add(myNameField);
nameLabel.setText(getNameLabel());
myTargetDirLabel = new JLabel();
panel.add(myTargetDirLabel);
myTargetDirectoryField = new TextFieldWithBrowseButton();
myTargetDirectoryField.setText(myCurrentDirectory.getVirtualFile().getPresentableUrl());
myTargetDirectoryField.addBrowseFolderListener(RefactoringBundle.message("select.target.directory"), RefactoringBundle.message("select.target.directory.description"), null, FileChooserDescriptorFactory.createSingleFolderDescriptor());
myTargetDirLabel.setText(RefactoringBundle.message("extract.to.directory"));
panel.add(myTargetDirectoryField);
myTargetDirectoryField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
public void textChanged(DocumentEvent event) {
validateOKButton();
}
});
validateOKButton();
return panel;
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class ExportOptionsDialog method createCenterPanel.
@Nullable
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
gc.insets = JBUI.insets(2);
gc.gridwidth = 1;
gc.gridheight = 1;
gc.gridx = 0;
gc.gridy = 0;
gc.anchor = GridBagConstraints.WEST;
gc.fill = GridBagConstraints.NONE;
gc.weightx = 0;
gc.weighty = 0;
panel.add(new JLabel("Export:"), gc);
gc.gridx += 1;
gc.gridwidth = 2;
gc.weightx = 1;
gc.fill = GridBagConstraints.HORIZONTAL;
JLabel urlLabel = new JLabel(myURL.toString());
urlLabel.setFont(urlLabel.getFont().deriveFont(Font.BOLD));
panel.add(urlLabel, gc);
gc.gridy += 1;
gc.gridwidth = 1;
gc.gridx = 0;
gc.weightx = 0;
gc.fill = GridBagConstraints.NONE;
panel.add(new JLabel("Destination:"), gc);
gc.gridx += 1;
gc.gridwidth = 2;
gc.weightx = 1;
gc.fill = GridBagConstraints.HORIZONTAL;
myPathField = new TextFieldWithBrowseButton(this);
myPathField.setText(myFile.getAbsolutePath());
myPathField.setEditable(false);
panel.add(myPathField, gc);
gc.gridy += 1;
gc.gridx = 0;
gc.weightx = 0;
gc.gridwidth = 3;
gc.fill = GridBagConstraints.NONE;
// other options.
final JLabel depthLabel = new JLabel(SvnBundle.message("label.depth.text"));
depthLabel.setToolTipText(SvnBundle.message("label.depth.description"));
panel.add(depthLabel, gc);
++gc.gridx;
myDepth = new DepthCombo(false);
panel.add(myDepth, gc);
depthLabel.setLabelFor(myDepth);
gc.gridx = 0;
gc.gridy += 1;
myForceCheckbox = new JCheckBox("Replace existing files");
myForceCheckbox.setSelected(true);
panel.add(myForceCheckbox, gc);
gc.gridy += 1;
myExternalsCheckbox = new JCheckBox("Include externals locations");
myExternalsCheckbox.setSelected(true);
panel.add(myExternalsCheckbox, gc);
gc.gridy += 1;
gc.gridwidth = 2;
panel.add(new JLabel("Override 'native' EOLs with:"), gc);
gc.gridx += 2;
gc.gridwidth = 1;
myEOLStyleBox = new JComboBox(new Object[] { "None", "LF", "CRLF", "CR" });
panel.add(myEOLStyleBox, gc);
gc.gridy += 1;
gc.gridwidth = 3;
gc.gridx = 0;
gc.weightx = 1;
gc.weighty = 1;
gc.anchor = GridBagConstraints.SOUTH;
gc.fill = GridBagConstraints.HORIZONTAL;
panel.add(new JSeparator(), gc);
return panel;
}
use of com.intellij.openapi.ui.TextFieldWithBrowseButton in project intellij-community by JetBrains.
the class SvnMergeInfoRootPanelManual method init.
private void init() {
myContentPanel = new JPanel(new GridBagLayout()) {
@Override
public void setBounds(final Rectangle r) {
super.setBounds(r);
}
};
myContentPanel.setMinimumSize(new Dimension(200, 100));
final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(1), 0, 0);
myInclude = new JCheckBox();
gb.fill = GridBagConstraints.NONE;
gb.weightx = 0;
myContentPanel.add(myInclude, gb);
// newline
JLabel hereLabel = new JLabel("From:");
++gb.gridy;
gb.gridx = 0;
myContentPanel.add(hereLabel, gb);
myUrlText = new JTextArea();
myUrlText.setLineWrap(true);
myUrlText.setBackground(UIUtil.getLabelBackground());
myUrlText.setWrapStyleWord(true);
gb.weightx = 1;
++gb.gridx;
gb.gridwidth = 2;
gb.fill = GridBagConstraints.HORIZONTAL;
myContentPanel.add(myUrlText, gb);
// newline
gb.fill = GridBagConstraints.NONE;
JLabel thereLabel = new JLabel("To:");
gb.weightx = 0;
gb.gridwidth = 1;
++gb.gridy;
gb.gridx = 0;
myContentPanel.add(thereLabel, gb);
myBranchField = new TextFieldWithBrowseButton();
gb.weightx = 1;
++gb.gridx;
gb.gridwidth = 2;
gb.fill = GridBagConstraints.HORIZONTAL;
myContentPanel.add(myBranchField, gb);
// newline
gb.gridx = 1;
++gb.gridy;
gb.gridwidth = 1;
myLocalArea = new JTextArea();
myLocalArea.setBackground(UIUtil.getLabelBackground());
myLocalArea.setLineWrap(true);
myLocalArea.setWrapStyleWord(true);
myContentPanel.add(myLocalArea, gb);
++gb.gridx;
gb.weightx = 0;
gb.fill = GridBagConstraints.NONE;
myFixedSelectLocal = new FixedSizeButton(20);
myContentPanel.add(myFixedSelectLocal, gb);
++gb.gridy;
gb.gridx = 0;
gb.gridwidth = 2;
myMixedRevisions = new JTextArea("Mixed Revision Working Copy");
myMixedRevisions.setForeground(JBColor.RED);
myMixedRevisions.setBackground(myContentPanel.getBackground());
myContentPanel.add(myMixedRevisions, gb);
myMixedRevisions.setVisible(false);
}
Aggregations