mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-8762 Several improvements in pluggable panels of "Open Task" dialog
* Better validation messages from VcsOpenTaskPanel that always indicate problematic control * Preferred focused component from VcsOpenTaskPanel is taken into account
This commit is contained in:
@@ -155,6 +155,12 @@ public class OpenTaskDialog extends DialogWrapper {
|
||||
|
||||
@Override
|
||||
public JComponent getPreferredFocusedComponent() {
|
||||
for (TaskDialogPanel panel : myPanels) {
|
||||
final JComponent component = panel.getPreferredFocusedComponent();
|
||||
if (component != null) {
|
||||
return component;
|
||||
}
|
||||
}
|
||||
if (myTaskStateCombo.isVisible() && myTaskStateCombo.isEnabled()){
|
||||
return myTaskStateCombo.getComboBox();
|
||||
}
|
||||
|
||||
@@ -186,10 +186,10 @@ public class VcsOpenTaskPanel extends TaskDialogPanel {
|
||||
else if (myVcsTaskHandler != null) {
|
||||
return myVcsTaskHandler.isBranchNameValid(branchName)
|
||||
? null
|
||||
: new ValidationInfo("Branch name is not valid; check your vcs branch name restrictions.");
|
||||
: new ValidationInfo("Branch name is not valid; check your vcs branch name restrictions.", myBranchName);
|
||||
}
|
||||
else if (branchName.contains(" ")) {
|
||||
return new ValidationInfo("Branch name should not contain spaces");
|
||||
return new ValidationInfo("Branch name should not contain spaces", myBranchName);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@@ -197,7 +197,7 @@ public class VcsOpenTaskPanel extends TaskDialogPanel {
|
||||
}
|
||||
if (myCreateChangelist.isSelected()) {
|
||||
if (myChangelistName.getText().trim().isEmpty()) {
|
||||
return new ValidationInfo("Changelist name should not be empty");
|
||||
return new ValidationInfo("Changelist name should not be empty", myChangelistName);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user