本文整理汇总了Java中com.intellij.ui.components.JBTextField.setColumns方法的典型用法代码示例。如果您正苦于以下问题:Java JBTextField.setColumns方法的具体用法?Java JBTextField.setColumns怎么用?Java JBTextField.setColumns使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.components.JBTextField
的用法示例。
在下文中一共展示了JBTextField.setColumns方法的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: 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();
}
示例3: createToolWindowContent
import com.intellij.ui.components.JBTextField; //导入方法依赖的package包/类
@Override
public void createToolWindowContent(Project project, ToolWindow toolWindow) {
makeTable();
// System.out.println("createToolWindowContent()->"+toolWindow.getTitle());
totalSelectedTime = new JBLabel();
totalSelectedTime.setText("Not selected");
searchField = new JBTextField();
searchField.setToolTipText("Select column in combo box, input text, and press enter");
searchField.setColumns(50);
buildFilterComboBox();
//build UI
NonOpaquePanel totalPanel = new NonOpaquePanel();
totalPanel.add(Box.createHorizontalStrut(50), BorderLayout.WEST);
totalPanel.add(totalSelectedTime, BorderLayout.CENTER);
totalPanel.add(Box.createHorizontalStrut(50), BorderLayout.EAST);
NonOpaquePanel rightPanel = new NonOpaquePanel();
rightPanel.add(comboBoxLabel, BorderLayout.WEST);
rightPanel.add(Box.createHorizontalStrut(50), BorderLayout.CENTER);
rightPanel.add(totalPanel, BorderLayout.EAST);
NonOpaquePanel filterPanel = new NonOpaquePanel();
Icon refreshIcon = IconLoader.getIcon("/icons/refresh.png");
JButton btn = new JButton(refreshIcon);
btn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
loadDataFromSource(table_model, null);
table.updateUI();
}
});
JPanel butonPanel = new JPanel();
butonPanel.setLayout(new FlowLayout());
butonPanel.add(btn) ;
butonPanel.add(new JLabel("Filter: ")) ;
filterPanel.add(butonPanel, BorderLayout.WEST);
filterPanel.add(searchField, BorderLayout.CENTER);
filterPanel.add(rightPanel, BorderLayout.EAST);
filterPanel.setBorder(new EmptyBorder(10, 10, 10, 10));
// final Component component = toolWindow.getComponent();
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(filterPanel, BorderLayout.NORTH);
panel.add(sp, BorderLayout.CENTER);
// component.getParent().add(filterPanel, BorderLayout.NORTH);
// component.getParent().add(sp, BorderLayout.CENTER);
searchField.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
e.consume();
newFilter(searchField.getText(), comboBoxLabel.getSelectedIndex());
table.updateUI();
} else {
super.keyPressed(e);
}
}
});
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(panel, "", false);
toolWindow.getContentManager().addContent(content);
}
示例4: editPluginDependency
import com.intellij.ui.components.JBTextField; //导入方法依赖的package包/类
@Nullable
private DependencyOnPlugin editPluginDependency(@NotNull JComponent parent, @NotNull final DependencyOnPlugin original) {
List<String> pluginIds = new ArrayList<String>(getPluginNameByIdMap().keySet());
if (!original.getPluginId().isEmpty() && !pluginIds.contains(original.getPluginId())) {
pluginIds.add(original.getPluginId());
}
Collections.sort(pluginIds, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return getPluginNameById(o1).compareToIgnoreCase(getPluginNameById(o2));
}
});
final ComboBox pluginChooser = new ComboBox(ArrayUtilRt.toStringArray(pluginIds), 250);
pluginChooser.setRenderer(new ListCellRendererWrapper<String>() {
@Override
public void customize(JList list, String value, int index, boolean selected, boolean hasFocus) {
setText(getPluginNameById(value));
}
});
new ComboboxSpeedSearch(pluginChooser) {
@Override
protected String getElementText(Object element) {
return getPluginNameById((String)element);
}
};
pluginChooser.setSelectedItem(original.getPluginId());
final JBTextField minVersionField = new JBTextField(StringUtil.notNullize(original.getMinVersion()));
final JBTextField maxVersionField = new JBTextField(StringUtil.notNullize(original.getMaxVersion()));
minVersionField.getEmptyText().setText("<any>");
minVersionField.setColumns(10);
maxVersionField.getEmptyText().setText("<any>");
maxVersionField.setColumns(10);
JPanel panel = FormBuilder.createFormBuilder()
.addLabeledComponent("Plugin:", pluginChooser)
.addLabeledComponent("Minimum version:", minVersionField)
.addLabeledComponent("Maximum version:", maxVersionField)
.getPanel();
final DialogBuilder dialogBuilder = new DialogBuilder(parent).title("Required Plugin").centerPanel(panel);
dialogBuilder.setPreferredFocusComponent(pluginChooser);
pluginChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dialogBuilder.setOkActionEnabled(!StringUtil.isEmpty((String)pluginChooser.getSelectedItem()));
}
});
if (dialogBuilder.show() == DialogWrapper.OK_EXIT_CODE) {
return new DependencyOnPlugin(((String)pluginChooser.getSelectedItem()),
StringUtil.nullize(minVersionField.getText().trim()),
StringUtil.nullize(maxVersionField.getText().trim()));
}
return null;
}