mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[patch]: style- rename field and change min common ancestor to be a directory
This commit is contained in:
+4
-4
@@ -61,7 +61,7 @@ public class CreatePatchConfigurationPanel {
|
||||
private ComboBox<Charset> myEncoding;
|
||||
private JLabel myWarningLabel;
|
||||
private final Project myProject;
|
||||
@Nullable private File myCommonParentPath;
|
||||
@Nullable private File myCommonParentDir;
|
||||
|
||||
public CreatePatchConfigurationPanel(@NotNull final Project project) {
|
||||
myProject = project;
|
||||
@@ -126,7 +126,7 @@ public class CreatePatchConfigurationPanel {
|
||||
}
|
||||
|
||||
public void setCommonParentPath(@Nullable File commonParentPath) {
|
||||
myCommonParentPath = commonParentPath;
|
||||
myCommonParentDir = commonParentPath == null || commonParentPath.isDirectory() ? commonParentPath : commonParentPath.getParentFile();
|
||||
}
|
||||
|
||||
private void checkExist() {
|
||||
@@ -168,8 +168,8 @@ public class CreatePatchConfigurationPanel {
|
||||
if (StringUtil.isEmptyOrSpaces(baseDirName)) return new ValidationInfo("Base path can't be empty!", myBasePathField);
|
||||
File baseFile = new File(baseDirName);
|
||||
if (!baseFile.exists()) return new ValidationInfo("Base dir doesn't exist", myBasePathField);
|
||||
if (myCommonParentPath != null && !FileUtil.isAncestor(baseFile, myCommonParentPath, false)) {
|
||||
return new ValidationInfo(String.format("Base path doesn't contain all selected changes (use %s)", myCommonParentPath.getPath()),
|
||||
if (myCommonParentDir != null && !FileUtil.isAncestor(baseFile, myCommonParentDir, false)) {
|
||||
return new ValidationInfo(String.format("Base path doesn't contain all selected changes (use %s)", myCommonParentDir.getPath()),
|
||||
myBasePathField);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user