本文整理汇总了Java中org.eclipse.gmf.runtime.emf.type.core.IElementType类的典型用法代码示例。如果您正苦于以下问题:Java IElementType类的具体用法?Java IElementType怎么用?Java IElementType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IElementType类属于org.eclipse.gmf.runtime.emf.type.core包,在下文中一共展示了IElementType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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;
}