com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel Java Examples

The following examples show how to use com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReplRunConfiguration.java    From reasonml-idea-plugin with MIT License 6 votes vote down vote up
@Override
public void readExternal(@NotNull Element element) throws InvalidDataException {
    super.readExternal(element);
    Element node = element.getChild("sdk");
    if (node != null) {
        String sdkName = node.getAttributeValue("name");
        if (!sdkName.isEmpty()) {
            ProjectSdksModel model = new ProjectSdksModel();
            model.reset(getProject());
            for (Sdk sdk : model.getSdks()) {
                if (sdkName.equals(sdk.getName())) {
                    m_sdk = sdk;
                    break;
                }
            }
        }
        m_cygwinEnabled = Boolean.parseBoolean(node.getAttributeValue("cygwin"));
        m_cygwinPath = node.getAttributeValue("cygwinPath");
    }
}
 
Example #2
Source File: BlazeIntellijPluginConfiguration.java    From intellij with Apache License 2.0 6 votes vote down vote up
public BlazeIntellijPluginConfigurationSettingsEditor(
    Iterable<Label> javaLabels,
    RunConfigurationStateEditor blazeFlagsEditor,
    RunConfigurationStateEditor exeFlagsEditor) {
  targetCombo =
      new ComboBox<>(
          new DefaultComboBoxModel<>(
              Ordering.usingToString().sortedCopy(javaLabels).toArray(new Label[0])));
  targetCombo.setRenderer(
      new ListCellRendererWrapper<Label>() {
        @Override
        public void customize(
            JList list, @Nullable Label value, int index, boolean selected, boolean hasFocus) {
          setText(value == null ? null : value.toString());
        }
      });
  this.blazeFlagsEditor = blazeFlagsEditor;
  this.exeFlagsEditor = exeFlagsEditor;
  ProjectSdksModel sdksModel = new ProjectSdksModel();
  sdksModel.reset(null);
  sdkCombo = new JdkComboBox(sdksModel, IdeaJdkHelper::isIdeaJdkType);

  keepInSyncCheckBox = new JBCheckBox("Keep in sync with source XML");
  keepInSyncCheckBox.addItemListener(e -> updateEnabledStatus());
}
 
Example #3
Source File: ReplRunConfiguration.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
ReplRunConfiguration(@NotNull Project project, @NotNull ConfigurationFactory factory, String name) {
    super(project, factory, name);
    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(getProject());
    for (Sdk sdk : model.getSdks()) {
        if ("OCaml SDK".equals(sdk.getSdkType().getName())) {
            m_sdk = sdk;
            return;
        }
    }
}
 
Example #4
Source File: OCamlModuleWizardStep.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
private void createUIComponents() {
    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(ProjectManager.getInstance().getDefaultProject());
    c_sdk = new JdkComboBox(model, sdkTypeId -> OCamlSdkType.ID.equals(sdkTypeId.getName()));
}
 
Example #5
Source File: DuneFacetEditor.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
private void createUIComponents() {
    Module m_module = m_editorContext.getModule();
    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(m_module.getProject());
    f_sdkSelect = new JdkComboBox(model, sdkTypeId -> OCamlSdkType.ID.equals(sdkTypeId.getName()));
}
 
Example #6
Source File: OclProjectJdkWizardStep.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
private void createUIComponents() {
    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(ProjectManager.getInstance().getDefaultProject());
    c_selExistingSdk = new JdkComboBox(model, sdkTypeId -> OCamlSdkType.ID.equals(sdkTypeId.getName()));
}
 
Example #7
Source File: ReplRunSettingsEditor.java    From reasonml-idea-plugin with MIT License 4 votes vote down vote up
private void createUIComponents() {
    ProjectSdksModel model = new ProjectSdksModel();
    model.reset(m_project);
    c_sdk = new JdkComboBox(model, sdkTypeId -> "OCaml SDK".equals(sdkTypeId.getName()));
}