當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。