本文整理汇总了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);
}
示例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);
}
示例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();
}
示例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;
}