ui: Added Java project setup UI
This commit is contained in:
@@ -36,6 +36,38 @@ bool CxxProjectSettings::equalsExceptNameAndLocation(const ProjectSettings& othe
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> CxxProjectSettings::getLanguageStandards() const
|
||||
{
|
||||
std::vector<std::string> standards;
|
||||
|
||||
switch (getLanguage())
|
||||
{
|
||||
case LANGUAGE_CPP:
|
||||
standards.push_back("1z");
|
||||
standards.push_back("14");
|
||||
standards.push_back("1y");
|
||||
standards.push_back("11");
|
||||
standards.push_back("0x");
|
||||
standards.push_back("03");
|
||||
standards.push_back("98");
|
||||
break;
|
||||
|
||||
case LANGUAGE_C:
|
||||
standards.push_back("1x");
|
||||
standards.push_back("11");
|
||||
standards.push_back("9x");
|
||||
standards.push_back("99");
|
||||
standards.push_back("90");
|
||||
standards.push_back("89");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return standards;
|
||||
}
|
||||
|
||||
std::vector<FilePath> CxxProjectSettings::getHeaderSearchPaths() const
|
||||
{
|
||||
return getPathValues("source/header_search_paths/header_search_path");
|
||||
@@ -122,3 +154,8 @@ std::vector<std::string> CxxProjectSettings::getDefaultSourceExtensions() const
|
||||
defaultValues.push_back(".cc");
|
||||
return defaultValues;
|
||||
}
|
||||
|
||||
std::string CxxProjectSettings::getDefaultStandard() const
|
||||
{
|
||||
return "1z";
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ public:
|
||||
|
||||
virtual bool equalsExceptNameAndLocation(const ProjectSettings& other) const;
|
||||
|
||||
virtual std::vector<std::string> getLanguageStandards() const;
|
||||
|
||||
std::vector<FilePath> getHeaderSearchPaths() const;
|
||||
std::vector<FilePath> getAbsoluteHeaderSearchPaths() const;
|
||||
bool setHeaderSearchPaths(const std::vector<FilePath>& headerSearchPaths);
|
||||
@@ -35,6 +37,7 @@ public:
|
||||
|
||||
private:
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const;
|
||||
virtual std::string getDefaultStandard() const;
|
||||
};
|
||||
|
||||
#endif // CXX_PROJECT_SETTINGS_H
|
||||
|
||||
@@ -36,6 +36,11 @@ bool JavaProjectSettings::equalsExceptNameAndLocation(const ProjectSettings& oth
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::string> JavaProjectSettings::getLanguageStandards() const
|
||||
{
|
||||
return std::vector<std::string>(1, "8");
|
||||
}
|
||||
|
||||
std::vector<FilePath> JavaProjectSettings::getClasspaths() const
|
||||
{
|
||||
return getPathValues("source/class_paths/class_path");
|
||||
@@ -60,3 +65,8 @@ std::vector<std::string> JavaProjectSettings::getDefaultSourceExtensions() const
|
||||
defaultValues.push_back(".java");
|
||||
return defaultValues;
|
||||
}
|
||||
|
||||
std::string JavaProjectSettings::getDefaultStandard() const
|
||||
{
|
||||
return "8";
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
|
||||
#include "settings/ProjectSettings.h"
|
||||
|
||||
class JavaProjectSettings: public ProjectSettings
|
||||
class JavaProjectSettings
|
||||
: public ProjectSettings
|
||||
{
|
||||
public:
|
||||
JavaProjectSettings();
|
||||
@@ -13,12 +14,15 @@ public:
|
||||
|
||||
virtual bool equalsExceptNameAndLocation(const ProjectSettings& other) const;
|
||||
|
||||
virtual std::vector<std::string> getLanguageStandards() const;
|
||||
|
||||
std::vector<FilePath> getClasspaths() const;
|
||||
std::vector<FilePath> getAbsoluteClasspaths() const;
|
||||
bool setClasspaths(const std::vector<FilePath>& headerSearchPaths);
|
||||
|
||||
private:
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const;
|
||||
virtual std::string getDefaultStandard() const;
|
||||
};
|
||||
|
||||
#endif // JAVA_PROJECT_SETTINGS_H
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
LanguageType ProjectSettings::getLanguageOfProject(FilePath projectFilePath)
|
||||
{
|
||||
ProjectSettings tempSettings(projectFilePath);
|
||||
tempSettings.load();
|
||||
ProjectSettings tempSettings;
|
||||
tempSettings.load(projectFilePath);
|
||||
return tempSettings.getLanguage();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,12 @@ bool ProjectSettings::equalsExceptNameAndLocation(const ProjectSettings& other)
|
||||
);
|
||||
}
|
||||
|
||||
bool ProjectSettings::load()
|
||||
std::vector<std::string> ProjectSettings::getLanguageStandards() const
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
bool ProjectSettings::reload()
|
||||
{
|
||||
return Settings::load(getFilePath());
|
||||
}
|
||||
@@ -82,7 +87,7 @@ bool ProjectSettings::setLanguage(LanguageType language)
|
||||
|
||||
std::string ProjectSettings::getStandard() const
|
||||
{
|
||||
return getValue<std::string>("language_settings/standard", "1z");
|
||||
return getValue<std::string>("language_settings/standard", getDefaultStandard());
|
||||
}
|
||||
|
||||
bool ProjectSettings::setStandard(const std::string& standard)
|
||||
@@ -152,3 +157,9 @@ std::vector<std::string> ProjectSettings::getDefaultSourceExtensions() const
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
std::string ProjectSettings::getDefaultStandard() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ public:
|
||||
|
||||
virtual bool equalsExceptNameAndLocation(const ProjectSettings& other) const;
|
||||
|
||||
virtual bool load();
|
||||
virtual std::vector<std::string> getLanguageStandards() const;
|
||||
|
||||
bool reload();
|
||||
|
||||
std::string getProjectName() const;
|
||||
void setProjectName(const std::string& name);
|
||||
@@ -52,6 +54,7 @@ protected:
|
||||
|
||||
private:
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const;
|
||||
virtual std::string getDefaultStandard() const;
|
||||
};
|
||||
|
||||
#endif // PROJECT_SETTINGS_H
|
||||
|
||||
Reference in New Issue
Block a user