X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.platform.ui.ontology%2Fscl%2FSimantics%2FPlatformUI.scl;fp=bundles%2Forg.simantics.platform.ui.ontology%2Fgraph%2Fscl%2FSCLMain.scl;h=07309cb7b2876ea7a233439edea2e57d00e5c0d9;hb=refs%2Fchanges%2F50%2F3150%2F4;hp=44c53d80e4cfa35e9320f51ae3b93227eac94dbe;hpb=0c70b45a35685e50a219dbd4946a2d3caa332f8e;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.platform.ui.ontology/graph/scl/SCLMain.scl b/bundles/org.simantics.platform.ui.ontology/scl/Simantics/PlatformUI.scl similarity index 54% rename from bundles/org.simantics.platform.ui.ontology/graph/scl/SCLMain.scl rename to bundles/org.simantics.platform.ui.ontology/scl/Simantics/PlatformUI.scl index 44c53d80e..07309cb7b 100644 --- a/bundles/org.simantics.platform.ui.ontology/graph/scl/SCLMain.scl +++ b/bundles/org.simantics.platform.ui.ontology/scl/Simantics/PlatformUI.scl @@ -1,5 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2019 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + * Semantum Oy - reorganization + *******************************************************************************/ include "Simantics/All" include "SWT/All" +import "UI/Progress" +import "Simantics/IssueUI" useSelectedHandler :: Variable -> (String -> Maybe String) -> String useSelectedHandler input parameters = do @@ -84,4 +98,48 @@ standardPropertiesElementTransformation var = do Nothing -> var Just component -> resourceVariable component else var - \ No newline at end of file + +configureButtonClickHandler :: Resource -> CommandContext -> Maybe CommandResult +configureButtonClickHandler indexRoot context = do + showIssueConfigurationDialog indexRoot + Nothing + +configureButtonClick :: Variable -> AbstractEventHandler +configureButtonClick self = do + indexRoot = represents $ contextVariable self + eventHandler2 $ configureButtonClickHandler indexRoot + +validateButtonClickHandler :: Resource -> CommandContext -> Maybe CommandResult +validateButtonClickHandler indexRoot context = do + runActiveValidations (createNullProgressMonitor ()) indexRoot + Nothing + +validateButtonClick :: Variable -> AbstractEventHandler +validateButtonClick self = do + indexRoot = represents $ contextVariable self + eventHandler2 $ validateButtonClickHandler indexRoot + +issueSourceExplorerCheckHandler :: Resource -> CommandContext -> Maybe CommandResult +issueSourceExplorerCheckHandler indexRoot context = match possibleValue context "item" with + Nothing -> Nothing + Just issueSource -> match possibleValue context "checked" with + Nothing -> Nothing + Just value -> if value then do + syncWrite $ \_ -> claim issueSource ISSUE.IssueSource.Selected (parent issueSource) + Nothing + else do + syncWrite $ \_ -> denyByPredicate issueSource ISSUE.IssueSource.Selected + Nothing + +issueSourceExplorerCheck :: Variable -> AbstractEventHandler +issueSourceExplorerCheck self = do + indexRoot = represents $ contextVariable self + eventHandler2 $ issueSourceExplorerCheckHandler indexRoot + +usedIssueSources :: Resource -> [Resource] +usedIssueSources indexRoot = do + objectsWithType indexRoot L0.ConsistsOf ISSUE.IssueSource + +checkedStateRule :: BrowseNodeRule CheckedState +checkedStateRule (ResourceX r) = if existsStatement3 r ISSUE.IssueSource.Selected (parent r) then CHECKED else NOT_CHECKED + \ No newline at end of file