本文整理汇总了Java中org.eclipse.emf.examples.extlibrary.Library类的典型用法代码示例。如果您正苦于以下问题:Java Library类的具体用法?Java Library怎么用?Java Library使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Library类属于org.eclipse.emf.examples.extlibrary包,在下文中一共展示了Library类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setParentBranch
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParentBranch(Library newParentBranch)
{
if (newParentBranch != eInternalContainer() || (eContainerFeatureID() != EXTLibraryPackage.LIBRARY__PARENT_BRANCH && newParentBranch != null))
{
if (EcoreUtil.isAncestor(this, newParentBranch))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParentBranch != null)
msgs = ((InternalEObject)newParentBranch).eInverseAdd(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
msgs = basicSetParentBranch(newParentBranch, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EXTLibraryPackage.LIBRARY__PARENT_BRANCH, newParentBranch, newParentBranch));
}
示例2: eInverseAdd
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__BRANCHES:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getBranches()).basicAdd(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetParentBranch((Library)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
示例3: notifyChanged
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification)
{
updateChildren(notification);
switch (notification.getFeatureID(Library.class)) {
case EXTLibraryPackage.LIBRARY__ADDRESS:
case EXTLibraryPackage.LIBRARY__NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case EXTLibraryPackage.LIBRARY__WRITERS:
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
case EXTLibraryPackage.LIBRARY__BORROWERS:
case EXTLibraryPackage.LIBRARY__STOCK:
case EXTLibraryPackage.LIBRARY__BRANCHES:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
return;
}
super.notifyChanged(notification);
}
示例4: getText
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
@Override
public String getText(Object element) {
if (element instanceof Resource) {
return ((Resource) element).getURI().toString();
} else if (element instanceof EObject) {
EObject eObject = (EObject) element;
EClass eClass = eObject.eClass();
String ret = eClass.getName() + " ";
if (element instanceof Library) {
ret += ((Library) element).getName();
} else if (element instanceof Book) {
ret += ((Book) element).getTitle();
} else if (element instanceof Writer) {
ret += ((Writer) element).getName();
} else {
ret += " [" + element.toString() + "]";
}
return ret;
}
return super.getText(element);
}
示例5: setParentBranch
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParentBranch(Library newParentBranch)
{
if (newParentBranch != eInternalContainer() || (eContainerFeatureID() != EXTLibraryPackage.LIBRARY__PARENT_BRANCH && newParentBranch != null)) {
if (EcoreUtil.isAncestor(this, newParentBranch))
throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newParentBranch != null)
msgs = ((InternalEObject)newParentBranch).eInverseAdd(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
msgs = basicSetParentBranch(newParentBranch, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EXTLibraryPackage.LIBRARY__PARENT_BRANCH, newParentBranch, newParentBranch));
}
示例6: getBranches
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Library> getBranches()
{
if (branches == null)
{
branches = new EObjectContainmentWithInverseEList.Resolving<Library>(Library.class, this, EXTLibraryPackage.LIBRARY__BRANCHES, EXTLibraryPackage.LIBRARY__PARENT_BRANCH);
}
return branches;
}
示例7: eBasicRemoveFromContainerFeature
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
{
switch (eContainerFeatureID())
{
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return eInternalContainer().eInverseRemove(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
示例8: eUnset
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case EXTLibraryPackage.LIBRARY__ADDRESS:
setAddress(ADDRESS_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__NAME:
setName(NAME_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__WRITERS:
getWriters().clear();
return;
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
getEmployees().clear();
return;
case EXTLibraryPackage.LIBRARY__BORROWERS:
getBorrowers().clear();
return;
case EXTLibraryPackage.LIBRARY__STOCK:
getStock().clear();
return;
case EXTLibraryPackage.LIBRARY__BOOKS:
getBooks().clear();
return;
case EXTLibraryPackage.LIBRARY__BRANCHES:
getBranches().clear();
return;
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
setParentBranch((Library)null);
return;
case EXTLibraryPackage.LIBRARY__PEOPLE:
getPeople().clear();
return;
}
super.eUnset(featureID);
}
示例9: getText
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object)
{
String label = ((Library)object).getName();
return label == null || label.length() == 0 ?
getString("_UI_Library_type") : //$NON-NLS-1$
getString("_UI_Library_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
}
示例10: getBranches
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Library> getBranches()
{
if (branches == null) {
branches = new EObjectContainmentWithInverseEList.Resolving<Library>(Library.class, this, EXTLibraryPackage.LIBRARY__BRANCHES, EXTLibraryPackage.LIBRARY__PARENT_BRANCH);
}
return branches;
}
示例11: eInverseAdd
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs)
{
switch (featureID) {
case EXTLibraryPackage.LIBRARY__BRANCHES:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getBranches()).basicAdd(otherEnd, msgs);
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetParentBranch((Library)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
示例12: eBasicRemoveFromContainerFeature
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs)
{
switch (eContainerFeatureID()) {
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
return eInternalContainer().eInverseRemove(this, EXTLibraryPackage.LIBRARY__BRANCHES, Library.class, msgs);
}
return super.eBasicRemoveFromContainerFeature(msgs);
}
示例13: eUnset
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID) {
case EXTLibraryPackage.LIBRARY__ADDRESS:
setAddress(ADDRESS_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__NAME:
setName(NAME_EDEFAULT);
return;
case EXTLibraryPackage.LIBRARY__WRITERS:
getWriters().clear();
return;
case EXTLibraryPackage.LIBRARY__EMPLOYEES:
getEmployees().clear();
return;
case EXTLibraryPackage.LIBRARY__BORROWERS:
getBorrowers().clear();
return;
case EXTLibraryPackage.LIBRARY__STOCK:
getStock().clear();
return;
case EXTLibraryPackage.LIBRARY__BOOKS:
getBooks().clear();
return;
case EXTLibraryPackage.LIBRARY__BRANCHES:
getBranches().clear();
return;
case EXTLibraryPackage.LIBRARY__PARENT_BRANCH:
setParentBranch((Library)null);
return;
case EXTLibraryPackage.LIBRARY__PEOPLE:
getPeople().clear();
return;
}
super.eUnset(featureID);
}
示例14: getParentBranch
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Library getParentBranch()
{
if (eContainerFeatureID() != EXTLibraryPackage.LIBRARY__PARENT_BRANCH) return null;
return (Library)eContainer();
}
示例15: basicGetParentBranch
import org.eclipse.emf.examples.extlibrary.Library; //导入依赖的package包/类
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Library basicGetParentBranch()
{
if (eContainerFeatureID() != EXTLibraryPackage.LIBRARY__PARENT_BRANCH) return null;
return (Library)eInternalContainer();
}