/** * {@inheritDoc} * * @see org.eclipse.emf.eef.modelingBot.IModelingBot#removeProject(java.lang.String) */ public void removeProject(String projectName) { final SWTBotTreeItem treeItem = selectInProjectExplorer(projectName); SWTBotHelper.clickContextMenu(treeItem, UIConstants.DELETE_MENU); checkBox().select(); button(UIConstants.OK_BUTTON).click(); SWTBotHelper.waitAllUiEvents(); sleep(3000); }
/** * Remove referenceableObject. * * @param referenceableObject */ private void remove(ReferenceableObject referenceableObject) { assertNotNull("The editeur is not opened.", editor); final EObject container = getEObjectFromReferenceableEObject(referenceableObject); assertNotNull("No container is found to launch add action.", container); final SWTBotTreeItem selectNode = selectNode(editor, container); assertNotNull("No element is selected in the editor", selectNode); SWTBotHelper.clickContextMenu(selectNode, UIConstants.DELETE_MENU); SWTBotHelper.waitAllUiEvents(); }
/** * Add ReferenceableObject. * * @param referenceableObject * @param eContainingFeature * @return */ private EObject add( ReferenceableObject referenceableObject, final EStructuralFeature eContainingFeature) { assertNotNull("The editeur is not opened.", editor); final EObject container = getEObjectFromReferenceableEObject(referenceableObject); assertNotNull("No container is found to launch add action.", container); final SWTBotTreeItem selectNode = selectNode(editor, container); assertNotNull("No element is selected in the editor", selectNode); SWTBotHelper.clickContextMenu(selectNode, eContainingFeature.getEType().getName()); SWTBotHelper.waitAllUiEvents(); return (EObject) EEFModelHelper.eGet(container, eContainingFeature); }
/** * Add PropertiesEditionElement. * * @param propertiesEditionElement * @param referenceableObject * @return */ private EObject add( PropertiesEditionElement propertiesEditionElement, ReferenceableObject referenceableObject) { SWTBotHelper.waitAllUiEvents(); assertNotNull("The editeur is not opened.", editor); final EObject container = getEObjectFromReferenceableEObject(referenceableObject); assertNotNull("No container is found to launch wizard.", container); SWTBotHelper.waitAllUiEvents(); final SWTBotTreeItem selectNode = selectNode(editor, container); assertNotNull("No element is selected in the editor", selectNode); initTab(propertiesEditionElement); assertFalse("The set action must be define in a sequence.", sequenceType == null); propertiesEdition.addFeature(selectNode, propertiesEditionElement, sequenceType); SWTBotHelper.waitAllUiEvents(); return (EObject) EEFModelHelper.eGet(container, propertiesEditionElement.getModel()); }
/** * Remove propertiesEditionElement. * * @param propertiesEditionElement * @param referenceableObject */ private void removePropertiesEditionElement( PropertiesEditionElement propertiesEditionElement, ReferenceableObject referenceableObject) { SWTBotHelper.waitAllUiEvents(); assertNotNull("The editeur is not opened.", editor); final EObject remove = getEObjectFromReferenceableEObject(referenceableObject); assertNotNull("Element to remove does not exist.", remove); final EObject container = remove.eContainer(); assertNotNull("The container of the element to remove does not exist.", container); SWTBotHelper.waitAllUiEvents(); final SWTBotTreeItem selectNode = selectNode(editor, container); assertNotNull("No element is selected in the editor", selectNode); initTab(propertiesEditionElement); assertFalse("The set action must be define in a sequence.", sequenceType == null); propertiesEdition.removeFeature(remove, propertiesEditionElement, sequenceType); SWTBotHelper.waitAllUiEvents(); }
/** * {@inheritDoc} * * @see * org.eclipse.emf.eef.modelingBot.IModelingBot#set(org.eclipse.emf.eef.components.PropertiesEditionElement, * org.eclipse.emf.eef.extended.editor.ReferenceableObject, * org.eclipse.emf.ecore.EStructuralFeature, java.lang.String) */ public void set( PropertiesEditionElement propertiesEditionElement, ReferenceableObject referenceableObject, EStructuralFeature eContainingFeature, String value) { SWTBotHelper.waitAllUiEvents(); assertNotNull("The properties edition element is not set.", propertiesEditionElement); assertNotNull("The editeur is not opened.", editor); final EObject container = getEObjectFromReferenceableEObject(referenceableObject); assertNotNull("No container is found to launch add action.", container); SWTBotHelper.waitAllUiEvents(); assertFalse("The set action must be define in a sequence.", sequenceType == null); if (sequenceType.equals(SequenceType.DETAILS_PAGE)) { final SWTBotTreeItem selectNode = selectNode(editor, container); assertNotNull("No element is selected in the editor", selectNode); initTab(propertiesEditionElement); propertiesEdition.updateFeature(selectNode, propertiesEditionElement, value, sequenceType); } else if (sequenceType.equals(SequenceType.WIZARD)) { propertiesEdition.updateFeature(null, propertiesEditionElement, value, sequenceType); } }
/** * Open eef editor. * * @param path * @param modelName */ private void openWithEEFEditor(String path, String modelName) { final SWTBotTree wizardTree = viewByTitle(UIConstants.PACKAGE_EXPLORER_VIEW_NAME).bot().tree(); final SWTBotTreeItem treeItem = wizardTree.expandNode(path).expandNode(modelName).select(); SWTBotHelper.clickContextMenu(treeItem, UIConstants.OPEN_WITH_INTERACTIVE_EEF_EDITOR_MENU); }
/** * {@inheritDoc} * * @see org.eclipse.emf.eef.modelingBot.IModelingBot#save() */ public void save() { SWTBotHelper.waitAllUiEvents(); sleep(1000); menu(UIConstants.FILE_MENU).menu(UIConstants.SAVE_MENU).click(); }
/** * {@inheritDoc} * * @see org.eclipse.emf.eef.modelingBot.IModelingBot#openEEFEditor(java.lang.String) */ public void openEEFEditor(String path) { final SWTBotTreeItem treeItem = selectInProjectExplorer(path); SWTBotHelper.clickContextMenu(treeItem, UIConstants.INTERACTIVE_EEF_EDITOR_MENU); }
/** * {@inheritDoc} * * @see org.eclipse.emf.eef.modelingBot.IModelingBot#closeProject(java.lang.String) */ public void closeProject(String projectName) { final SWTBotTreeItem treeItem = selectInProjectExplorer(projectName); SWTBotHelper.clickContextMenu(treeItem, UIConstants.CLOSE_PROJECT_MENU); }