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


Java IItemPropertySource类代码示例

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


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

示例1: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:DwprofileEditor.java

示例2: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HyexpressionEditor.java

示例3: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HyvalidityformulaEditor.java

示例4: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HydatavalueEditor.java

示例5: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HymappingEditor.java

示例6: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HyconstraintsEditor.java

示例7: getPropertySheetPage

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public IPropertySheetPage getPropertySheetPage() {
	if (propertySheetPage == null) {
		propertySheetPage = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPropertySheetPage();
		// add a slightly modified adapter factory that does not return any editors for
		// properties. this way, a model can never be modified through the properties view.
		AdapterFactory adapterFactory = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAdapterFactoryProvider().getAdapterFactory();
		propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) {
			protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) {
				return new PropertySource(object, itemPropertySource) {
					protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
						return new PropertyDescriptor(object, itemPropertyDescriptor) {
							public CellEditor createPropertyEditor(Composite composite) {
								return null;
							}
						};
					}
				};
			}
		});
		highlighting.addSelectionChangedListener(propertySheetPage);
	}
	return propertySheetPage;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:24,代码来源:HymanifestEditor.java

示例8: CombinedProperty

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public CombinedProperty(final Object parent, final Object child,
    final String childName)
{
  this.parentObject = parent;
  this.childObject = child;
  this.childName = childName;

  parentItemPropertySource =
      (IItemPropertySource) adapterFactory.adapt(parent,
          IItemPropertySource.class);
  parentPropertySource = new PropertySource(parent, parentItemPropertySource);

  childItemPropertySource =
      (IItemPropertySource) adapterFactory.adapt(child,
          IItemPropertySource.class);
  childPropertySource = new PropertySource(child, childItemPropertySource);

}
 
开发者ID:debrief,项目名称:limpet,代码行数:19,代码来源:CombinedProperty.java

示例9: storeProperties

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
/** utility class to add all properties to supplied list
 * 
 * @param result
 * @param object
 * @param source
 * @param name
 */
