X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=org.simantics.district.selection%2Fscl%2FSimantics%2FDistrict%2FSelection.scl;h=861af9533b860b9089c797801798abe50bc6dae9;hb=9de17a229b42cfe7f133fe593ca28619ffd50250;hp=4f1d2705e4a8b114cdccfa35c2b20b08d0914b98;hpb=77fb2992f4eab37919e21af7f24a70a0a6ecc336;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.selection/scl/Simantics/District/Selection.scl b/org.simantics.district.selection/scl/Simantics/District/Selection.scl index 4f1d2705..861af953 100644 --- a/org.simantics.district.selection/scl/Simantics/District/Selection.scl +++ b/org.simantics.district.selection/scl/Simantics/District/Selection.scl @@ -27,13 +27,27 @@ importJava "org.simantics.district.selection.ElementSelector" where @JavaName getResource getSelectorResource :: ElementSelector -> Resource - """ - Get the elements selected by an element selector object. - - `selectedElements = selectElementsFrom elementSelector model` - """ @JavaName selectElementsFrom - selectElementsFrom :: ElementSelector -> Resource -> [Resource] + selectElementsFrom' :: ElementSelector -> Resource -> SelectionResult + +""" +Get the elements selected by an element selector object. + +`selectedElements = selectElementsFrom elementSelector model` +""" +selectElementsFrom :: ElementSelector -> Resource -> [Resource] +selectElementsFrom s r = selectedElements $ selectElementsFrom' s r + +importJava "org.simantics.district.selection.ElementSelector$SelectionResult" where + data SelectionResult + + "Get the list of selected elements" + @JavaName elements + selectedElements :: SelectionResult -> [Resource] + "Number of selected elements with equal selection criteria (for n lowest/n highest selections)" + tailCount :: SelectionResult -> Integer + "Actual number of elements with selection criteria equal to the last selected element (for n lowest/n highest selections)" + tailSize :: SelectionResult -> Integer data Generator = Model | Diagram Resource | Explicit [Resource] data Selector = All | NLowest String Integer | NHighest String Integer