logic: Refactored undo redo stack

* Store MessageActivateTokens instead of original view messages
* Renamed FeatureController to ActivationController
* Remove all non-activation messages from undo redo stack after reindexing project
* Added MessageShowReference to undo redo stack
* Added MessageScrollGraph for restoring graph view scroll position
* Fixed MessageGraphNodeMove not saved for bundles
* Refactored tokenIds and nodeNames in SearchMatch and MessageActivateTokens
* Refactored SearchController
* Fixed file expansion on undoing/redoing after switching code view mode
* Fixed redundant graph animation due to present qualifier nodes
* Fixed no restoring of graph node expansion when showing overview in between
This commit is contained in:
Eberhard Graether
2017-03-16 23:24:33 +01:00
parent aa49fffca6
commit 630009a2ba
44 changed files with 516 additions and 400 deletions
+3 -1
View File
@@ -44,6 +44,9 @@ public:
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const = 0;
virtual bool checkNodeExistsByName(const std::string& serializedName) const = 0;
virtual std::vector<NameHierarchy> getNameHierarchiesForNodeIds(const std::vector<Id> nodeIds) const = 0;
virtual std::vector<Id> getNodeIdsForNameHierarchies(const std::vector<NameHierarchy> nameHierarchies) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getFullTextSearchLocations(
const std::string& searchTerm, bool caseSensitive) const = 0;
virtual std::vector<SearchMatch> getAutocompletionMatches(const std::string& query) const = 0;
@@ -57,7 +60,6 @@ public:
virtual std::vector<Id> getNodeIdsForLocationIds(const std::vector<Id>& locationIds) const = 0;
virtual std::vector<Id> getLocalSymbolIdsForLocationIds(const std::vector<Id>& locationIds) const = 0;
virtual std::vector<Id> getTokenIdsForMatches(const std::vector<SearchMatch>& matches) const = 0;
virtual Id getTokenIdForFileNode(const FilePath& filePath) const = 0;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(
+26 -18
View File
@@ -77,6 +77,16 @@ bool StorageAccessProxy::checkEdgeExists(Id edgeId) const
return false;
}
NameHierarchy StorageAccessProxy::getNameHierarchyForNodeWithId(Id id) const
{
if (hasSubject())
{
return m_subject->getNameHierarchyForNodeWithId(id);
}
return NameHierarchy();
}
Node::NodeType StorageAccessProxy::getNodeTypeForNodeWithId(Id id) const
{
if (hasSubject())
@@ -95,24 +105,22 @@ bool StorageAccessProxy::checkNodeExistsByName(const std::string& serializedName
return false;
}
NameHierarchy StorageAccessProxy::getNameHierarchyForNodeWithId(Id id) const
std::vector<NameHierarchy> StorageAccessProxy::getNameHierarchiesForNodeIds(const std::vector<Id> nodeIds) const
{
if (hasSubject())
{
return m_subject->getNameHierarchyForNodeWithId(id);
return m_subject->getNameHierarchiesForNodeIds(nodeIds);
}
return NameHierarchy();
return std::vector<NameHierarchy>();
}
std::vector<SearchMatch> StorageAccessProxy::getAutocompletionMatches(const std::string& query) const
std::vector<Id> StorageAccessProxy::getNodeIdsForNameHierarchies(const std::vector<NameHierarchy> nameHierarchies) const
{
if (hasSubject())
{
return m_subject->getAutocompletionMatches(query);
return m_subject->getNodeIdsForNameHierarchies(nameHierarchies);
}
return std::vector<SearchMatch>();
return std::vector<Id>();
}
std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getFullTextSearchLocations(
@@ -126,6 +134,16 @@ std::shared_ptr<TokenLocationCollection> StorageAccessProxy::getFullTextSearchLo
return std::make_shared<TokenLocationCollection>();
}
std::vector<SearchMatch> StorageAccessProxy::getAutocompletionMatches(const std::string& query) const
{
if (hasSubject())
{
return m_subject->getAutocompletionMatches(query);
}
return std::vector<SearchMatch>();
}
std::vector<SearchMatch> StorageAccessProxy::getSearchMatchesForTokenIds(const std::vector<Id>& tokenIds) const
{
if (hasSubject())
@@ -186,16 +204,6 @@ std::vector<Id> StorageAccessProxy::getLocalSymbolIdsForLocationIds(const std::v
return std::vector<Id>();
}
std::vector<Id> StorageAccessProxy::getTokenIdsForMatches(const std::vector<SearchMatch>& matches) const
{
if (hasSubject())
{
return m_subject->getTokenIdsForMatches(matches);
}
return std::vector<Id>();
}
Id StorageAccessProxy::getTokenIdForFileNode(const FilePath& filePath) const
{
if (hasSubject())
+3 -1
View File
@@ -29,6 +29,9 @@ public:
virtual Node::NodeType getNodeTypeForNodeWithId(Id id) const;
virtual bool checkNodeExistsByName(const std::string& serializedName) const;
virtual std::vector<NameHierarchy> getNameHierarchiesForNodeIds(const std::vector<Id> nodeIds) const;
virtual std::vector<Id> getNodeIdsForNameHierarchies(const std::vector<NameHierarchy> nameHierarchies) const;
virtual std::shared_ptr<TokenLocationCollection> getFullTextSearchLocations(
const std::string& searchTerm, bool caseSensitive) const;
virtual std::vector<SearchMatch> getAutocompletionMatches(const std::string& query) const;
@@ -42,7 +45,6 @@ public:
virtual std::vector<Id> getNodeIdsForLocationIds(const std::vector<Id>& locationIds) const;
virtual std::vector<Id> getLocalSymbolIdsForLocationIds(const std::vector<Id>& locationIds) const;
virtual std::vector<Id> getTokenIdsForMatches(const std::vector<SearchMatch>& matches) const;
virtual Id getTokenIdForFileNode(const FilePath& filePath) const;
virtual std::shared_ptr<TokenLocationCollection> getTokenLocationsForTokenIds(