• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java IElementType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.gmf.runtime.emf.type.core.IElementType的典型用法代码示例。如果您正苦于以下问题:Java IElementType类的具体用法?Java IElementType怎么用?Java IElementType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IElementType类属于org.eclipse.gmf.runtime.emf.type.core包,在下文中一共展示了IElementType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(Transition newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	configureRequest.setParameter(CreateRelationshipRequest.SOURCE,
			getSource());
	configureRequest.setParameter(CreateRelationshipRequest.TARGET,
			getTarget());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:23,代码来源:TransitionCreateCommand.java


示例2: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(State newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:19,代码来源:StateCreateCommand.java


示例3: getElement

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * Returns 'type' of the ecore object associated with the hint.
 * 
 * @generated
 */
public static ENamedElement getElement(IAdaptable hint) {
	Object type = hint.getAdapter(IElementType.class);
	if (elements == null) {
		elements = new IdentityHashMap<IElementType, ENamedElement>();

		elements.put(Statemachine_1000,
				StatemachinePackage.eINSTANCE.getStatemachine());

		elements.put(State_2001, StatemachinePackage.eINSTANCE.getState());

		elements.put(Transition_4001,
				StatemachinePackage.eINSTANCE.getTransition());
	}
	return (ENamedElement) elements.get(type);
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:21,代码来源:StatemachineElementTypes.java


示例4: provides

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected boolean provides(CreateEdgeViewOperation op) {
	IElementType elementType = getSemanticElementType(op
			.getSemanticAdapter());
	if (!StatemachineElementTypes.isKnownElementType(elementType)
			|| (!(elementType instanceof IHintedType))) {
		return false; // foreign element type
	}
	String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
	if (elementTypeHint == null
			|| (op.getSemanticHint() != null && !elementTypeHint.equals(op
					.getSemanticHint()))) {
		return false; // our hint is visual id and must be specified, and it should be the same as in element type
	}
	int visualID = StatemachineVisualIDRegistry
			.getVisualID(elementTypeHint);
	EObject domainElement = getSemanticElement(op.getSemanticAdapter());
	if (domainElement != null
			&& visualID != StatemachineVisualIDRegistry
					.getLinkWithClassVisualID(domainElement)) {
		return false; // visual id for link EClass should match visual id from element type
	}
	return true;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:27,代码来源:StatemachineViewProvider.java


示例5: getImage

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = StatemachineDiagramEditorPlugin
			.getInstance().getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null && elementType != null
			&& StatemachineElementTypes.isKnownElementType(elementType)) {
		image = StatemachineElementTypes.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:20,代码来源:StatemachineNavigatorLabelProvider.java


示例6: getText

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
public String getText(Object element) {
	element = unwrap(element);
	if (element instanceof IGraphicalEditPart) {
		EObject semanticElement = ((IGraphicalEditPart) element)
				.resolveSemanticElement();

		if (semanticElement == null) {
			View view = ((IGraphicalEditPart) element).getNotationView();
			return view.getType();
		} else {

			IElementType elementType = ElementTypeRegistry.getInstance()
					.getElementType(semanticElement);
			StringBuilder builder = new StringBuilder();
			builder.append(elementType.getDisplayName());
			if (semanticElement instanceof NamedElement
					&& ((NamedElement) semanticElement).getName() != null) {
				builder.append(' ');
				builder.append(((NamedElement) semanticElement).getName());
			}
			return builder.toString();
		}
	}
	return null;
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:26,代码来源:SheetLabelProvider.java


示例7: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(ExternalFactLink newElement,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	configureRequest.setParameter(CreateRelationshipRequest.SOURCE,
			getSource());
	configureRequest.setParameter(CreateRelationshipRequest.TARGET,
			getTarget());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:24,代码来源:ExternalFactLinkCreateCommand.java


示例8: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(
		au.edu.swin.ict.road.designer.smc.SMC newElement,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:21,代码来源:SMCCreateCommand.java


示例9: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(Player newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:19,代码来源:PlayerCreateCommand.java


示例10: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(FactLink newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	configureRequest.setParameter(CreateRelationshipRequest.SOURCE,
			getSource());
	configureRequest.setParameter(CreateRelationshipRequest.TARGET,
			getTarget());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:23,代码来源:FactLink2CreateCommand.java


示例11: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(Contract newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:19,代码来源:ContractCreateCommand.java


示例12:

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
public List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/getMATypesForTarget(
		IElementType relationshipType) {
	List/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/types = new ArrayList/*<org.eclipse.gmf.runtime.emf.type.core.IElementType>*/();
	if (relationshipType == SmcElementTypes.ContractRoleAID_4001) {
		types.add(SmcElementTypes.Role_3001);
	}
	if (relationshipType == SmcElementTypes.ContractRoleBID_4002) {
		types.add(SmcElementTypes.Role_3001);
	}
	if (relationshipType == SmcElementTypes.FactLink_4003) {
		types.add(SmcElementTypes.Fact_3003);
	}
	if (relationshipType == SmcElementTypes.FactLink_4006) {
		types.add(SmcElementTypes.Fact_3003);
	}
	return types;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:21,代码来源:ContractEditPart.java


示例13: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(SimpleBPMN.OR newElement,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:20,代码来源:ORCreateCommand.java


示例14: isKnownElementType

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
public static boolean isKnownElementType(IElementType elementType) {
	if (KNOWN_ELEMENT_TYPES == null) {
		KNOWN_ELEMENT_TYPES = new HashSet();
		KNOWN_ELEMENT_TYPES.add(System_1000);
		KNOWN_ELEMENT_TYPES.add(SMC_2001);
		KNOWN_ELEMENT_TYPES.add(Player_2002);
		KNOWN_ELEMENT_TYPES.add(Role_3001);
		KNOWN_ELEMENT_TYPES.add(Contract_3002);
		KNOWN_ELEMENT_TYPES.add(Fact_3003);
		KNOWN_ELEMENT_TYPES.add(ContractRoleAID_4001);
		KNOWN_ELEMENT_TYPES.add(ContractRoleBID_4002);
		KNOWN_ELEMENT_TYPES.add(FactLink_4003);
		KNOWN_ELEMENT_TYPES.add(FactLink_4006);
		KNOWN_ELEMENT_TYPES.add(PlayerBinding_4004);
		KNOWN_ELEMENT_TYPES.add(ExternalFactLink_4005);
	}
	return KNOWN_ELEMENT_TYPES.contains(elementType);
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:22,代码来源:SmcElementTypes.java


示例15: provides

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected boolean provides(CreateEdgeViewOperation op) {
	IElementType elementType = getSemanticElementType(op
			.getSemanticAdapter());
	if (!SmcElementTypes.isKnownElementType(elementType)
			|| (!(elementType instanceof IHintedType))) {
		return false; // foreign element type
	}
	String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
	if (elementTypeHint == null
			|| (op.getSemanticHint() != null && !elementTypeHint.equals(op
					.getSemanticHint()))) {
		return false; // our hint is visual id and must be specified, and it should be the same as in element type
	}
	int visualID = SmcVisualIDRegistry.getVisualID(elementTypeHint);
	EObject domainElement = getSemanticElement(op.getSemanticAdapter());
	if (domainElement != null
			&& visualID != SmcVisualIDRegistry
					.getLinkWithClassVisualID(domainElement)) {
		return false; // visual id for link EClass should match visual id from element type
	}
	return true;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:26,代码来源:SmcViewProvider.java


示例16: getTypesForSource

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
public List getTypesForSource(IAdaptable target,
		IElementType relationshipType) {
	IGraphicalEditPart targetEditPart = (IGraphicalEditPart) target
			.getAdapter(IGraphicalEditPart.class);
	if (targetEditPart instanceof SMCEditPart) {
		return ((SMCEditPart) targetEditPart)
				.getMATypesForSource(relationshipType);
	}
	if (targetEditPart instanceof PlayerEditPart) {
		return ((PlayerEditPart) targetEditPart)
				.getMATypesForSource(relationshipType);
	}
	if (targetEditPart instanceof RoleEditPart) {
		return ((RoleEditPart) targetEditPart)
				.getMATypesForSource(relationshipType);
	}
	if (targetEditPart instanceof FactEditPart) {
		return ((FactEditPart) targetEditPart)
				.getMATypesForSource(relationshipType);
	}
	return Collections.EMPTY_LIST;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:26,代码来源:SmcModelingAssistantProvider.java


示例17: getImage

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
private Image getImage(String key, IElementType elementType) {
	ImageRegistry imageRegistry = SmcDiagramEditorPlugin.getInstance()
			.getImageRegistry();
	Image image = imageRegistry.get(key);
	if (image == null && elementType != null
			&& SmcElementTypes.isKnownElementType(elementType)) {
		image = SmcElementTypes.getImage(elementType);
		imageRegistry.put(key, image);
	}

	if (image == null) {
		image = imageRegistry.get("Navigator?ImageNotFound"); //$NON-NLS-1$
		imageRegistry.put(key, image);
	}
	return image;
}
 
开发者ID:road-framework,项目名称:ROADDesigner,代码行数:20,代码来源:SmcNavigatorLabelProvider.java


示例18: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(Team newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:19,代码来源:TeamCreateCommand.java


示例19: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(EliminationMatch newElement,
		IProgressMonitor monitor, IAdaptable info)
		throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:20,代码来源:EliminationMatchCreateCommand.java


示例20: doConfigure

import org.eclipse.gmf.runtime.emf.type.core.IElementType; //导入依赖的package包/类
/**
 * @generated
 */
protected void doConfigure(GroupMatch newElement, IProgressMonitor monitor,
		IAdaptable info) throws ExecutionException {
	IElementType elementType = ((CreateElementRequest) getRequest())
			.getElementType();
	ConfigureRequest configureRequest = new ConfigureRequest(
			getEditingDomain(), newElement, elementType);
	configureRequest.setClientContext(((CreateElementRequest) getRequest())
			.getClientContext());
	configureRequest.addParameters(getRequest().getParameters());
	ICommand configureCommand = elementType
			.getEditCommand(configureRequest);
	if (configureCommand != null && configureCommand.canExecute()) {
		configureCommand.execute(monitor, info);
	}
}
 
开发者ID:ggxx,项目名称:HelloBrazil,代码行数:19,代码来源:GroupMatchCreateCommand.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TabInfo类代码示例发布时间:2022-05-22
下一篇:
Java ExactFileNameMatcher类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap