use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.
the class ViewEventViewEventPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ViewEvent viewEvent = (ViewEvent) elt;
final ViewEventPropertiesEditionPart viewEventPart = (ViewEventPropertiesEditionPart) editingPart;
// init values
if (isAccessible(ViewViewsRepository.ViewEvent.Properties.description))
viewEventPart.setDescription(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, viewEvent.getDescription()));
if (isAccessible(ViewViewsRepository.ViewEvent.Properties.name))
viewEventPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, viewEvent.getName()));
if (isAccessible(ViewViewsRepository.ViewEvent.Properties.type)) {
// init part
typeSettings = new EObjectFlatComboSettings(viewEvent, ViewPackage.eINSTANCE.getViewEvent_Type());
viewEventPart.initType(typeSettings);
// set the button mode
viewEventPart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(ViewViewsRepository.ViewEvent.Properties.type)) {
viewEventPart.addFilterToType(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof WidgetEventType);
}
});
// Start of user code for additional businessfilters for type
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.
the class SimpleNamedTypePropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final SimpleNamedType simpleNamedType = (SimpleNamedType) elt;
final SimpleNamedTypePropertiesEditionPart simpleNamedTypePart = (SimpleNamedTypePropertiesEditionPart) editingPart;
// init values
if (isAccessible(TypeslibraryViewsRepository.SimpleNamedType.Properties.name))
simpleNamedTypePart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, simpleNamedType.getName()));
if (isAccessible(TypeslibraryViewsRepository.SimpleNamedType.Properties.type)) {
// init part
typeSettings = new EObjectFlatComboSettings(simpleNamedType, TypesLibraryPackage.eINSTANCE.getSimpleNamedType_Type());
simpleNamedTypePart.initType(typeSettings);
// set the button mode
simpleNamedTypePart.setTypeButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(TypeslibraryViewsRepository.SimpleNamedType.Properties.type)) {
simpleNamedTypePart.addFilterToType(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
return (element instanceof TypeInstance);
}
});
// Start of user code for additional businessfilters for type
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.
the class ForeignKeyElementPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
* @generated NOT
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ForeignKeyElement foreignKeyElement = (ForeignKeyElement) elt;
final ForeignKeyElementPropertiesEditionPart foreignKeyElementPart = (ForeignKeyElementPropertiesEditionPart) editingPart;
// init values
if (foreignKeyElement.getComments() != null && isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.comments))
foreignKeyElementPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, foreignKeyElement.getComments()));
if (isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn)) {
// init part
fkColumnSettings = new EObjectFlatComboSettings(foreignKeyElement, DatabasePackage.eINSTANCE.getForeignKeyElement_FkColumn());
foreignKeyElementPart.initFKColumn(fkColumnSettings);
// set the button mode
foreignKeyElementPart.setFKColumnButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn)) {
// init part
pkColumnSettings = new EObjectFlatComboSettings(foreignKeyElement, DatabasePackage.eINSTANCE.getForeignKeyElement_PkColumn());
foreignKeyElementPart.initPKColumn(pkColumnSettings);
// set the button mode
foreignKeyElementPart.setPKColumnButtonMode(ButtonsModeEnum.BROWSE);
}
// Custom code to prevent NPE when creating new FKElement
ForeignKeyElement fkElt = (ForeignKeyElement) semanticObject;
if (fkElt.getFkColumn() != null) {
if (sourceTableSettings.getValue() != null && isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.sourceTable))
foreignKeyElementPart.setSourceTable(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, sourceTableSettings.getValue()));
} else {
EObject container = fkElt.eContainer();
if (container instanceof ForeignKey) {
Table table = ((ForeignKey) container).getSourceTable();
if (table != null) {
foreignKeyElementPart.setSourceTable(table.getName());
}
}
}
if (fkElt.getPkColumn() != null) {
if (targetTableSettings.getValue() != null && isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.targetTable))
foreignKeyElementPart.setTargetTable(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, targetTableSettings.getValue()));
} else {
EObject container = fkElt.eContainer();
if (container instanceof ForeignKey) {
Table table = ((ForeignKey) container).getTargetTable();
if (table != null) {
foreignKeyElementPart.setTargetTable(table.getName());
}
}
}
if (isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.fKColumn)) {
foreignKeyElementPart.addFilterToFKColumn(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Column);
}
});
// Start of user code for additional businessfilters for fkColumn
// End of user code
}
if (isAccessible(DatabaseViewsRepository.ForeignKeyElement.Properties.pKColumn)) {
foreignKeyElementPart.addFilterToPKColumn(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Column);
}
});
// Start of user code for additional businessfilters for pkColumn
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.
the class ForeignKeyPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final ForeignKey foreignKey = (ForeignKey) elt;
final ForeignKeyPropertiesEditionPart foreignKeyPart = (ForeignKeyPropertiesEditionPart) editingPart;
// init values
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.name))
foreignKeyPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, foreignKey.getName()));
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.target)) {
// init part
targetSettings = new EObjectFlatComboSettings(foreignKey, DatabasePackage.eINSTANCE.getForeignKey_Target());
foreignKeyPart.initTarget(targetSettings);
// set the button mode
foreignKeyPart.setTargetButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.elements)) {
elementsSettings = new ReferencesTableSettings(foreignKey, DatabasePackage.eINSTANCE.getForeignKey_Elements());
foreignKeyPart.initElements(elementsSettings);
}
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.comments))
foreignKeyPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, foreignKey.getComments()));
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.target)) {
foreignKeyPart.addFilterToTarget(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Table);
}
});
// Start of user code for additional businessfilters for target
// End of user code
}
if (isAccessible(DatabaseViewsRepository.ForeignKey.Properties.elements)) {
foreignKeyPart.addFilterToElements(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof ForeignKeyElement);
}
});
// Start of user code for additional businessfilters for elements
// End of user code
}
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings in project InformationSystem by ObeoNetwork.
the class ColumnPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
if (editingPart instanceof CompositePropertiesEditionPart) {
((CompositePropertiesEditionPart) editingPart).getSettings().add(typeSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(lengthSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(precisionSettings);
((CompositePropertiesEditionPart) editingPart).getSettings().add(literalsSettings);
}
final Column column = (Column) elt;
final ColumnPropertiesEditionPart columnPart = (ColumnPropertiesEditionPart) editingPart;
// init values
if (isAccessible(DatabaseViewsRepository.Column.Properties.name))
columnPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, column.getName()));
if (isAccessible(DatabaseViewsRepository.Column.Properties.NullablePkAndUnique.nullable)) {
columnPart.setNullable(column.isNullable());
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.NullablePkAndUnique.primaryKey)) {
columnPart.setPrimaryKey(column.isInPrimaryKey());
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.NullablePkAndUnique.unique)) {
columnPart.setUnique(column.isUnique());
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.Sequence.autoincrement)) {
columnPart.setAutoincrement(column.isAutoincrement());
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.Sequence.sequence_)) {
// init part
sequenceSettings = new EObjectFlatComboSettings(column, DatabasePackage.eINSTANCE.getColumn_Sequence());
columnPart.initSequence(sequenceSettings);
// set the button mode
columnPart.setSequenceButtonMode(ButtonsModeEnum.BROWSE);
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.defaultValue))
columnPart.setDefaultValue(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, column.getDefaultValue()));
if (isAccessible(DatabaseViewsRepository.Column.Properties.comments))
columnPart.setComments(EcoreUtil.convertToString(EcorePackage.Literals.ESTRING, column.getComments()));
if (typeSettings.getSignificantObject() != null && isAccessible(DatabaseViewsRepository.Column.Properties.type)) {
columnPart.initType(EEFUtils.choiceOfValues(typeSettings.getSignificantObject(), TypesLibraryPackage.eINSTANCE.getTypeInstance_NativeType()), typeSettings.getValue());
}
if (lengthSettings.getValue() != null && isAccessible(DatabaseViewsRepository.Column.Properties.TypeAttributes.length))
columnPart.setLength(EEFConverterUtil.convertToString(EcorePackage.Literals.EINTEGER_OBJECT, lengthSettings.getValue()));
if (precisionSettings.getValue() != null && isAccessible(DatabaseViewsRepository.Column.Properties.TypeAttributes.precision))
columnPart.setPrecision(EEFConverterUtil.convertToString(EcorePackage.Literals.EINTEGER_OBJECT, precisionSettings.getValue()));
if (literalsSettings.getSignificantObject() != null && isAccessible(DatabaseViewsRepository.Column.Properties.literals)) {
columnPart.setLiterals((EList<?>) literalsSettings.getValue());
}
if (isAccessible(DatabaseViewsRepository.Column.Properties.Sequence.sequence_)) {
columnPart.addFilterToSequence(new ViewerFilter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
public boolean select(Viewer viewer, Object parentElement, Object element) {
// $NON-NLS-1$
return (element instanceof String && element.equals("")) || (element instanceof Sequence);
}
});
// Start of user code for additional businessfilters for sequence
// End of user code
}
// Start of user code for additional businessfilters for type
// End of user code
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
Aggregations