Enhancement #5706

Support programmatic tests in modelled browse contexts for determining removability and renameability

Added by Tuukka Lehtonen over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:2015-03-08
Priority:4Due date:2015-03-08
Assignee:Tuukka Lehtonen% Done:

100%

Category:Model browserSpent time:-
Target version:1.18.1
Release notes:Developers: Removability and renameability in Model Browser can now be determined through ActionBrowseContext fir any NodeType. See TestContribution in code and ontology.
Tags: browsing
Story points-
Velocity based estimate-
ReleaseSimantics 1.18.1Release relationshipAuto

Description

Currently Remove/Rename functionality in Model Browser or any other browse-context modelled graph explorer for that matter has a very limited and specialized definition. EntityNodeTypes are always renameable and removability is delegated to Remover implementations (Remover.canRemove). For SpecialNodeTypes there's only this:

    VP.BrowseContext.SupportsRemovalOf MBC.Symbol
    VP.BrowseContext.SupportsRenamingOf MBC.Symbol

which supports no kind of complex input testing.

The purpose of this issue is to implement support for programmatic test contributions aimed at determining removability and renameability of NodeContexts with any NodeType Through org.simantics.browsing.ui.model.actions.ActionBrowseContext.

Associated revisions

Revision 31052
Added by Tuukka Lehtonen over 2 years ago

Added support for programmatic testing contributions for determining removability and renameability of NodeContexts with any NodeType.

The support has been added to ActionBrowseContext.canRemove/canRename.
org.simantics.browsing.ui.model.actions.TestContribution encapsulates a single programmatic test.
ActionBrowseContext.load now also loads VP.RemovalTestContributions and VP.RenamingTestContributions.
All contributions matching a specified NodeContext must return true in order for canRemove and canRename to return true.

The logic for testing the removability / renameability of a NodeContext was previously embedded inside NodePropertyTester.
It has now been separated into org.simantics.browsing.ui.model.queries.IsNodeContext{Modifiable,Removable} requests that NodePropertyTester uses.

Also VP.FailTest and org.simantics.browsing.ui.model.tests.FailTest has been added for simple denial of removal/rename by an ActionBrowseContext.

refs #5706

Revision 31053
Added by Tuukka Lehtonen over 2 years ago

Merged trunk@31052 to branches/simantics-1.18 on 2015-03-08 for 1.18.1 release.

refs #5706

Revision 31163
Added by Tuukka Lehtonen over 2 years ago

Changed ActionBrowseContext.canRename to return true if NodeType cannot be resolved.

This was done because F2 rename functionality in old and highly custom GraphExplorer solutions would be broken due to canRename returning false in such circumstances.

refs #5706

Revision 31164
Added by Tuukka Lehtonen over 2 years ago

Merged trunk@31163 to branches/simantics-1.18 on 2015-04-13 for 1.18.1 release.

refs #5706

Revision 31165
Added by Tuukka Lehtonen over 2 years ago

Merged trunk@31163 to branches/simantics-1.18 on 2015-04-13 for 1.18.1 release.

refs #5706

History

#1 Updated by Tuukka Lehtonen over 2 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100

Hannu/Antti, please review the associated changes so far and provide feedback. Thank you!

#2 Updated by Tuukka Lehtonen over 2 years ago

  • Status changed from Feedback to Closed

#3 Updated by Tuukka Lehtonen over 2 years ago

  • Release notes set to Developers: Removability and renameability in Model Browser can now be determined through ActionBrowseContext fir any NodeType. See TestContribution in code and ontology.

Also available in: Atom PDF