use of org.kie.workbench.common.stunner.core.client.canvas.controls.select.SelectionControl in project kie-wb-common by kiegroup.
the class FormsCanvasSessionHandler method show.
@SuppressWarnings("unchecked")
public void show(final Command callback) {
if (null != session) {
// Obtain first element selected on session, if any.
String selectedItemUUID = null;
final SelectionControl selectionControl = featuresSessionProvider.getSelectionControl(session);
if (null != selectionControl) {
final Collection<String> selectedItems = selectionControl.getSelectedItems();
if (null != selectedItems && !selectedItems.isEmpty()) {
selectedItemUUID = selectedItems.iterator().next();
}
} else {
LOGGER.log(Level.WARNING, "Cannot show properties as session type does not provides " + "selection control's support.");
}
if (null == selectedItemUUID) {
final Diagram<?, ?> diagram = getDiagram();
if (null != diagram) {
final String cRoot = diagram.getMetadata().getCanvasRootUUID();
// Check if there exist any canvas root element.
if (!isEmpty(cRoot)) {
selectedItemUUID = cRoot;
}
}
}
if (null != selectedItemUUID) {
render(selectedItemUUID, callback);
}
}
}
use of org.kie.workbench.common.stunner.core.client.canvas.controls.select.SelectionControl in project kie-wb-common by kiegroup.
the class CaseManagementCanvasFactoryTest method testControls.
@Test
public void testControls() {
ConnectionAcceptorControl connectionAcceptorControl = factory.newControl(ConnectionAcceptorControl.class);
assertNotNull(connectionAcceptorControl);
ContainmentAcceptorControl containmentAcceptorControl = factory.newControl(ContainmentAcceptorControl.class);
assertNotNull(containmentAcceptorControl);
DockingAcceptorControl dockingAcceptorControl = factory.newControl(DockingAcceptorControl.class);
assertNotNull(dockingAcceptorControl);
CanvasInPlaceTextEditorControl canvasInPlaceTextEditorControl = factory.newControl(CanvasInPlaceTextEditorControl.class);
assertNotNull(canvasInPlaceTextEditorControl);
SelectionControl selectionControl = factory.newControl(SelectionControl.class);
assertNotNull(selectionControl);
ElementBuilderControl elementBuilderControl = factory.newControl(ElementBuilderControl.class);
assertNotNull(elementBuilderControl);
NodeBuilderControl nodeBuilderControl = factory.newControl(NodeBuilderControl.class);
assertNotNull(nodeBuilderControl);
EdgeBuilderControl edgeBuilderControl = factory.newControl(EdgeBuilderControl.class);
assertNotNull(edgeBuilderControl);
ZoomControl zoomControl = factory.newControl(ZoomControl.class);
assertNotNull(zoomControl);
PanControl panControl = factory.newControl(PanControl.class);
assertNotNull(panControl);
KeyboardControl keyboardControl = factory.newControl(KeyboardControl.class);
assertNotNull(keyboardControl);
}
Aggregations