use of org.eclipse.emf.common.util.BasicEList in project statecharts by Yakindu.
the class TypesUtil method prependContainingFeatureName.
private static void prependContainingFeatureName(StringBuilder id, EObject container) {
EStructuralFeature feature = container.eContainingFeature();
if (feature != null) {
String name;
if (feature.isMany()) {
Object elements = container.eContainer().eGet(feature);
int index = 0;
if (elements instanceof BasicEList) {
BasicEList elementList = (BasicEList) elements;
index = elementList.indexOf(container);
}
name = feature.getName() + index;
} else {
name = feature.getName();
}
id.insert(0, ID_SEPARATOR);
id.insert(0, name);
}
}
use of org.eclipse.emf.common.util.BasicEList in project tdq-studio-se by Talend.
the class ColumnSetMultiValueIndicatorImpl method getColumnHeaders.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public EList<String> getColumnHeaders() {
EList<String> headers = new BasicEList<String>();
// shuold keep the order of the columns, when show the data in result page need to follow the order
for (ModelElement column : analyzedColumns) {
if (isSameMiningType(column, DataminingType.INTERVAL)) {
// add numerical or date columns with formatted heander name if numeric or date functions defined in
// indicator definition.
final MetadataColumn mdColumn = SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(column);
final TdColumn tdColumn = SwitchHelpers.COLUMN_SWITCH.doSwitch(column);
if (tdColumn != null) {
// For database items
addDBColumnToHeaderList(headers, column, tdColumn);
} else if (mdColumn != null) {
// For file items.
addFileColumnToHeaderList(headers, column, mdColumn);
} else {
// Never go here
log.error("invalid data mining type for " + column);
}
} else {
headers.add(column.getName());
}
}
headers.add(this.getCountAll());
return headers;
}
use of org.eclipse.emf.common.util.BasicEList in project tdq-studio-se by Talend.
the class ColumnSetMultiValueIndicatorImpl method getDateColumns.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public EList<ModelElement> getDateColumns() {
EList<ModelElement> dateColumns = new BasicEList<ModelElement>();
if (analyzedColumns != null) {
for (ModelElement column : analyzedColumns) {
final MetadataColumn mdColumn = SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(column);
final TdColumn tdColumn = SwitchHelpers.COLUMN_SWITCH.doSwitch(column);
if (tdColumn != null) {
if (isSameMiningType(column, DataminingType.INTERVAL) && Java2SqlType.isDateInSQL(tdColumn.getSqlDataType().getJavaDataType())) {
dateColumns.add(column);
}
} else if (mdColumn != null) {
int javaType = TalendTypeConvert.convertToJDBCType(mdColumn.getTalendType());
if (isSameMiningType(column, DataminingType.INTERVAL) && Java2SqlType.isDateInSQL(javaType)) {
dateColumns.add(column);
}
}
}
}
return dateColumns;
}
use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class DBindingEditorCreationDescriptionImpl method getMappings.
/**
* {@inheritDoc}
*
* @see org.eclipse.sirius.viewpoint.description.tool.impl.RepresentationCreationDescriptionImpl#getMappings()
* @generated NOT
*/
@Override
public EList<RepresentationElementMapping> getMappings() {
if (this.eResource() == null) {
throw new UnsupportedOperationException();
}
ECrossReferenceAdapter crossReferencer = ECrossReferenceAdapter.getCrossReferenceAdapter(this.eResource().getResourceSet());
if (crossReferencer == null) {
throw new UnsupportedOperationException();
}
final List<RepresentationElementMapping> mappings = new LinkedList<RepresentationElementMapping>();
final Collection<Setting> settings = crossReferencer.getInverseReferences(this, true);
for (final Setting setting : settings) {
final EObject eReferencer = setting.getEObject();
final EStructuralFeature eFeature = setting.getEStructuralFeature();
if (eReferencer instanceof RepresentationElementMapping && eFeature.equals(org.eclipse.sirius.viewpoint.description.DescriptionPackage.eINSTANCE.getRepresentationElementMapping_DetailDescriptions())) {
mappings.add((RepresentationElementMapping) eReferencer);
}
}
return new BasicEList<RepresentationElementMapping>(mappings);
}
use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class ColumnPropertiesEditionPartForm method createLiteralsMultiValuedEditor.
/**
*/
protected Composite createLiteralsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
// $NON-NLS-1$
literals = widgetFactory.createText(parent, "", SWT.READ_ONLY);
GridData literalsData = new GridData(GridData.FILL_HORIZONTAL);
literalsData.horizontalSpan = 2;
literals.setLayoutData(literalsData);
EditingUtils.setID(literals, DatabaseViewsRepository.Column.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
editLiterals = widgetFactory.createButton(parent, getDescription(DatabaseViewsRepository.Column.Properties.literals, DatabaseMessages.ColumnPropertiesEditionPart_LiteralsLabel), SWT.NONE);
GridData editLiteralsData = new GridData();
editLiterals.setLayoutData(editLiteralsData);
editLiterals.addSelectionListener(new SelectionAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
public void widgetSelected(SelectionEvent e) {
EEFFeatureEditorDialog dialog = new EEFFeatureEditorDialog(// $NON-NLS-1$
literals.getShell(), // $NON-NLS-1$
"Column", // $NON-NLS-1$
new AdapterFactoryLabelProvider(adapterFactory), literalsList, TypesLibraryPackage.eINSTANCE.getTypeInstance_Literals().getEType(), null, false, true, null, null);
if (dialog.open() == Window.OK) {
literalsList = dialog.getResult();
if (literalsList == null) {
literalsList = new BasicEList();
}
literals.setText(literalsList.toString());
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(ColumnPropertiesEditionPartForm.this, DatabaseViewsRepository.Column.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editLiterals, DatabaseViewsRepository.Column.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(editLiterals, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
Aggregations