use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class ColumnPropertiesEditionPartImpl method createLiteralsMultiValuedEditor.
protected Composite createLiteralsMultiValuedEditor(Composite parent) {
literals = SWTUtils.createScrollableText(parent, SWT.BORDER | 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 = new Button(parent, SWT.NONE);
editLiterals.setText(getDescription(DatabaseViewsRepository.Column.Properties.literals, DatabaseMessages.ColumnPropertiesEditionPart_LiteralsLabel));
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(ColumnPropertiesEditionPartImpl.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;
}
use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class TypeInstancePropertiesEditionPartForm 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, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(literals, "eef::MultiValuedEditor::field");
editLiterals = widgetFactory.createButton(parent, getDescription(TypeslibraryViewsRepository.TypeInstance.Properties.literals, TypeslibraryMessages.TypeInstancePropertiesEditionPart_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$
"TypeInstance", // $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(TypeInstancePropertiesEditionPartForm.this, TypeslibraryViewsRepository.TypeInstance.Properties.literals, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(literalsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editLiterals, TypeslibraryViewsRepository.TypeInstance.Properties.literals);
// $NON-NLS-1$
EditingUtils.setEEFtype(editLiterals, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
use of org.eclipse.emf.common.util.BasicEList in project statecharts by Yakindu.
the class ArgumentSorter method getOrderedExpressions.
public static EList<Expression> getOrderedExpressions(List<Argument> arguments, Operation operation) {
Expression[] result = new Expression[arguments.size()];
for (int index = 0; index < arguments.size(); index++) {
Argument argument = arguments.get(index);
List<INode> nodes = NodeModelUtils.findNodesForFeature(argument, ExpressionsPackage.Literals.ARGUMENT__PARAMETER);
if (nodes.isEmpty()) {
result[index] = argument.getValue();
} else {
// EcoreUtil.equals.)
for (Parameter param : operation.getParameters()) {
if (param.getName().equals(nodes.get(0).getText())) {
int parameterIndex = operation.getParameters().indexOf(param);
if (parameterIndex < result.length)
result[parameterIndex] = argument.getValue();
break;
}
}
}
}
EList<Expression> resultAsList = new BasicEList<Expression>();
for (int i = 0; i < result.length; i++) {
Expression expression = result[i];
if (expression != null)
resultAsList.add(expression);
}
return resultAsList;
}
use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class InitialStatePropertiesEditionPartForm method createKeywordsMultiValuedEditor.
/**
*/
protected Composite createKeywordsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
// $NON-NLS-1$
keywords = widgetFactory.createText(parent, "", SWT.READ_ONLY);
GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
keywordsData.horizontalSpan = 2;
keywords.setLayoutData(keywordsData);
EditingUtils.setID(keywords, StatemachineViewsRepository.InitialState.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
editKeywords = widgetFactory.createButton(parent, getDescription(StatemachineViewsRepository.InitialState.Properties.keywords, StatemachineMessages.InitialStatePropertiesEditionPart_KeywordsLabel), SWT.NONE);
GridData editKeywordsData = new GridData();
editKeywords.setLayoutData(editKeywordsData);
editKeywords.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$
keywords.getShell(), // $NON-NLS-1$
"InitialState", // $NON-NLS-1$
new AdapterFactoryLabelProvider(adapterFactory), keywordsList, EnvironmentPackage.eINSTANCE.getObeoDSMObject_Keywords().getEType(), null, false, true, null, null);
if (dialog.open() == Window.OK) {
keywordsList = dialog.getResult();
if (keywordsList == null) {
keywordsList = new BasicEList();
}
keywords.setText(keywordsList.toString());
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartForm.this, StatemachineViewsRepository.InitialState.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editKeywords, StatemachineViewsRepository.InitialState.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
use of org.eclipse.emf.common.util.BasicEList in project InformationSystem by ObeoNetwork.
the class RegionPropertiesEditionPartForm method createKeywordsMultiValuedEditor.
/**
*/
protected Composite createKeywordsMultiValuedEditor(FormToolkit widgetFactory, Composite parent) {
// $NON-NLS-1$
keywords = widgetFactory.createText(parent, "", SWT.READ_ONLY);
GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
keywordsData.horizontalSpan = 2;
keywords.setLayoutData(keywordsData);
EditingUtils.setID(keywords, StatemachineViewsRepository.Region.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
editKeywords = widgetFactory.createButton(parent, getDescription(StatemachineViewsRepository.Region.Properties.keywords, StatemachineMessages.RegionPropertiesEditionPart_KeywordsLabel), SWT.NONE);
GridData editKeywordsData = new GridData();
editKeywords.setLayoutData(editKeywordsData);
editKeywords.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$
keywords.getShell(), // $NON-NLS-1$
"Region", // $NON-NLS-1$
new AdapterFactoryLabelProvider(adapterFactory), keywordsList, EnvironmentPackage.eINSTANCE.getObeoDSMObject_Keywords().getEType(), null, false, true, null, null);
if (dialog.open() == Window.OK) {
keywordsList = dialog.getResult();
if (keywordsList == null) {
keywordsList = new BasicEList();
}
keywords.setText(keywordsList.toString());
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RegionPropertiesEditionPartForm.this, StatemachineViewsRepository.Region.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editKeywords, StatemachineViewsRepository.Region.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
Aggregations