当前位置: 首页>>代码示例>>Java>>正文


Java VideoCassette类代码示例

本文整理汇总了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$
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:15,代码来源:VideoCassetteItemProvider.java

示例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);
}
 
开发者ID:mbarbero,项目名称:econ-na-2014-emf-edit,代码行数:60,代码来源:MyLibrary.java


注:本文中的org.eclipse.emf.examples.extlibrary.VideoCassette类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。