• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EditorComboBoxEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ui.EditorComboBoxEditor的典型用法代码示例。如果您正苦于以下问题:Java EditorComboBoxEditor类的具体用法?Java EditorComboBoxEditor怎么用?Java EditorComboBoxEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EditorComboBoxEditor类属于com.intellij.ui包,在下文中一共展示了EditorComboBoxEditor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initEditor

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void initEditor() {
  myEditor = new EditorComboBoxEditor(getProject(), getEditorsProvider().getFileType()) {
    @Override
    public void setItem(Object anObject) {
      if (anObject == null) {
        anObject = XExpressionImpl.EMPTY_EXPRESSION;
      }
      super.setItem(createDocument(((XExpression)anObject)));
    }

    @Override
    protected void onEditorCreate(EditorEx editor) {
      editor.putUserData(DebuggerCopyPastePreprocessor.REMOVE_NEWLINES_ON_PASTE, true);
      editor.getColorsScheme().setEditorFontSize(myComboBox.getFont().getSize());
    }
  };
  myEditor.getEditorComponent().setFontInheritedFromLAF(false);
  myComboBox.setEditor(myEditor);
  //myEditor.setItem(myExpression);
  myComboBox.setRenderer(new EditorComboBoxRenderer(myEditor));
  myComboBox.setMaximumRowCount(XDebuggerHistoryManager.MAX_RECENT_EXPRESSIONS);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:XDebuggerExpressionComboBox.java


示例2: setupComboBox

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的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


示例3: initEditor

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void initEditor() {
  myEditor = new EditorComboBoxEditor(getProject(), myDebuggerEditorsProvider.getFileType()) {
    public void setItem(Object anObject) {
      if (anObject == null) {
        anObject = "";
      }
      super.setItem(createDocument((String)anObject));
    }

    public Object getItem() {
      return ((Document)super.getItem()).getText();
    }
  };
  myComboBox.setEditor(myEditor);
  myEditor.setItem(myExpression);
  myComboBox.setRenderer(new EditorComboBoxRenderer(myEditor));
  myComboBox.setMaximumRowCount(XDebuggerHistoryManager.MAX_RECENT_EXPRESSIONS);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:XDebuggerExpressionComboBox.java


示例4: setUpNameComboBox

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpNameComboBox(Collection<String> possibleNames) {
  final EditorComboBoxEditor comboEditor = new StringComboboxEditor(myProject, CSharpFileType.INSTANCE, myNameComboBox);

  myNameComboBox.setEditor(comboEditor);
  myNameComboBox.setRenderer(new EditorComboBoxRenderer(comboEditor));
  myNameComboBox.setEditable(true);
  myNameComboBox.setMaximumRowCount(8);

  myContentPane.registerKeyboardAction(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      myNameComboBox.requestFocus();
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);

  for (String possibleName : possibleNames) {
    myNameComboBox.addItem(possibleName);
  }
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:19,代码来源:CSharpIntroduceDialog.java


示例5: setUpNameComboBox

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpNameComboBox(Collection<String> possibleNames) {
  final EditorComboBoxEditor comboEditor = new StringComboboxEditor(myProject, HaxeFileType.HAXE_FILE_TYPE, myNameComboBox);

  myNameComboBox.setEditor(comboEditor);
  myNameComboBox.setRenderer(new EditorComboBoxRenderer(comboEditor));
  myNameComboBox.setEditable(true);
  myNameComboBox.setMaximumRowCount(8);

  myContentPane.registerKeyboardAction(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      myNameComboBox.requestFocus();
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);

  for (String possibleName : possibleNames) {
    myNameComboBox.addItem(possibleName);
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:19,代码来源:HaxeIntroduceDialog.java


示例6: setUpTypeComboBox

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpTypeComboBox(TypeConstraint[] typeConstraints) {
  final EditorComboBoxEditor comboEditor = new EditorComboBoxEditor(myProject, GroovyFileType.GROOVY_FILE_TYPE);

  final Document document = createDocument("");
  LOG.assertTrue(document != null);

  comboEditor.setItem(document);

  myTypeComboBox.setEditor(comboEditor);
  myTypeComboBox.setEditable(true);
  myTypeComboBox.grabFocus();

  PsiType type = typeConstraints.length == 1 ? typeConstraints[0].getDefaultType() : TypesUtil.getJavaLangObject(myContext);
  myTypeComboBox.getEditor().setItem(createDocument(type.getCanonicalText()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:DynamicDialog.java


示例7: XDebuggerComboBoxEditor

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
public XDebuggerComboBoxEditor() {
  myDelegate = new EditorComboBoxEditor(getProject(), getEditorsProvider().getFileType()) {
    @Override
    protected void onEditorCreate(EditorEx editor) {
      editor.putUserData(DebuggerCopyPastePreprocessor.REMOVE_NEWLINES_ON_PASTE, true);
      editor.getColorsScheme().setEditorFontSize(myComboBox.getFont().getSize());
    }
  };
  myDelegate.getEditorComponent().setFontInheritedFromLAF(false);
  myPanel = addChooser(myDelegate.getEditorComponent());
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:XDebuggerExpressionComboBox.java


示例8: setUpDialog

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpDialog() {
  JComponent commandLineComponent;
  if (myHistory == null) {
    commandLineEditor = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
    commandLineComponent = commandLineEditor;

    commandLineLabel.setLabelFor(commandLineEditor);
  }
  else {
    commandLineComboBox = new ComboBox(ArrayUtilRt.toStringArray(myHistory));
    commandLineComponent = commandLineComboBox;

    commandLineLabel.setLabelFor(commandLineComboBox);

    commandLineComboBox.setLightWeightPopupEnabled(false);

    EditorComboBoxEditor editor = new StringComboboxEditor(myProject, PlainTextFileType.INSTANCE, commandLineComboBox);
    //noinspection GtkPreferredJComboBoxRenderer
    commandLineComboBox.setRenderer(new EditorComboBoxRenderer(editor));

    commandLineComboBox.setEditable(true);
    commandLineComboBox.setEditor(editor);
    commandLineComboBox.setFocusable(true);

    commandLineEditor = editor.getEditorComponent();
  }

  commandLinePanel.add(commandLineComponent);

  ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
  FileChooserDescriptor projectPathChooserDescriptor = null;
  if (manager instanceof ExternalSystemUiAware) {
    projectPathChooserDescriptor = ((ExternalSystemUiAware)manager).getExternalProjectConfigDescriptor();
  }
  if (projectPathChooserDescriptor == null) {
    projectPathChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
  }

  String title = ExternalSystemBundle.message("settings.label.select.project", GradleConstants.SYSTEM_ID.getReadableName());
  myProjectPathField = new ExternalProjectPathField(myProject, GradleConstants.SYSTEM_ID, projectPathChooserDescriptor, title) {
    @Override
    public Dimension getPreferredSize() {
      return commandLinePanel == null ? super.getPreferredSize() : commandLinePanel.getPreferredSize();
    }
  };

  projectPathFieldPanel.add(myProjectPathField);

  new GradleArgumentsCompletionProvider(myProject, myProjectPathField).apply(commandLineEditor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:GradleRunTaskDialog.java


示例9: setUpDialog

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpDialog() {
  JComponent goalComponent;
  if (myHistory == null) {
    goalsEditor = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
    goalComponent = goalsEditor;

    goalsLabel.setLabelFor(goalsEditor);
  }
  else {
    goalsComboBox = new ComboBox(ArrayUtilRt.toStringArray(myHistory));
    goalComponent = goalsComboBox;

    goalsLabel.setLabelFor(goalsComboBox);

    goalsComboBox.setLightWeightPopupEnabled(false);

    EditorComboBoxEditor editor = new StringComboboxEditor(myProject, PlainTextFileType.INSTANCE, goalsComboBox);
    goalsComboBox.setRenderer(new EditorComboBoxRenderer(editor));

    goalsComboBox.setEditable(true);
    goalsComboBox.setEditor(editor);
    goalsComboBox.setFocusable(true);

    goalsEditor = editor.getEditorComponent();
  }

  goalsPanel.add(goalComponent);

  new MavenArgumentsCompletionProvider(myProject).apply(goalsEditor);


  MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(myProject);

  showProjectTreeButton.setIcon(AllIcons.Actions.Module);
  MavenSelectProjectPopup.attachToWorkingDirectoryField(projectsManager, workDirectoryField.getTextField(), showProjectTreeButton,
                                                        goalsComboBox != null ? goalsComboBox : goalsEditor);

  workDirectoryField.addBrowseFolderListener(
    RunnerBundle.message("maven.select.maven.project.file"), "", myProject,
    new FileChooserDescriptor(false, true, false, false, false, false) {
      @Override
      public boolean isFileSelectable(VirtualFile file) {
        if (!super.isFileSelectable(file)) return false;
        return file.findChild(MavenConstants.POM_XML) != null;
      }
    });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:MavenEditGoalDialog.java


示例10: setUpDialog

import com.intellij.ui.EditorComboBoxEditor; //导入依赖的package包/类
private void setUpDialog() {
  JComponent goalComponent;
  if (myHistory == null) {
    goalsEditor = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
    goalComponent = goalsEditor;

    goalsLabel.setLabelFor(goalsEditor);
  }
  else {
    //noinspection SSBasedInspection
    goalsComboBox = new ComboBox(myHistory.toArray(new String[myHistory.size()]), -1);
    goalComponent = goalsComboBox;

    goalsLabel.setLabelFor(goalsComboBox);

    goalsComboBox.setLightWeightPopupEnabled(false);

    EditorComboBoxEditor editor = new StringComboboxEditor(myProject, PlainTextFileType.INSTANCE, goalsComboBox);
    goalsComboBox.setRenderer(new EditorComboBoxRenderer(editor));

    goalsComboBox.setEditable(true);
    goalsComboBox.setEditor(editor);
    goalsComboBox.setFocusable(true);

    goalsEditor = editor.getEditorComponent();
  }

  goalsPanel.add(goalComponent);

  new MavenArgumentsCompletionProvider(myProject).apply(goalsEditor);


  MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(myProject);

  showProjectTreeButton.setIcon(AllIcons.Actions.Module);
  MavenSelectProjectPopup.attachToWorkingDirectoryField(projectsManager, workDirectoryField.getTextField(), showProjectTreeButton,
                                                        goalsComboBox != null ? goalsComboBox : goalsEditor);

  workDirectoryField.addBrowseFolderListener(
    RunnerBundle.message("maven.select.maven.project.file"), "", myProject,
    new FileChooserDescriptor(false, true, false, false, false, false) {
      @Override
      public boolean isFileSelectable(VirtualFile file) {
        if (!super.isFileSelectable(file)) return false;
        return file.findChild(MavenConstants.POM_XML) != null;
      }
    });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:49,代码来源:MavenEditGoalDialog.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RAMOutputStream类代码示例发布时间:2022-05-22
下一篇:
Java IDiamondSpriteVertexBufferObject类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap