本文整理汇总了Java中com.intellij.openapi.ui.ComboBox.setEditable方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.setEditable方法的具体用法?Java ComboBox.setEditable怎么用?Java ComboBox.setEditable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.ComboBox
的用法示例。
在下文中一共展示了ComboBox.setEditable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DebuggerExpressionComboBox
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public DebuggerExpressionComboBox(@NotNull Project project, @NotNull Disposable parentDisposable, @Nullable PsiElement context, @Nullable String recentsId, @NotNull CodeFragmentFactory factory) {
super(project, factory, parentDisposable, context, recentsId);
setLayout(new BorderLayout(0, 0));
myComboBox = new ComboBox(new MyComboboxModel(getRecents()), 100);
myComboBox.setSwingPopup(false);
// Have to turn this off because when used in DebuggerTreeInplaceEditor, the combobox popup is hidden on every change of selection
// See comment to SynthComboBoxUI.FocusHandler.focusLost()
myComboBox.setLightWeightPopupEnabled(false);
myEditor = new MyEditorComboBoxEditor(getProject(), getCurrentFactory().getFileType());
//noinspection GtkPreferredJComboBoxRenderer
myComboBox.setRenderer(new EditorComboBoxRenderer(myEditor));
myComboBox.setEditable(true);
myComboBox.setEditor(myEditor);
add(addChooseFactoryLabel(myComboBox, false));
}
示例2: createTargetOptionsCombo
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private static ComboBox createTargetOptionsCombo() {
final ComboBox combo = new ComboBox(new TargetLevelComboboxModel());
//combo.setRenderer(new DefaultListCellRenderer() {
// @Override
// public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
// try {
// return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
// }
// finally {
// //if ("".equals(value)) {
// // setText(COMPILER_DEFAULT);
// //}
// }
// }
//});
combo.setEditable(true);
combo.setEditor(new BasicComboBoxEditor() {
@Override
protected JTextField createEditorComponent() {
return new HintTextField(COMPILER_DEFAULT, 12);
}
});
return combo;
}
示例3: setupComboBox
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private void setupComboBox(final ComboBox combobox, FileType fileType) {
final EditorComboBoxEditor comboEditor = new StringComboboxEditor(myProject, fileType, combobox) {
@Override
public void setItem(Object anObject) {
myNonHumanChange = true;
super.setItem(anObject);
}
};
combobox.setEditor(comboEditor);
combobox.setRenderer(new EditorComboBoxRenderer(comboEditor));
combobox.setEditable(true);
combobox.setMaximumRowCount(8);
comboEditor.selectAll();
}
示例4: DebuggerExpressionComboBox
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public DebuggerExpressionComboBox(Project project, PsiElement context, @NonNls String recentsId, final CodeFragmentFactory factory) {
super(project, context, recentsId, factory);
setLayout(new BorderLayout(0, 0));
myComboBox = new ComboBox(new MyComboboxModel(getRecents()), 100);
myComboBox.setSwingPopup(false);
// Have to turn this off because when used in DebuggerTreeInplaceEditor, the combobox popup is hidden on every change of selection
// See comment to SynthComboBoxUI.FocusHandler.focusLost()
myComboBox.setLightWeightPopupEnabled(false);
myEditor = new MyEditorComboBoxEditor(getProject(), getCurrentFactory().getFileType());
//noinspection GtkPreferredJComboBoxRenderer
myComboBox.setRenderer(new EditorComboBoxRenderer(myEditor));
myComboBox.setEditable(true);
myComboBox.setEditor(myEditor);
add(addChooseFactoryLabel(myComboBox, false));
}
示例5: createTargetOptionsCombo
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private static ComboBox createTargetOptionsCombo() {
final ComboBox combo = new ComboBox(new TargetLevelComboboxModel());
//combo.setRenderer(new DefaultListCellRenderer() {
// @Override
// public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
// try {
// return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
// }
// finally {
// //if ("".equals(value)) {
// // setText(COMPILER_DEFAULT);
// //}
// }
// }
//});
combo.setEditable(true);
combo.setEditor(new BasicComboBoxEditor() {
@Override
protected JTextField createEditorComponent() {
return new HintTextField(COMPILER_DEFAULT, 10);
}
});
return combo;
}
示例6: initComponent
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
@Override
public void initComponent() {
model = new DateTimeTableModel();
final KeyStroke shortcutPaste = KeymapUtil.getKeyStroke(CommonShortcuts.getPaste());
final DateTimeColumnModel columns = new DateTimeColumnModel("Unix timestamp (ms)", "Datetime", "Format");
final ComboBox defaultPatterns = new ComboBox(DateTimePattern.getPatterns());
defaultPatterns.setEditable(true);
columns.getColumn(2).setCellEditor(new DefaultCellEditor(defaultPatterns));
final JBTable table = new JBTable(model, columns);
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
table.setAutoCreateRowSorter(true);
table.registerKeyboardAction(e -> model.addRows(DateTimeUtil.getClipboardDateTimes()), shortcutPaste, JComponent.WHEN_FOCUSED);
final JBScrollPane scrollPane = new JBScrollPane(table);
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new AddRowAction(model));
group.add(new DeleteRowAction(model, table));
final SimpleToolWindowPanel panel = new SimpleToolWindowPanel(false);
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("datetimeconverterbar", group, false);
toolbar.setTargetComponent(panel);
panel.add(scrollPane);
panel.setToolbar(toolbar.getComponent());
component = panel;
}
示例7: XDebuggerExpressionComboBox
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public XDebuggerExpressionComboBox(final @NotNull Project project, final @NotNull XDebuggerEditorsProvider debuggerEditorsProvider, final @Nullable @NonNls String historyId,
final @Nullable XSourcePosition sourcePosition) {
super(project, debuggerEditorsProvider, EvaluationMode.EXPRESSION, historyId, sourcePosition);
myComboBox = new ComboBox(100);
myComboBox.setEditable(true);
myExpression = XExpressionImpl.EMPTY_EXPRESSION;
Dimension minimumSize = new Dimension(myComboBox.getMinimumSize());
minimumSize.width = 100;
myComboBox.setMinimumSize(minimumSize);
initEditor();
fillComboBox();
myComponent = addChooseFactoryLabel(myComboBox, false);
}
示例8: MyTableCellEditor
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public MyTableCellEditor() {
myCbx = new ComboBox();
myCbx.setEditable(true);
myCbx.setRenderer(new BeanPropertyListCellRenderer());
myCbx.registerTableCellEditor(this);
final JComponent editorComponent = (JComponent)myCbx.getEditor().getEditorComponent();
editorComponent.setBorder(null);
myEditingRow = -1;
}
示例9: BlazeCommandStateEditor
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
BlazeCommandStateEditor(Project project) {
buildSystemName = Blaze.buildSystemName(project);
commandCombo =
new ComboBox(new DefaultComboBoxModel<>(BlazeCommandName.knownCommands().toArray()));
// Allow the user to manually specify an unlisted command.
commandCombo.setEditable(true);
}
示例10: XDebuggerExpressionComboBox
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public XDebuggerExpressionComboBox(final @NotNull Project project, final @NotNull XDebuggerEditorsProvider debuggerEditorsProvider, final @Nullable @NonNls String historyId,
final @Nullable XSourcePosition sourcePosition) {
super(project, debuggerEditorsProvider, EvaluationMode.EXPRESSION, historyId, sourcePosition);
myDebuggerEditorsProvider = debuggerEditorsProvider;
myComboBox = new ComboBox();
myComboBox.setEditable(true);
myExpression = "";
Dimension minimumSize = new Dimension(myComboBox.getMinimumSize());
minimumSize.width = 100;
myComboBox.setMinimumSize(minimumSize);
initEditor();
fillComboBox();
}
示例11: MyTableCellEditor
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
public MyTableCellEditor() {
myCbx = new ComboBox();
myCbx.setEditable(true);
myCbx.setRenderer(new BeanPropertyListCellRenderer());
myCbx.putClientProperty("tableCellEditor", this);
myCbx.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
final JComponent editorComponent = (JComponent)myCbx.getEditor().getEditorComponent();
editorComponent.setBorder(null);
myEditingRow = -1;
}
示例12: createUIComponents
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private void createUIComponents() {
model = new DefaultComboBoxModel(new String[]{
"UTF-8",
"ASCII",
"CP1256",
"ISO-8859-1",
"ISO-8859-2",
"ISO-8859-6",
"ISO-8859-15",
"Windows-1252"});
myComboBox = new ComboBox(model, 20);
myComboBox.setEditable(true);
myComboBox.setOpaque(true);
defaultColor = myComboBox.getForeground();
myComboBox.setSelectedItem("UTF-8");
final JTextComponent tc = (JTextComponent) myComboBox.getEditor().getEditorComponent();
tc.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent documentEvent) {
JTextField editorJComp = (JTextField) myComboBox.getEditor().getEditorComponent();
try {
Charset instance = Charset.forName(getCharset());
editorJComp.setForeground(defaultColor);
} catch (Exception ee) {
editorJComp.setForeground(JBColor.RED);
}
}
});
}
示例13: getEditor
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
@Nullable
@Override
public TableCellEditor getEditor(MethodParameter.MethodModelParameter modelParameter) {
Set<String> sorted = modelParameter.getPossibleServices();
ComboBox comboBox = new ComboBox(sorted.toArray(new String[sorted.size()] ), 200);
comboBox.setEditable(true);
return new DefaultCellEditor(comboBox);
}
示例14: getEditor
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
@Nullable
@Override
public TableCellEditor getEditor(ServiceParameter modelParameter) {
Set<String> sorted = modelParameter.getPossibleServices();
ComboBox comboBox = new ComboBox(sorted.toArray(new String[sorted.size()] ), 200);
comboBox.setEditable(true);
return new DefaultCellEditor(comboBox);
}
示例15: createUIComponents
import com.intellij.openapi.ui.ComboBox; //导入方法依赖的package包/类
private void createUIComponents() {
//get available generators for combobox
PerfCakeClassProvider classProvider = new PerfCakeClassProvider();
DefaultComboBoxModel generators = null;
try {
generators = new DefaultComboBoxModel<String>(classProvider.findGenerators());
} catch (PerfCakeClassProviderException e) {
LOG.error("Error finding generators for GeneratorDialog ComboBox", e);
}
generatorComboBox = new ComboBox(generators);
//set selected generator from model
String modelValue = mockCopy.getClazz().getStringValue();
generators.setSelectedItem(modelValue);
String[] predefinedRunTypes = {
"iteration",
"time",
"percentage"
};
runComboBox = new ComboBox(predefinedRunTypes);
runComboBox.setEditable(true);
runComboBox.setSelectedItem(mockCopy.getRun().getType().getStringValue());
propertiesEditor = new PropertiesEditor(mockCopy);
}