本文整理汇总了Java中org.eclipse.emf.examples.extlibrary.VideoCassette类的典型用法代码示例。如果您正苦于以下问题:Java VideoCassette类的具体用法?Java VideoCassette怎么用?Java VideoCassette使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VideoCassette类属于org.eclipse.emf.examples.extlibrary包,在下文中一共展示了VideoCassette类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getText
import org.eclipse.emf.examples.extlibrary.VideoCassette; //导入依赖的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 = ((VideoCassette)object).getTitle();
return label == null || label.length() == 0 ?
getString("_UI_VideoCassette_type") : //$NON-NLS-1$
getString("_UI_VideoCassette_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
}
示例2: init
import org.eclipse.emf.examples.extlibrary.VideoCassette; //导入依赖的package包/类
private void init() {
factory = EXTLibraryFactory.eINSTANCE;
library = factory.createLibrary();
library.setName("Alexandria");
library.setAddress("Alexandria, Egypt");
Writer tolkien = factory.createWriter();
tolkien.setFirstName("J.R.R.");
tolkien.setLastName("Tolkien");
library.getWriters().add(tolkien);
Book book = factory.createBook();
book.setTitle("The Lord of the Ring — The Fellowship of the Ring");
book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
book.setPages(564);
book.setAuthor(tolkien);
Calendar pubdate = Calendar.getInstance();
pubdate.set(1954, 6, 29);
book.setPublicationDate(pubdate.getTime());
library.getBooks().add(book);
book = factory.createBook();
book.setTitle("The Lord of the Ring — The Two Towers");
book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
book.setPages(523);
book.setAuthor(tolkien);
pubdate = Calendar.getInstance();
pubdate.set(1954, 10, 11);
book.setPublicationDate(pubdate.getTime());
library.getBooks().add(book);
book = factory.createBook();
book.setTitle("The Lord of the Ring — The Return of the King");
book.setCategory(BookCategory.SCIENCE_FICTION_LITERAL);
book.setPages(639);
book.setAuthor(tolkien);
pubdate = Calendar.getInstance();
pubdate.set(1955, 9, 20);
book.setPublicationDate(pubdate.getTime());
library.getBooks().add(book);
VideoCassette videoK7 = factory.createVideoCassette();
videoK7.setTitle("Tapes are vintage, then they are hype");
videoK7.setDamaged(true);
videoK7.setCopies(3);
pubdate = Calendar.getInstance();
pubdate.set(1983, 3, 7);
videoK7.setPublicationDate(pubdate.getTime());
library.getStock().add(videoK7);
resourceSet = new ResourceSetImpl();
resource = new ResourceImpl(URI.createURI("demo.xmi"));
resource.getContents().add(library);
resourceSet.getResources().add(resource);
ResourceImpl extlibraryEcore = new ResourceImpl(URI.createURI("extlibrary.ecore"));
extlibraryEcore.getContents().add(EXTLibraryPackage.eINSTANCE);
resourceSet.getResources().add(extlibraryEcore);
}