當前位置: 首頁>>代碼示例>>Java>>正文


Java ComboBox.setEditable方法代碼示例

本文整理匯總了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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:DebuggerExpressionComboBox.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:TargetOptionsComponent.java

示例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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:NameSuggestionsField.java

示例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));
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:20,代碼來源:DebuggerExpressionComboBox.java

示例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;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:25,代碼來源:TargetOptionsComponent.java

示例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;
}
 
開發者ID:imgruntw,項目名稱:date-time-converter-plugin,代碼行數:33,代碼來源:DateTimeConverterView.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:XDebuggerExpressionComboBox.java

示例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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:BindToExistingBeanStep.java

示例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);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:8,代碼來源:BlazeCommandState.java

示例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();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:14,代碼來源:XDebuggerExpressionComboBox.java

示例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;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:13,代碼來源:BindToExistingBeanStep.java

示例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);
			}
		}
	});

}
 
開發者ID:krasa,項目名稱:StringManipulation,代碼行數:32,代碼來源:Base64EncodingDialog.java

示例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);
}
 
開發者ID:Haehnchen,項目名稱:idea-php-symfony2-plugin,代碼行數:11,代碼來源:SymfonyCreateService.java

示例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);
}
 
開發者ID:Haehnchen,項目名稱:idea-php-symfony2-plugin,代碼行數:11,代碼來源:ServiceArgumentSelectionDialog.java

示例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);
}
 
開發者ID:PerfCake,項目名稱:PerfCakeIDEA-deprecated,代碼行數:28,代碼來源:GeneratorDialog.java


注:本文中的com.intellij.openapi.ui.ComboBox.setEditable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。