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


Java JBTextField.setText方法代码示例

本文整理汇总了Java中com.intellij.ui.components.JBTextField.setText方法的典型用法代码示例。如果您正苦于以下问题:Java JBTextField.setText方法的具体用法?Java JBTextField.setText怎么用?Java JBTextField.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.components.JBTextField的用法示例。


在下文中一共展示了JBTextField.setText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: ServiceAuthDialog

import com.intellij.ui.components.JBTextField; //导入方法依赖的package包/类
public ServiceAuthDialog() {
  super(null);
  setTitle("Service Authorization");
  myRoot = new JPanel(new VerticalFlowLayout(0, 0));

  myServiceAuthConfiguration = ServiceAuthConfiguration.getInstance();

  myAsAnonymousButton = new JBRadioButton("Logged as anonymous");
  myLogAsButton = new JBRadioButton("Log as user");

  JPanel loginPanel = new JPanel(new VerticalFlowLayout(0, 0));
  myEmailField = new JBTextField();
  loginPanel.add(LabeledComponent.left(myEmailField, "Email"));

  ButtonGroup group = new ButtonGroup();
  group.add(myAsAnonymousButton);
  group.add(myLogAsButton);

  myLogAsButton.addItemListener(e -> UIUtil.setEnabled(loginPanel, e.getStateChange() == ItemEvent.SELECTED, true));

  myRoot.add(myAsAnonymousButton);
  myRoot.add(myLogAsButton);
  myRoot.add(loginPanel);

  String email = myServiceAuthConfiguration.getEmail();
  if (email == null) {
    myAsAnonymousButton.setSelected(true);
  }
  else {
    myLogAsButton.setSelected(true);
    myEmailField.setText(email);
  }

  pack();
  init();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:37,代码来源:ServiceAuthDialog.java

示例4: createCenterPanel

import com.intellij.ui.components.JBTextField; //导入方法依赖的package包/类
@Nullable
@Override
protected JComponent createCenterPanel() {
    JPanel root = new JPanel(new GridBagLayout());
    GridBagConstraints constraints = new GridBagConstraints();
    constraints.weightx = 2.0;
    constraints.weighty = 0.0;
    constraints.anchor = GridBagConstraints.NORTHWEST;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    constraints.gridwidth = GridBagConstraints.REMAINDER;

    GridBagConstraints labelConstraint = new GridBagConstraints();
    labelConstraint.anchor = GridBagConstraints.EAST;
    labelConstraint.insets = JBUI.insets(5, 10);
    GridBagConstraints txtConstraint = new GridBagConstraints();
    txtConstraint.weightx = 2.0;
    txtConstraint.fill = GridBagConstraints.HORIZONTAL;
    txtConstraint.gridwidth = GridBagConstraints.REMAINDER;

    txtName = new JBTextField();
    txtName.setName("txtName");
    txtName.setPreferredSize(new Dimension(150, 25));

    txtDateOrder = new JBTextField();
    txtDateOrder.setText(new SimpleDateFormat("dd-MM-yyyy hh:mm").format(new Date()));
    txtDateOrder.setName("txtDateOrder");
    txtDateOrder.setPreferredSize(new Dimension(150, 25));

    txtDescription = new JTextArea();
    txtDescription.setName("txtDescription");
    txtDescription.setPreferredSize(new Dimension(150, 100));

    chkReleased = new JCheckBox("Released");
    chkReleased.setName("chkReleased");

    chkObsolete = new JCheckBox("Obsolete");
    chkObsolete.setName("chkObsolete");

    cmdDelete = new JButton("Delete");
    cmdDelete.setName("cmdDelete");
    cmdDelete.addActionListener(e -> {
        api.deleteVersion(version.getId());
        if(this.getButton(this.getOKAction())!=null)
            this.getButton(this.getOKAction()).doClick();
    });

    java.awt.Label lblName = new java.awt.Label("Name");
    java.awt.Label lblDateOrder = new java.awt.Label("Date");
    java.awt.Label lblDescription = new java.awt.Label("Description");

    JPanel basicsPanel = new JPanel(new GridBagLayout());
    basicsPanel.add(lblName, labelConstraint);
    basicsPanel.add(txtName, txtConstraint);
    basicsPanel.add(lblDateOrder, labelConstraint);
    basicsPanel.add(txtDateOrder, txtConstraint);
    basicsPanel.add(lblDescription, labelConstraint);
    basicsPanel.add(txtDescription, txtConstraint);
    basicsPanel.add(chkReleased, labelConstraint);
    basicsPanel.add(chkObsolete, txtConstraint);
    basicsPanel.add(cmdDelete);

    root.add(basicsPanel);
    return root;
}
 
开发者ID:domjos1994,项目名称:ideaMantis,代码行数:65,代码来源:VersionDialog.java


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