Esempio n. 1
0
  @Override
  public void apply() {
    if (myJavaModuleFacet.getModule() instanceof Solution) {
      SolutionDescriptor descriptor =
          (SolutionDescriptor) myJavaModuleFacet.getModule().getModuleDescriptor();
      descriptor.setCompileInMPS(myCheckBox.isSelected());
      descriptor.setKind((SolutionKind) myComboBox.getSelectedItem());
    }

    myPathsTableModel.apply();
    myLibraryTableModel.apply();
  }
Esempio n. 2
0
  @Override
  public boolean isModified() {
    boolean solutionCheck = false;
    if (myJavaModuleFacet.getModule() instanceof Solution) {
      SolutionDescriptor descriptor =
          (SolutionDescriptor) myJavaModuleFacet.getModule().getModuleDescriptor();
      solutionCheck =
          descriptor.getCompileInMPS() != myCheckBox.isSelected()
              || descriptor.getKind() != myComboBox.getSelectedItem();
    }

    return myPathsTableModel.isModified() || myLibraryTableModel.isModified() || solutionCheck;
  }
Esempio n. 3
0
  @Override
  public void init() {
    JPanel advancedTab = new JPanel();
    advancedTab.setLayout(
        new GridLayoutManager(
            (myJavaModuleFacet.getModule() instanceof Solution ? 5 : 3),
            2,
            MPSPropertiesConfigurable.INSETS,
            -1,
            -1));

    int row = 0;

    if (myJavaModuleFacet.getModule() instanceof Solution) {
      SolutionDescriptor descriptor =
          ((Solution) myJavaModuleFacet.getModule()).getModuleDescriptor();

      JBLabel solutionKindLabel =
          new JBLabel(
              PropertiesBundle.message("mps.properties.configurable.module.javatab.solutionkind"));
      myComboBox = new ComboBox(new DefaultComboBoxModel(SolutionKind.values()));
      myComboBox.setSelectedItem(descriptor.getKind());
      myComboBox.setPreferredSize(new Dimension(300, 20));

      advancedTab.add(
          solutionKindLabel,
          new GridConstraints(
              row,
              0,
              1,
              1,
              GridConstraints.ANCHOR_WEST,
              GridConstraints.FILL_NONE,
              GridConstraints.SIZEPOLICY_FIXED,
              GridConstraints.SIZEPOLICY_FIXED,
              null,
              null,
              null,
              0,
              false));
      advancedTab.add(
          myComboBox,
          new GridConstraints(
              row++,
              1,
              1,
              1,
              GridConstraints.ANCHOR_WEST,
              GridConstraints.FILL_HORIZONTAL,
              GridConstraints.SIZEPOLICY_CAN_GROW,
              GridConstraints.SIZEPOLICY_FIXED,
              null,
              null,
              null,
              0,
              false));

      myCheckBox =
          new JBCheckBox(
              PropertiesBundle.message("mps.properties.configurable.module.javatab.compileinmps"),
              descriptor.getCompileInMPS());
      advancedTab.add(
          myCheckBox,
          new GridConstraints(
              row++,
              0,
              1,
              2,
              GridConstraints.ANCHOR_WEST,
              GridConstraints.FILL_HORIZONTAL,
              GridConstraints.SIZEPOLICY_CAN_GROW,
              GridConstraints.SIZEPOLICY_FIXED,
              null,
              null,
              null,
              0,
              false));
    }

    advancedTab.add(
        getSourcePathsTable(),
        new GridConstraints(
            row++,
            0,
            1,
            2,
            GridConstraints.ANCHOR_CENTER,
            GridConstraints.FILL_BOTH,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            null,
            null,
            null,
            0,
            false));
    advancedTab.add(
        getLibrariesTable(),
        new GridConstraints(
            row,
            0,
            1,
            2,
            GridConstraints.ANCHOR_CENTER,
            GridConstraints.FILL_BOTH,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW,
            null,
            null,
            null,
            0,
            false));

    setTabComponent(advancedTab);
  }