当前位置: 首页>>代码示例>>Java>>正文


Java JBTextField类代码示例

本文整理汇总了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);
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:20,代码来源:FossilUpdateConfigurable.java

示例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);
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:17,代码来源:FossilUpdateConfigurable.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:HgBookmarkDialog.java

示例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;
}
 
开发者ID:hsz,项目名称:idea-gitignore,代码行数:33,代码来源:UserTemplateDialog.java

示例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();
}
 
开发者ID:dboissier,项目名称:nosql4idea,代码行数:19,代码来源:RedisPanel.java

示例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();
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:9,代码来源:XrayGlobalConfiguration.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FixedComboBoxEditor.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TextFieldWithBrowseButton.java

示例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);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StringsCellEditor.java

示例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));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:IdeaGradleSystemSettingsControlBuilder.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:HgBookmarkDialog.java

示例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);
  }
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:9,代码来源:NewRuleUI.java

示例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());
}
 
开发者ID:dmitz,项目名称:idea-websocket-client,代码行数:30,代码来源:WebSocketClientToolWindow.java

示例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>();
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:8,代码来源:FossilUpdateConfigurable.java

示例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);
}
 
开发者ID:irengrig,项目名称:fossil4idea,代码行数:29,代码来源:FossilUpdateConfigurable.java


注:本文中的com.intellij.ui.components.JBTextField类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。