use of org.eclipse.emf.eef.runtime.ui.widgets.EEFFeatureEditorDialog in project InformationSystem by ObeoNetwork.
the class StateMachinePropertiesEditionPartImpl method createKeywordsMultiValuedEditor.
protected Composite createKeywordsMultiValuedEditor(Composite parent) {
keywords = SWTUtils.createScrollableText(parent, SWT.BORDER | SWT.READ_ONLY);
GridData keywordsData = new GridData(GridData.FILL_HORIZONTAL);
keywordsData.horizontalSpan = 2;
keywords.setLayoutData(keywordsData);
EditingUtils.setID(keywords, StatemachineViewsRepository.StateMachine_.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
editKeywords = new Button(parent, SWT.NONE);
editKeywords.setText(getDescription(StatemachineViewsRepository.StateMachine_.Properties.keywords, StatemachineMessages.StateMachinePropertiesEditionPart_KeywordsLabel));
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$
"StateMachine", // $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(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editKeywords, StatemachineViewsRepository.StateMachine_.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
Aggregations