Search in sources :

Example 1 with WSMenuE

use of org.talend.mdm.repository.model.mdmserverobject.WSMenuE in project tmdm-studio-se by Talend.

the class WSMenuItemImpl method setWsMenu.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setWsMenu(WSMenuE newWsMenu) {
    WSMenuE oldWsMenu = wsMenu;
    wsMenu = newWsMenu;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, MdmpropertiesPackage.WS_MENU_ITEM__WS_MENU, oldWsMenu, wsMenu));
    }
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) WSMenuE(org.talend.mdm.repository.model.mdmserverobject.WSMenuE)

Example 2 with WSMenuE

use of org.talend.mdm.repository.model.mdmserverobject.WSMenuE in project tmdm-studio-se by Talend.

the class NewMenuAction method newBlankMenu.

private WSMenuE newBlankMenu(String key) {
    WSMenuMenuEntriesDescriptionsE descriptions = MdmserverobjectFactory.eINSTANCE.createWSMenuMenuEntriesDescriptionsE();
    descriptions.setLabel(key);
    // $NON-NLS-1$
    descriptions.setLanguage("en");
    // 
    WSMenuEntryE entry = MdmserverobjectFactory.eINSTANCE.createWSMenuEntryE();
    entry.getDescriptions().add(descriptions);
    entry.setId(key);
    // 
    WSMenuE menu = MdmserverobjectFactory.eINSTANCE.createWSMenuE();
    menu.setName(key);
    menu.getMenuEntries().add(entry);
    // 
    return menu;
}
Also used : WSMenuMenuEntriesDescriptionsE(org.talend.mdm.repository.model.mdmserverobject.WSMenuMenuEntriesDescriptionsE) WSMenuEntryE(org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE) WSMenuE(org.talend.mdm.repository.model.mdmserverobject.WSMenuE)

Example 3 with WSMenuE

use of org.talend.mdm.repository.model.mdmserverobject.WSMenuE in project tmdm-studio-se by Talend.

the class NewMenuAction method createServerObject.

@Override
protected Item createServerObject(String key) {
    WSMenuItem item = MdmpropertiesFactory.eINSTANCE.createWSMenuItem();
    ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
    item.setState(itemState);
    // 
    WSMenuE menu = newBlankMenu(key);
    item.setWsMenu(menu);
    if (parentItem != null) {
        item.getState().setPath(parentItem.getState().getPath());
        RepositoryResourceUtil.createItem(item, key);
    }
    return item;
}
Also used : WSMenuItem(org.talend.mdm.repository.model.mdmproperties.WSMenuItem) ItemState(org.talend.core.model.properties.ItemState) WSMenuE(org.talend.mdm.repository.model.mdmserverobject.WSMenuE)

Example 4 with WSMenuE

use of org.talend.mdm.repository.model.mdmserverobject.WSMenuE in project tmdm-studio-se by Talend.

the class Bean2EObjUtilTest method testConvertFromBean2EObj.

/**
 * Test method for {@link Bean2EObjUtil#convertFromBean2EObj(java.lang.Object)}.
 */
@Test
public void testConvertFromBean2EObj() {
    WSMenu menu = new WSMenu();
    initBean(menu);
    Bean2EObjUtil util = Bean2EObjUtil.getInstance();
    util.registerClassMap(WSMenu.class);
    EObject eObject = util.convertFromBean2EObj(menu, null);
    assertNotNull(eObject);
    WSMenuE menuE = (WSMenuE) eObject;
    // 
    assertEquals(menu.getName(), menuE.getName());
    assertEquals(menu.getDescription(), menuE.getDescription());
    // 
    List<WSMenuEntry> menuEntries = menu.getMenuEntries();
    EList<WSMenuEntryE> menuEntriesE = menuE.getMenuEntries();
    for (int i = 0; i < menuEntries.size(); i++) {
        checkMenuEntry(menuEntries.get(i), menuEntriesE.get(i));
    }
}
Also used : WSMenu(com.amalto.workbench.webservices.WSMenu) EObject(org.eclipse.emf.ecore.EObject) WSMenuE(org.talend.mdm.repository.model.mdmserverobject.WSMenuE) WSMenuEntryE(org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE) WSMenuEntry(com.amalto.workbench.webservices.WSMenuEntry) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 5 with WSMenuE

use of org.talend.mdm.repository.model.mdmserverobject.WSMenuE in project tmdm-studio-se by Talend.

the class Bean2EObjUtilTest method testConvertFromEObj2Bean.

@Test
public void testConvertFromEObj2Bean() {
    WSMenuE menuE = MdmserverobjectFactory.eINSTANCE.createWSMenuE();
    initEObject(menuE);
    // 
    Bean2EObjUtil util = Bean2EObjUtil.getInstance();
    util.registerClassMap(WSMenu.class);
    WSMenu menu = (WSMenu) util.convertFromEObj2Bean(menuE);
    assertNotNull(menu);
    // 
    assertEquals(menu.getName(), menuE.getName());
    assertEquals(menu.getDescription(), menuE.getDescription());
    List<WSMenuEntry> menuEntries = menu.getMenuEntries();
    EList<WSMenuEntryE> menuEntriesE = menuE.getMenuEntries();
    for (int i = 0; i < menuEntries.size(); i++) {
        checkMenuEntry(menuEntries.get(i), menuEntriesE.get(i));
    }
}
Also used : WSMenu(com.amalto.workbench.webservices.WSMenu) WSMenuE(org.talend.mdm.repository.model.mdmserverobject.WSMenuE) WSMenuEntryE(org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE) WSMenuEntry(com.amalto.workbench.webservices.WSMenuEntry) Test(org.junit.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

WSMenuE (org.talend.mdm.repository.model.mdmserverobject.WSMenuE)6 WSMenuEntryE (org.talend.mdm.repository.model.mdmserverobject.WSMenuEntryE)3 WSMenu (com.amalto.workbench.webservices.WSMenu)2 WSMenuEntry (com.amalto.workbench.webservices.WSMenuEntry)2 EObject (org.eclipse.emf.ecore.EObject)2 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 Test (org.junit.Test)2 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)2 URI (org.eclipse.emf.common.util.URI)1 InternalEObject (org.eclipse.emf.ecore.InternalEObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 ItemState (org.talend.core.model.properties.ItemState)1 WSMenuItem (org.talend.mdm.repository.model.mdmproperties.WSMenuItem)1 WSMenuMenuEntriesDescriptionsE (org.talend.mdm.repository.model.mdmserverobject.WSMenuMenuEntriesDescriptionsE)1