use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class InitialStatePropertiesEditionPartImpl method createDescriptionText.
protected Composite createDescriptionText(Composite parent) {
createDescription(parent, StatemachineViewsRepository.InitialState.Properties.description, StatemachineMessages.InitialStatePropertiesEditionPart_DescriptionLabel);
description = SWTUtils.createScrollableText(parent, SWT.BORDER);
GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
description.setLayoutData(descriptionData);
description.addFocusListener(new FocusAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
});
description.addKeyListener(new KeyAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
}
});
EditingUtils.setID(description, StatemachineViewsRepository.InitialState.Properties.description);
// $NON-NLS-1$
EditingUtils.setEEFtype(description, "eef::Text");
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.InitialState.Properties.description, StatemachineViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class InitialStatePropertiesEditionPartImpl method removeFromOutcomingTransitions.
/**
*/
protected void removeFromOutcomingTransitions(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(InitialStatePropertiesEditionPartImpl.this, StatemachineViewsRepository.InitialState.Properties.outcomingTransitions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
outcomingTransitions.refresh();
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class RegionPropertiesEditionPartImpl method createDescriptionText.
protected Composite createDescriptionText(Composite parent) {
createDescription(parent, StatemachineViewsRepository.Region.Properties.description, StatemachineMessages.RegionPropertiesEditionPart_DescriptionLabel);
description = SWTUtils.createScrollableText(parent, SWT.BORDER);
GridData descriptionData = new GridData(GridData.FILL_HORIZONTAL);
description.setLayoutData(descriptionData);
description.addFocusListener(new FocusAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.FocusAdapter#focusLost(org.eclipse.swt.events.FocusEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void focusLost(FocusEvent e) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RegionPropertiesEditionPartImpl.this, StatemachineViewsRepository.Region.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
});
description.addKeyListener(new KeyAdapter() {
/**
* {@inheritDoc}
*
* @see org.eclipse.swt.events.KeyAdapter#keyPressed(org.eclipse.swt.events.KeyEvent)
*/
@Override
@SuppressWarnings("synthetic-access")
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(RegionPropertiesEditionPartImpl.this, StatemachineViewsRepository.Region.Properties.description, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, description.getText()));
}
}
});
EditingUtils.setID(description, StatemachineViewsRepository.Region.Properties.description);
// $NON-NLS-1$
EditingUtils.setEEFtype(description, "eef::Text");
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.Region.Properties.description, StatemachineViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StateMachinePropertiesEditionPartImpl method createRegionsAdvancedTableComposition.
/**
* @param container
*/
protected Composite createRegionsAdvancedTableComposition(Composite parent) {
this.regions = new ReferencesTable(getDescription(StatemachineViewsRepository.StateMachine_.Properties.regions, StatemachineMessages.StateMachinePropertiesEditionPart_RegionsLabel), new ReferencesTableListener() {
public void handleAdd() {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.ADD, null, null));
regions.refresh();
}
public void handleEdit(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.EDIT, null, element));
regions.refresh();
}
public void handleMove(EObject element, int oldIndex, int newIndex) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.MOVE, element, newIndex));
regions.refresh();
}
public void handleRemove(EObject element) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.REMOVE, null, element));
regions.refresh();
}
public void navigateTo(EObject element) {
}
});
for (ViewerFilter filter : this.regionsFilters) {
this.regions.addFilter(filter);
}
this.regions.setHelpText(propertiesEditionComponent.getHelpContent(StatemachineViewsRepository.StateMachine_.Properties.regions, StatemachineViewsRepository.SWT_KIND));
this.regions.createControls(parent);
this.regions.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if (e.item != null && e.item.getData() instanceof EObject) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(StateMachinePropertiesEditionPartImpl.this, StatemachineViewsRepository.StateMachine_.Properties.regions, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SELECTION_CHANGED, null, e.item.getData()));
}
}
});
GridData regionsData = new GridData(GridData.FILL_HORIZONTAL);
regionsData.horizontalSpan = 3;
this.regions.setLayoutData(regionsData);
this.regions.setLowerBound(0);
this.regions.setUpperBound(-1);
regions.setID(StatemachineViewsRepository.StateMachine_.Properties.regions);
// $NON-NLS-1$
regions.setEEFType("eef::AdvancedTableComposition");
// End of user code
return parent;
}
use of org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent in project InformationSystem by ObeoNetwork.
the class StatePropertiesEditionPartImpl 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.State.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(keywords, "eef::MultiValuedEditor::field");
editKeywords = new Button(parent, SWT.NONE);
editKeywords.setText(getDescription(StatemachineViewsRepository.State.Properties.keywords, StatemachineMessages.StatePropertiesEditionPart_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$
"State", // $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(StatePropertiesEditionPartImpl.this, StatemachineViewsRepository.State.Properties.keywords, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, new BasicEList(keywordsList)));
setHasChanged(true);
}
}
});
EditingUtils.setID(editKeywords, StatemachineViewsRepository.State.Properties.keywords);
// $NON-NLS-1$
EditingUtils.setEEFtype(editKeywords, "eef::MultiValuedEditor::browsebutton");
// End of user code
return parent;
}
Aggregations