@Nullable
  public LocalChangeList getSelectedList(Project project) {
    ChangeListManager manager = ChangeListManager.getInstance(project);
    if (myRbNew.isSelected()) {
      String newText = myNewListPanel.getChangeListName();
      if (manager.findChangeList(newText) != null) {
        Messages.showErrorDialog(
            project,
            VcsBundle.message("changes.newchangelist.warning.already.exists.text", newText),
            VcsBundle.message("changes.newchangelist.warning.already.exists.title"));
        return null;
      }
    }
    final boolean existingSelected = myRbExisting.isSelected();
    VcsConfiguration.getInstance(myProject).PRESELECT_EXISTING_CHANGELIST = existingSelected;

    if (existingSelected) {
      return (LocalChangeList) myExistingListsCombo.getSelectedItem();
    } else {
      LocalChangeList changeList =
          manager.addChangeList(
              myNewListPanel.getChangeListName(), myNewListPanel.getDescription());
      myNewListPanel.changelistCreatedOrChanged(changeList);
      if (myNewListPanel.getMakeActiveCheckBox().isSelected()) {
        manager.setDefaultChangeList(changeList);
      }
      VcsConfiguration.getInstance(project).MAKE_NEW_CHANGELIST_ACTIVE =
          myNewListPanel.getMakeActiveCheckBox().isSelected();

      return changeList;
    }
  }
 private void updateControlsEnabled() {
   myClassPackageChooser.setEnabled(myToPackageRadioButton.isSelected());
   myInnerClassChooser.setEnabled(myMakeInnerClassOfRadioButton.isSelected());
   UIUtil.setEnabled(
       myTargetPanel,
       isMoveToPackage() && getSourceRoots().length > 1 && !myTargetDirectoryFixed,
       true);
   validateButtons();
 }
  private void updateEnabledState() {
    myLabelEditor.setEnabled(myRbExpressionLabel.isSelected());

    final boolean isChildrenExpression = myRbExpressionChildrenRenderer.isSelected();
    myChildrenExpandedEditor.setEnabled(isChildrenExpression);
    myExpandedLabel.setEnabled(isChildrenExpression);
    myChildrenEditor.setEnabled(isChildrenExpression);
    myTable.setEnabled(myRbListChildrenRenderer.isSelected());
  }
 private void flushDataTo(final CompoundReferenceRenderer renderer) { // label
   LabelRenderer labelRenderer = null;
   if (myRbExpressionLabel.isSelected()) {
     labelRenderer = new LabelRenderer();
     labelRenderer.setLabelExpression(myLabelEditor.getText());
   }
   renderer.setLabelRenderer(labelRenderer);
   // children
   ChildrenRenderer childrenRenderer = null;
   if (myRbExpressionChildrenRenderer.isSelected()) {
     childrenRenderer = new ExpressionChildrenRenderer();
     ((ExpressionChildrenRenderer) childrenRenderer)
         .setChildrenExpression(myChildrenEditor.getText());
     ((ExpressionChildrenRenderer) childrenRenderer)
         .setChildrenExpandable(myChildrenExpandedEditor.getText());
   } else if (myRbListChildrenRenderer.isSelected()) {
     childrenRenderer = new EnumerationChildrenRenderer(getTableModel().getExpressions());
   }
   renderer.setChildrenRenderer(childrenRenderer);
   // classname
   renderer.setClassName(myClassNameField.getText());
 }
 private void updateEnabledItems() {
   if (myRbExisting.isSelected()) {
     myExistingListsCombo.setEnabled(true);
     UIUtil.setEnabled(myNewListPanel, false, true);
     myExistingListsCombo.requestFocus();
   } else {
     myExistingListsCombo.setEnabled(false);
     UIUtil.setEnabled(myNewListPanel, true, true);
     myNewListPanel.requestFocus();
   }
   if (myProject != null) {
     myNewListPanel.nameChangedImpl(myProject, null);
   }
 }
 protected boolean isMoveToPackage() {
   return myHavePackages || myToPackageRadioButton.isSelected();
 }
 public JComponent getPreferredFocusedComponent() {
   return myRbExisting.isSelected()
       ? myExistingListsCombo
       : myNewListPanel.getPreferredFocusedComponent();
 }