use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class FileUtils method displayDirectoryContents.
@NotNull
public static List<String> displayDirectoryContents(@NotNull File projectRoot, @NotNull File dir, @NotNull FilenameFilter filter) {
List<String> ret = listFiles(projectRoot, dir, filter);
File[] files = dir.listFiles();
for (final File file : files) {
if (file.isDirectory()) {
ret.addAll(displayDirectoryContents(projectRoot, file, filter));
// } else {
// listFiles(file, filter, allFiles);
}
}
return ret;
}
use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class FileUtils method findExeFilesInPath.
@NotNull
private static List<File> findExeFilesInPath(@Nullable String pathEnvVarValue, @NotNull String fileBaseName, boolean stopAfterFirstMatch, boolean logDetails) {
if (logDetails) {
LOG.info("Finding files in PATH (base name=" + fileBaseName + ", PATH=" + StringUtil.notNullize(pathEnvVarValue) + ").");
}
if (pathEnvVarValue == null) {
return Collections.emptyList();
}
List<File> result = new SmartList<File>();
List<String> paths = StringUtil.split(pathEnvVarValue, File.pathSeparator, true, true);
for (String path : paths) {
File dir = new File(path);
if (logDetails) {
File file = new File(dir, fileBaseName);
LOG.info("path:" + path + ", path.isAbsolute:" + dir.isAbsolute() + ", path.isDirectory:" + dir.isDirectory() + ", file.isFile:" + file.isFile() + ", file.canExecute:" + file.canExecute());
}
if (dir.isAbsolute() && dir.isDirectory()) {
File file = new File(dir, fileBaseName);
if (file.isFile() && file.canExecute()) {
result.add(file);
if (stopAfterFirstMatch) {
return result;
}
}
}
}
return result;
}
use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class ScssLintProjectComponent method validationFailed.
private void validationFailed(String msg) {
NotificationListener notificationListener = new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
ScssLintInspection.showSettings(project);
}
};
String errorMessage = msg + FIX_CONFIG_HREF;
showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
LOG.debug(msg);
settingValidStatus = false;
}
use of org.jetbrains.annotations.NotNull in project scss-lint-plugin by idok.
the class ScssLintSettingsPage method configESLintBinField.
private void configESLintBinField() {
TextFieldWithHistory textFieldWithHistory = scssLintExeField.getChildComponent();
textFieldWithHistory.setHistorySize(-1);
textFieldWithHistory.setMinimumAndPreferredWidth(0);
SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
@NotNull
public List<String> produce() {
// File projectRoot = new File(project.getBaseDir().getPath());
//searchForESLintBin(projectRoot);
List<File> newFiles = ScssLintFinder.findAllScssLintExe();
return FileUtils.toAbsolutePath(newFiles);
}
});
SwingHelper.installFileCompletionAndBrowseDialog(project, scssLintExeField, "Select SCSS Lint Exe", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
use of org.jetbrains.annotations.NotNull in project android-selector-intellij-plugin by importre.
the class AndroidSelectorDialog method parseColorsXml.
@NotNull
private HashMap<String, String> parseColorsXml(VirtualFile colorsXml) {
HashMap<String, String> map = new LinkedHashMap<String, String>();
try {
NodeList colors = getColorNodes(colorsXml.getInputStream());
makeColorMap(colors, map);
} catch (Exception e) {
e.printStackTrace();
}
return map;
}
Aggregations