Search in sources :

Example 1 with DMNDiagramSelected

use of org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected in project kie-wb-common by kiegroup.

the class DRDNameChangerView method onClickReturnToDRG.

@EventHandler("returnToDRG")
void onClickReturnToDRG(final ClickEvent event) {
    hideDRDNameChanger();
    selectedEvent.fire(new DMNDiagramSelected(dmnDiagramsSession.getDRGDiagramElement()));
}
Also used : DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected) EventHandler(org.jboss.errai.ui.shared.api.annotations.EventHandler)

Example 2 with DMNDiagramSelected

use of org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected in project kie-wb-common by kiegroup.

the class DRDNameChangerView method performSave.

private void performSave(final DMNDiagramElement dmnDiagramElement) {
    dmnDiagramElement.getName().setValue(drdNameInput.getValue());
    selectedEvent.fire(new DMNDiagramSelected(dmnDiagramElement));
}
Also used : DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected)

Example 3 with DMNDiagramSelected

use of org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected in project kie-wb-common by kiegroup.

the class DRDContextMenuService method addToExistingDRD.

public void addToExistingDRD(final DMNDiagramTuple dmnDiagram, final Collection<Node<? extends Definition<?>, Edge>> selectedNodes) {
    selectedNodes.forEach(addNodesToDRD(dmnDiagram.getDMNDiagram(), dmnDiagram.getStunnerDiagram()));
    selectedEvent.fire(new DMNDiagramSelected(dmnDiagram.getDMNDiagram()));
}
Also used : DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected)

Example 4 with DMNDiagramSelected

use of org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected in project kie-wb-common by kiegroup.

the class DRDContextMenuService method removeFromCurrentDRD.

public void removeFromCurrentDRD(final Collection<Node<? extends Definition<?>, Edge>> selectedNodes) {
    final Diagram diagram = dmnDiagramsSession.getCurrentDiagram().orElse(dmnDiagramsSession.getDRGDiagram());
    selectedNodes.forEach(node -> diagram.getGraph().removeNode(node.getUUID()));
    dmnDiagramsSession.getCurrentDMNDiagramElement().ifPresent(dmnDiagramElement -> selectedEvent.fire(new DMNDiagramSelected(dmnDiagramElement)));
}
Also used : DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) DMNDiagram(org.kie.workbench.common.dmn.api.definition.model.DMNDiagram)

Example 5 with DMNDiagramSelected

use of org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected in project kie-wb-common by kiegroup.

the class DRDContextMenuService method addToNewDRD.

public void addToNewDRD(final Collection<Node<? extends Definition<?>, Edge>> selectedNodes) {
    final DMNDiagramElement dmnElement = makeDmnDiagramElement();
    final Diagram stunnerElement = buildStunnerElement(dmnElement);
    selectedNodes.forEach(addNodesToDRD(dmnElement, stunnerElement));
    addDmnDiagramElementToDRG(dmnElement);
    dmnDiagramsSession.add(dmnElement, stunnerElement);
    selectedEvent.fire(new DMNDiagramSelected(dmnElement));
}
Also used : DMNDiagramElement(org.kie.workbench.common.dmn.api.definition.model.DMNDiagramElement) DMNDiagramSelected(org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) DMNDiagram(org.kie.workbench.common.dmn.api.definition.model.DMNDiagram)

Aggregations

DMNDiagramSelected (org.kie.workbench.common.dmn.client.docks.navigator.drds.DMNDiagramSelected)6 DMNDiagram (org.kie.workbench.common.dmn.api.definition.model.DMNDiagram)2 Diagram (org.kie.workbench.common.stunner.core.diagram.Diagram)2 EventHandler (org.jboss.errai.ui.shared.api.annotations.EventHandler)1 Test (org.junit.Test)1 DMNDiagramElement (org.kie.workbench.common.dmn.api.definition.model.DMNDiagramElement)1