当前位置: 首页>>代码示例>>Java>>正文


Java SdkListCellRenderer类代码示例

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


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

示例1: OCamlToolWindowSettingsForm

import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
public OCamlToolWindowSettingsForm(@NotNull final Project project) {
    myProject = project;

    final List<Sdk> allSdks = ProjectJdkTable.getInstance().getSdksOfType(OCamlSdkType.getInstance());
    allSdks.add(0, null);
    mySdkComboBox.setModel(new CollectionComboBoxModel(allSdks, null));
    mySdkComboBox.setRenderer(new SdkListCellRenderer("<Project Default>"));

    myConfigureButton.addActionListener(new ActionListener() {
        public void actionPerformed(@NotNull final ActionEvent e) {
            final ProjectJdksEditor editor = new ProjectJdksEditor((Sdk) mySdkComboBox.getSelectedItem(),
                myProject, mySdkComboBox);
            editor.show();
            if (editor.isOK()) {
                setSelectedSdk(editor.getSelectedJdk());
            }
        }
    });

    final FileChooserDescriptor workingDirChooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false);
    workingDirChooserDescriptor.setRoot(myProject.getBaseDir());
    myWorkingDirectoryEditor.addBrowseFolderListener("Select Working Directory", "", myProject, workingDirChooserDescriptor);
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:24,代码来源:OCamlToolWindowSettingsForm.java

示例2: PyPluginCommonOptionsForm

import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
public PyPluginCommonOptionsForm(PyCommonOptionsFormData data) {
  // setting modules
  myProject = data.getProject();
  final List<Module> validModules = data.getValidModules();
  Collections.sort(validModules, new ModulesAlphaComparator());
  Module selection = validModules.size() > 0 ? validModules.get(0) : null;
  myModuleComboBox.setModules(validModules);
  myModuleComboBox.setSelectedModule(selection);

  myInterpreterComboBox.setRenderer(new SdkListCellRenderer("<Project Default>"));
  myWorkingDirectoryTextField.addBrowseFolderListener("Select Working Directory", "", data.getProject(),
                                                FileChooserDescriptorFactory.createSingleFolderDescriptor());

  ActionListener listener = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      updateControls();
    }
  };
  myUseSpecifiedSdkRadioButton.addActionListener(listener);
  myUseModuleSdkRadioButton.addActionListener(listener);
  myInterpreterComboBox.addActionListener(listener);
  myModuleComboBox.addActionListener(listener);

  setAnchor(myEnvsComponent.getLabel());


  myDecorator = new HideableDecorator(myHideablePanel, "Environment", false) {
    @Override
    protected void on() {
      super.on();
      storeState();
    }

    @Override
    protected void off() {
      super.off();
      storeState();
    }
    private void storeState() {
      PropertiesComponent.getInstance().setValue(EXPAND_PROPERTY_KEY, String.valueOf(isExpanded()), "true");
    }
  };
  myDecorator.setOn(PropertiesComponent.getInstance().getBoolean(EXPAND_PROPERTY_KEY, true));
  myDecorator.setContentComponent(myMainPanel);
  myPathMappingsComponent.setAnchor(myEnvsComponent.getLabel());
  updateControls();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:PyPluginCommonOptionsForm.java

示例3: updateDefaultInterpreter

import com.intellij.openapi.projectRoots.impl.SdkListCellRenderer; //导入依赖的package包/类
private void updateDefaultInterpreter(Module module) {
  final Sdk sdk = module == null ? null : ModuleRootManager.getInstance(module).getSdk();
  String projectSdkName = sdk == null ? "none" : sdk.getName();
  myInterpreterComboBox.setRenderer(new SdkListCellRenderer("Project Default (" + projectSdkName + ")"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:PyIdeCommonOptionsForm.java


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