private static void storeProperties(
    final Collection<IPropertyDescriptor> result, final Object object,
    final IItemPropertySource source, final String name)
{
  for (IItemPropertyDescriptor itemPropertyDescriptor : source
      .getPropertyDescriptors(object))
  {
    result.add(new PropertyDescriptor(object, itemPropertyDescriptor)
    {
      public String getCategory()
      {
        return name;
      };

    });
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:25,代码来源:CombinedProperty.java

示例10: getFeatureDescriptor

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
/**
 * Given an object and one of its EStructuralFeatures, return the property descriptor for the feature. Assumes that the
 * PropertyDescriptor's propertyID is the EStructuralFeature's name.
 * 
 * @param object
 * @param feature
 * @return the property descriptor for the feature
 */
public static IItemPropertyDescriptor getFeatureDescriptor(Object object, EStructuralFeature feature) {
	IItemPropertySource source = adapt(object, IItemPropertySource.class);
	if (source == null) {
		String objectName = null;
		if (object instanceof EObject) {
			objectName = getDisplayName((EObject)object);
		} else if (object == null) {
			objectName = "null";
		} else {
			objectName = object.toString();
		}
		LogUtil.warnOnce("Could not find a property source for " + objectName);
		return null;
	}
	return source.getPropertyDescriptor(object, feature.getName());
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:25,代码来源:EMFUtils.java

示例11: getDisplayName

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public static String getDisplayName(EObject target, EStructuralFeature feature) {
	String displayName = getAnnotation(feature, ANNOTATION_SOURCE_DETAIL, ANNOTATION_DETAIL_DISPLAY_NAME);
	if (displayName == null) {
		displayName = getAnnotation(feature, ANNOTATION_SOURCE_DESCRIPTOR, ANNOTATION_DESCRIPTOR_DISPLAY_NAME);
	}
	if (displayName == null) {
		IItemPropertySource source = adapt(target, IItemPropertySource.class);
		if (source != null) {
			IItemPropertyDescriptor itemPropertyDescriptor = source.getPropertyDescriptor(target, feature);
			if (itemPropertyDescriptor != null) {
				displayName = itemPropertyDescriptor.getDisplayName(feature);
			}
		}
	}
	if (displayName == null) {
		displayName = feature.getName();
	}
	return displayName;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:20,代码来源:EMFUtils.java

示例12: getReferenceParameter

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
private static String getReferenceParameter(EPlanElement ePlanElement, EReferenceParameter eStructuralFeature) {
	IItemPropertySource source = EMFUtils.adapt(ePlanElement, IItemPropertySource.class);
	IItemPropertyDescriptor startPD = source.getPropertyDescriptor(ePlanElement, eStructuralFeature);
	// First check the instance name
	if (startPD != null) {
		Object value = EMFUtils.getPropertyValue(startPD, ePlanElement);
		if (value != null && StringifierRegistry.hasRegisteredStringifier(eStructuralFeature.getName())) {
			IStringifier stringifier = StringifierRegistry.getStringifier(eStructuralFeature.getName());
			return stringifier.getDisplayString(value);
		}
		if(value instanceof EcoreEList) {
			List<String> valueList = new ArrayList<String>();
			for (Object o : ((EcoreEList) value).toArray()) {
				valueList.add(getChoiceText(eStructuralFeature, o));
			}
			return EEnumStringifier.formatString(valueList.toString());
		}
	}
	return "";
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:TooltipShellBuilder.java

示例13: EditTableDialog

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
protected EditTableDialog(Shell parentShell, String title, IStructuredSelection selection, EditingDomain domain, FormToolkit toolkit) {
	super(parentShell);
	this.title = title;
	this.toolkit = toolkit;
	AdapterFactory domainAdapterFactory = EMFUtils.getAdapterFactory(domain);
	List elements = selection.toList();
	if (elements.size() == 1) {
		this.target = (EObject) elements.get(0); 
		this.source = (IItemPropertySource) domainAdapterFactory.adapt(target, IItemPropertySource.class);
	} else if (elements.size() > 1) {
		this.source = new MultiItemIntersectionPropertySource(elements);
		this.target = new MultiEObject(elements, (MultiItemPropertySource) source);
	} else {
		// do nothing if there's nothing selected in the table
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:17,代码来源:TableBindingFactory.java

示例14: createReferenceBinding

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
private void createReferenceBinding(Composite parent, EObject target, IItemPropertyDescriptor pd, EReference reference) {
  // Check to see if the EClassifier would like to be displayed
  // in detail. May want to reserve this for EReference types in
  // the future, and should probably check if the object has its
  // own IItemPropertySource
  if (EMFUtils.testBooleanAnnotation(reference, EMFDetailUtils.ANNOTATION_SOURCE_DETAIL, ANNOTATION_DETAIL_INSPECT_REFERENCE)) {
  	if (EMFUtils.testBooleanAnnotation(reference, EMFDetailUtils.ANNOTATION_SOURCE_DETAIL, ANNOTATION_DETAIL_INSPECT_REFLECTIVELY)) {
 			ReflectiveItemProviderAdapterFactory ripaf = new ReflectiveItemProviderAdapterFactory();
 			EObject eObject = (EObject)target.eGet(reference);
 			IItemPropertySource source = (IItemPropertySource) ripaf.adapt(eObject, IItemPropertySource.class);
 			if (source != null) {
 				List<IItemPropertyDescriptor> pds = source.getPropertyDescriptors(eObject);
 				String displayName = pd.getDisplayName(eObject);
		buildPropertySection(parent, eObject, pds, displayName, null);
 			}
  		return;
  	}
inspectReferenceFeature(parent, target, reference);
  } else if (EMFUtils.testBooleanAnnotation(reference, EMFDetailUtils.ANNOTATION_SOURCE_DETAIL, ANNOTATION_DETAIL_TABLE)) {
  	DetailProviderParameter parameter = createDetailProviderParameter(parent, target, pd);
  	EMFDetailUtils.TABLE_BINDING_FACTORY.createBinding(parameter);
  } else {
  	createEditor(parent, target, pd);
  }
 }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:26,代码来源:EMFDetailFormPart.java

示例15: MultiItemUnionPropertySource

import org.eclipse.emf.edit.provider.IItemPropertySource; //导入依赖的package包/类
public MultiItemUnionPropertySource(List<? extends EObject> eObjects) {
	for (EObject eObject : eObjects) {
		Map<IItemPropertyDescriptor, List<EObject>> pdsMap = new LinkedHashMap<IItemPropertyDescriptor, List<EObject>>();
		IItemPropertySource source = EMFUtils.adapt(eObject, IItemPropertySource.class);
		if (source != null) {
			List<IItemPropertyDescriptor> pds = getDescriptors(eObject, source);
			for (IItemPropertyDescriptor pd : pds) {
				List<IItemPropertyDescriptor> compatible = new ArrayList<IItemPropertyDescriptor>();
				compatible.add(0, pd);
				pdsMap.put(pd, Collections.singletonList(eObject));
				MultiItemPropertyDescriptor thisPD = new MultiItemPropertyDescriptor(compatible, pdsMap);
				final Object feature = thisPD.getFeature(null);
				pdsByID.put(feature, thisPD);
				filteredItemPropertyDescriptors.add(thisPD);
			}
		}
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:19,代码来源:MultiItemUnionPropertySource.java


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