當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。