use of org.eclipse.emf.edit.provider.IItemPropertySource in project tdi-studio-se by Talend.
the class EditAction method run.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
Shell shell = ShellUtil.getShell();
if (shell != null) {
IItemPropertySource itemPropertySource = EmfPropertyHelper.getItemPropertySource(adapterFactory, eObject);
IItemPropertyDescriptor itemPropertyDescriptor = EmfPropertyHelper.getItemPropertyDescriptor(itemPropertySource, eObject, structuralFeature);
if (itemPropertySource != null) {
EditAction.EditDialog editDialog = new EditDialog(shell, adapterFactory, itemPropertyDescriptor, eObject);
if (editDialog.open() == Dialog.OK) {
itemPropertyDescriptor.setPropertyValue(eObject, editDialog.getValue());
}
}
}
}
use of org.eclipse.emf.edit.provider.IItemPropertySource in project tdi-studio-se by Talend.
the class AssignmentPropertySection method getItemPropertyDescriptor.
private IItemPropertyDescriptor getItemPropertyDescriptor() {
// PTODO mhelleboid find another way to itempropertysource without an eobject
BusinessAssignment sampleBusinessAssignment = BusinessFactory.eINSTANCE.createBusinessAssignment();
EStructuralFeature businessAssignment_Comment = BusinessPackage.eINSTANCE.getBusinessAssignment_Comment();
IItemPropertySource itemPropertySource = EmfPropertyHelper.getItemPropertySource(adapterFactory, sampleBusinessAssignment);
return EmfPropertyHelper.getItemPropertyDescriptor(itemPropertySource, sampleBusinessAssignment, businessAssignment_Comment);
}
use of org.eclipse.emf.edit.provider.IItemPropertySource in project tdi-studio-se by Talend.
the class EmfPropertyHelper method getValue.
/**
* DOC mhelleboid Comment method "getValue".
*
* @param itemPropertyDescriptor TODO
* @param eObject TODO
* @return
*/
public static String getValue(IItemPropertyDescriptor itemPropertyDescriptor, Object eObject) {
//$NON-NLS-1$
String value = "";
Object propertyValue = itemPropertyDescriptor.getPropertyValue(eObject);
if (propertyValue instanceof IItemPropertySource) {
IItemPropertySource propertyValueWrapper = (IItemPropertySource) propertyValue;
value = propertyValueWrapper.getEditableValue(eObject).toString();
}
return value;
}
use of org.eclipse.emf.edit.provider.IItemPropertySource in project tdi-studio-se by Talend.
the class BusinessAssignmentComposite method getItemPropertyDescriptor.
private IItemPropertyDescriptor getItemPropertyDescriptor() {
// PTODO mhelleboid find another way to itempropertysource without an eobject
BusinessAssignment sampleBusinessAssignment = BusinessFactory.eINSTANCE.createBusinessAssignment();
EStructuralFeature businessAssignment_Comment = BusinessPackage.eINSTANCE.getBusinessAssignment_Comment();
IItemPropertySource itemPropertySource = EmfPropertyHelper.getItemPropertySource(adapterFactory, sampleBusinessAssignment);
return EmfPropertyHelper.getItemPropertyDescriptor(itemPropertySource, sampleBusinessAssignment, businessAssignment_Comment);
}
use of org.eclipse.emf.edit.provider.IItemPropertySource in project tdi-studio-se by Talend.
the class EmfPropertyHelper method getValue.
/**
* DOC mhelleboid Comment method "getValue".
*
* @param itemPropertyDescriptor TODO
* @param eObject TODO
* @return
*/
public static String getValue(IItemPropertyDescriptor itemPropertyDescriptor, Object eObject) {
//$NON-NLS-1$
String value = "";
Object propertyValue = itemPropertyDescriptor.getPropertyValue(eObject);
if (propertyValue instanceof IItemPropertySource) {
IItemPropertySource propertyValueWrapper = (IItemPropertySource) propertyValue;
value = propertyValueWrapper.getEditableValue(eObject).toString();
}
return value;
}
Aggregations