ui: Added Java project setup UI

This commit is contained in:
Eberhard Graether
2016-08-17 13:12:26 +02:00
parent 566cface6c
commit a3001b2b72
30 changed files with 329 additions and 176 deletions
-2
View File
@@ -315,8 +315,6 @@ add_files(
utility/solution/ISolutionParser.h
utility/solution/SolutionParserCodeBlocks.cpp
utility/solution/SolutionParserCodeBlocks.h
utility/solution/SolutionParserEclipse.cpp
utility/solution/SolutionParserEclipse.h
utility/solution/SolutionParserManager.cpp
utility/solution/SolutionParserManager.h
utility/solution/SolutionParserUtility.cpp
+2 -2
View File
@@ -64,7 +64,7 @@ void Project::refresh()
{
if (allowsRefresh())
{
bool loadedSettings = getProjectSettings()->load();
bool loadedSettings = getProjectSettings()->reload();
updateFileManager(m_fileManager);
@@ -112,7 +112,7 @@ Project::Project(StorageAccessProxy* storageAccessProxy)
void Project::load()
{
const std::shared_ptr<ProjectSettings> projectSettings = getProjectSettings();
bool loadedSettings = projectSettings->load();
bool loadedSettings = projectSettings->reload();
if (loadedSettings)
{
const FilePath projectSettingsPath = projectSettings->getFilePath();
@@ -47,7 +47,11 @@ void CodeController::handleMessage(MessageActivateAll* message)
statsSnippet.locationFile = std::make_shared<TokenLocationFile>(FilePath());
statsSnippet.locationFile->isWholeCopy = true;
statsSnippet.title = Application::getInstance()->getCurrentProject()->getProjectSettingsFilePath().withoutExtension().fileName();
Project* currentProject = Application::getInstance()->getCurrentProject().get();
if (currentProject)
{
statsSnippet.title = currentProject->getProjectSettingsFilePath().withoutExtension().fileName();
}
std::vector<std::string> description = getProjectDescription(statsSnippet.locationFile.get());
@@ -662,8 +666,13 @@ std::shared_ptr<TokenLocationFile> CodeController::getTokenLocationOfParentScope
std::vector<std::string> CodeController::getProjectDescription(TokenLocationFile* locationFile) const
{
std::string description = Application::getInstance()->getCurrentProject()->getDescription();
Project* currentProject = Application::getInstance()->getCurrentProject().get();
if (!currentProject)
{
return std::vector<std::string>();
}
std::string description = currentProject->getDescription();
if (!description.size())
{
return std::vector<std::string>();
+37
View File
@@ -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";
}
+3
View File
@@ -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
+10
View File
@@ -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";
}
+5 -1
View File
@@ -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
+15 -4
View File
@@ -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 "";
}
+4 -1
View File
@@ -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
@@ -1,11 +0,0 @@
#ifndef SOLUTION_PARSER_ECLIPSE_H
#define SOLUTION_PARSER_ECLIPSE_H
#include "ISolutionParser.h"
class SolutionParserEclipse
{
};
#endif // SOLUTION_PARSER_ECLIPSE_H