本文整理汇总了Java中com.intellij.ui.components.JBTextField类的典型用法代码示例。如果您正苦于以下问题:Java JBTextField类的具体用法?Java JBTextField怎么用?Java JBTextField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JBTextField类属于com.intellij.ui.components包,在下文中一共展示了JBTextField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildForOne
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
private void buildForOne(JBPanel panel, final FilePath root) {
final GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST,
GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 0, 0);
c.fill = GridBagConstraints.HORIZONTAL;
c.gridwidth = 2;
final JBLabel comp = new JBLabel("Please select remote URL:");
comp.setFont(comp.getFont().deriveFont(Font.BOLD));
panel.add(comp, c);
final JBTextField value = new JBTextField();
value.setColumns(100);
final String preset = myCheckoutURLs.get(root.getIOFile());
if (preset != null) {
value.setText(preset);
}
myFields.put(root.getIOFile(), value);
++ c.gridy;
panel.add(value, c);
addWarning(panel, c);
}
示例2: apply
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
@Override
public void apply() throws ConfigurationException {
FossilConfiguration configuration = FossilConfiguration.getInstance(myProject);
final Map<File, String> urls = new HashMap<File, String>(configuration.getRemoteUrls());
for (Map.Entry<File, JBTextField> entry : myFields.entrySet()) {
final String text = entry.getValue().getText();
if (text.trim().equals(myCheckoutURLs.get(entry.getKey())) || text.trim().length() == 0) {
// remove override from map
urls.remove(entry.getKey());
} else {
urls.put(entry.getKey(), text.trim());
}
}
configuration.setRemoteUrls(urls);
}
示例3: createCenterPanel
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
@Override
@NotNull
protected JComponent createCenterPanel() {
JPanel contentPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag()
.setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
.setDefaultAnchor(GridBagConstraints.LINE_START)
.setDefaultFill(GridBagConstraints.HORIZONTAL);
JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
myBookmarkName = new JBTextField(13);
JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
bookmarkLabel.setLabelFor(myBookmarkName);
myActiveCheckbox = new JBCheckBox("Inactive", false);
contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
return contentPanel;
}
示例4: createCenterPanel
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
/**
* Factory method. It creates panel with dialog options. Options panel is located at the
* center of the dialog's content pane. The implementation can return <code>null</code>
* value. In this case there will be no options panel.
*
* @return center panel
*/
@Nullable
@Override
protected JComponent createCenterPanel() {
final JPanel centerPanel = new JPanel(new BorderLayout());
centerPanel.setPreferredSize(new Dimension(600, 300));
previewDocument = EditorFactory.getInstance().createDocument(content);
preview = Utils.createPreviewEditor(previewDocument, project, false);
name = new JBTextField(IgnoreBundle.message("dialog.userTemplate.name.value"));
JLabel nameLabel = new JLabel(IgnoreBundle.message("dialog.userTemplate.name"));
nameLabel.setBorder(IdeBorderFactory.createEmptyBorder(0, 0, 0, 10));
JPanel namePanel = new JPanel(new BorderLayout());
namePanel.add(nameLabel, BorderLayout.WEST);
namePanel.add(name, BorderLayout.CENTER);
JComponent previewComponent = preview.getComponent();
previewComponent.setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 0, 0));
centerPanel.add(namePanel, BorderLayout.NORTH);
centerPanel.add(previewComponent, BorderLayout.CENTER);
return centerPanel;
}
示例5: buildQueryToolBar
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
protected void buildQueryToolBar() {
toolBarPanel.setLayout(new BorderLayout());
filterField = new JBTextField("*");
filterField.setColumns(10);
NonOpaquePanel westPanel = new NonOpaquePanel();
NonOpaquePanel filterPanel = new NonOpaquePanel();
filterPanel.add(new JLabel("Filter: "), BorderLayout.WEST);
filterPanel.add(filterField, BorderLayout.CENTER);
filterPanel.add(Box.createHorizontalStrut(5), BorderLayout.EAST);
westPanel.add(filterPanel, BorderLayout.WEST);
toolBarPanel.add(westPanel, BorderLayout.WEST);
addCommonsActions();
}
示例6: createUIComponents
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
private void createUIComponents() {
xrayConfig = GlobalSettings.getInstance().getXrayConfig();
url = new JBTextField();
username = new JBTextField();
password = new JBPasswordField();
loadConfig();
}
示例7: FixedComboBoxEditor
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
public FixedComboBoxEditor() {
if (SystemInfo.isMac && (UIUtil.isUnderAquaLookAndFeel() || UIUtil.isUnderIntelliJLaF())) {
myField = new MacComboBoxTextField();
}
else {
myField = new JBTextField();
myField.setBorder(null);
}
}
示例8: TextFieldWithBrowseButton
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
public TextFieldWithBrowseButton(JTextField field, @Nullable ActionListener browseActionListener, @Nullable Disposable parent) {
super(field, browseActionListener);
if (!(field instanceof JBTextField)) {
UIUtil.addUndoRedoActions(field);
}
installPathCompletion(FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), parent);
}
示例9: StringsCellEditor
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
public StringsCellEditor() {
myTextField = new JBTextField();
myTextField.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
stopCellEditing();
e.consume();
}
else {
super.keyPressed(e);
}
}
});
}
示例10: fillUi
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
@Override
public void fillUi(@NotNull PaintAwarePanel canvas, int indentLevel) {
if (!dropOfflineModeBox) {
myOfflineModeBox = new JBCheckBox(GradleBundle.message("gradle.settings.text.offline_work"));
canvas.add(myOfflineModeBox, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
addServiceDirectoryControl(canvas, indentLevel);
if (!dropVmOptions) {
myGradleVmOptionsLabel = new JBLabel(GradleBundle.message("gradle.settings.text.vm.options"));
canvas.add(myGradleVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(indentLevel));
myGradleVmOptionsField = new JBTextField();
canvas.add(myGradleVmOptionsField, ExternalSystemUiUtil.getFillLineConstraints(indentLevel));
}
}
示例11: createCenterPanel
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
@Override
@NotNull
protected JComponent createCenterPanel() {
JPanel contentPanel = new JPanel(new GridBagLayout());
GridBag g = new GridBag()
.setDefaultInsets(new Insets(0, 0, DEFAULT_VGAP, DEFAULT_HGAP))
.setDefaultAnchor(GridBagConstraints.LINE_START)
.setDefaultFill(GridBagConstraints.HORIZONTAL);
JLabel icon = new JLabel(UIUtil.getQuestionIcon(), SwingConstants.LEFT);
myBookmarkName = new JBTextField(13);
myBookmarkName.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
public void textChanged(DocumentEvent e) {
validateFields();
}
});
JBLabel bookmarkLabel = new JBLabel("Bookmark name:");
bookmarkLabel.setLabelFor(myBookmarkName);
myActiveCheckbox = new JBCheckBox("Inactive", false);
contentPanel.add(icon, g.nextLine().next().coverColumn(3).pady(DEFAULT_HGAP));
contentPanel.add(bookmarkLabel, g.next().fillCellNone().insets(new Insets(0, 6, DEFAULT_VGAP, DEFAULT_HGAP)));
contentPanel.add(myBookmarkName, g.next().coverLine().setDefaultWeightX(1));
contentPanel.add(myActiveCheckbox, g.nextLine().next().next().coverLine(2));
return contentPanel;
}
示例12: NewRuleUI
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
public NewRuleUI(int textFieldLength) {
this.ruleNameField = new JBTextField(textFieldLength);
Kind lastValue =
Kind.fromString(PropertiesComponent.getInstance().getValue(LAST_SELECTED_KIND));
if (HANDLED_RULES.contains(lastValue)) {
ruleComboBox.setSelectedItem(lastValue);
}
}
示例13: initializeToolWindow
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
private void initializeToolWindow() {
JBPanel mainPanel = new JBPanel(new BorderLayout());
JBPanel addressPanel = new JBPanel(new FlowLayout(FlowLayout.LEFT));
ActionToolbar rightToolbar = createToolbar();
JBLabel addressLabel = new JBLabel("Location: ");
addressTextField = new JBTextField(25);
addressPanel.add(addressLabel);
addressPanel.add(addressTextField);
mainPanel.add(addressPanel, BorderLayout.NORTH);
requestTextField = new EditorTextField();
responseTextField = new EditorTextField();
requestTextField.setPlaceholder("Request");
responseTextField.setPlaceholder("Response");
JBSplitter splitter = new JBSplitter(false, 0.5f);
splitter.setShowDividerControls(true);
splitter.setFirstComponent(requestTextField);
splitter.setSecondComponent(responseTextField);
mainPanel.add(splitter, BorderLayout.CENTER);
setContent(mainPanel);
setToolbar(rightToolbar.getComponent());
}
示例14: FossilUpdateConfigurable
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
public FossilUpdateConfigurable(final Project project, final Collection<FilePath> roots, Map<File, String> checkoutURLs, String warning) {
myProject = project;
myRoots = roots;
myCheckoutURLs = checkoutURLs;
myWarning = warning;
myFields = new HashMap<File, JBTextField>();
}
示例15: buildForMultiple
import com.intellij.ui.components.JBTextField; //导入依赖的package包/类
private void buildForMultiple(JBPanel panel) {
final GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(1, 1, 1, 1), 0, 0);
c.gridwidth = 2;
c.fill = GridBagConstraints.HORIZONTAL;
final JBLabel comp = new JBLabel("Please select remote URLs for roots:");
comp.setFont(comp.getFont().deriveFont(Font.BOLD));
panel.add(comp, c);
c.gridwidth = 1;
for (FilePath root : myRoots) {
c.weighty = 0;
c.gridx = 0;
++ c.gridy;
c.fill = GridBagConstraints.NONE;
panel.add(new JBLabel(root.getName() + " (" + root.getParentPath() + ")"), c);
++ c.gridx;
c.fill = GridBagConstraints.HORIZONTAL;
c.weighty = 1;
final JBTextField field = new JBTextField();
panel.add(field, c);
myFields.put(root.getIOFile(), field);
final String preset = myCheckoutURLs.get(root.getIOFile());
if (preset != null) {
field.setText(preset);
}
}
addWarning(panel, c);
}