本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
};
});
}
}
示例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());
}
示例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;
}
示例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 "";
}
示例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
}
}
示例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);
}
}
示例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);
}
}
}
}