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));
}
}
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;
}
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;
}
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));
}
}
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));
}
}
Aggregations