use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class TransitionPropertiesEditionPartImpl method createSourceFlatComboViewer.
/**
* @param parent the parent composite
*/
protected Composite createSourceFlatComboViewer(Composite parent) {
createDescription(parent, GraalViewsRepository.Transition.Properties.source, GraalMessages.TransitionPropertiesEditionPart_SourceLabel);
source = new EObjectFlatComboViewer(parent, !propertiesEditionComponent.isRequired(GraalViewsRepository.Transition.Properties.source, GraalViewsRepository.SWT_KIND));
source.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
source.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(TransitionPropertiesEditionPartImpl.this, GraalViewsRepository.Transition.Properties.source, PropertiesEditionEvent.CHANGE, PropertiesEditionEvent.SET, null, getSource()));
}
});
GridData sourceData = new GridData(GridData.FILL_HORIZONTAL);
source.setLayoutData(sourceData);
source.setID(GraalViewsRepository.Transition.Properties.source);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Transition.Properties.source, GraalViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class OperatorPropertiesEditionPartImpl method createKindEMFComboViewer.
protected Composite createKindEMFComboViewer(Composite parent) {
createDescription(parent, GraalViewsRepository.Operator.Properties.kind, GraalMessages.OperatorPropertiesEditionPart_KindLabel);
kind = new EMFComboViewer(parent);
kind.setContentProvider(new ArrayContentProvider());
kind.setLabelProvider(new AdapterFactoryLabelProvider(EEFRuntimePlugin.getDefault().getAdapterFactory()));
GridData kindData = new GridData(GridData.FILL_HORIZONTAL);
kind.getCombo().setLayoutData(kindData);
kind.addSelectionChangedListener(new ISelectionChangedListener() {
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
public void selectionChanged(SelectionChangedEvent event) {
if (propertiesEditionComponent != null)
propertiesEditionComponent.firePropertiesChanged(new PropertiesEditionEvent(OperatorPropertiesEditionPartImpl.this, GraalViewsRepository.Operator.Properties.kind, PropertiesEditionEvent.COMMIT, PropertiesEditionEvent.SET, null, getKind()));
}
});
kind.setID(GraalViewsRepository.Operator.Properties.kind);
// $NON-NLS-1$
SWTUtils.createHelpButton(parent, propertiesEditionComponent.getHelpContent(GraalViewsRepository.Operator.Properties.kind, GraalViewsRepository.SWT_KIND), null);
// End of user code
return parent;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class ClassDiagramConfigurationEditor method getContentOutlinePage.
/**
* This accesses a cached version of the content outliner.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IContentOutlinePage getContentOutlinePage() {
if (contentOutlinePage == null) {
//
class MyContentOutlinePage extends ContentOutlinePage {
@Override
public void createControl(Composite parent) {
super.createControl(parent);
contentOutlineViewer = getTreeViewer();
contentOutlineViewer.addSelectionChangedListener(this);
// Set up the tree viewer.
//
contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
contentOutlineViewer.setInput(editingDomain.getResourceSet());
// Make sure our popups work.
//
createContextMenuFor(contentOutlineViewer);
if (!editingDomain.getResourceSet().getResources().isEmpty()) {
// Select the root object in the view.
//
contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
}
}
@Override
public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
super.makeContributions(menuManager, toolBarManager, statusLineManager);
contentOutlineStatusLineManager = statusLineManager;
}
@Override
public void setActionBars(IActionBars actionBars) {
super.setActionBars(actionBars);
getActionBarContributor().shareGlobalActions(this, actionBars);
}
}
contentOutlinePage = new MyContentOutlinePage();
// Listen to selection so that we can handle it is a special way.
//
contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {
// This ensures that we handle selections correctly.
//
public void selectionChanged(SelectionChangedEvent event) {
handleContentOutlineSelection(event.getSelection());
}
});
}
return contentOutlinePage;
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class ViewEditor method createPages.
/**
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public void createPages() {
// Creates the model from the editor input
//
createModel();
//
if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
Tree tree = new Tree(getContainer(), SWT.MULTI);
selectionViewer = new TreeViewer(tree);
setCurrentViewer(selectionViewer);
selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
getEditingDomain().getCommandStack().addCommandStackListener(new CommandStackListener() {
public void commandStackChanged(EventObject event) {
selectionViewer.refresh();
}
});
createContextMenuFor(selectionViewer);
int pageIndex = addPage(tree);
setPageText(pageIndex, getString("_UI_SelectionPage_label"));
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
setActivePage(0);
}
});
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
getContainer().addControlListener(new ControlAdapter() {
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
if (!guard) {
guard = true;
hideTabs();
guard = false;
}
}
});
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
use of org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider in project InformationSystem by ObeoNetwork.
the class CinematicEditor method createPages.
/**
* This is the method used by the framework to install your own controls.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public void createPages() {
// Creates the model from the editor input
//
createModel();
//
if (!getEditingDomain().getResourceSet().getResources().isEmpty()) {
// Create a page for the selection tree view.
//
Tree tree = new Tree(getContainer(), SWT.MULTI);
selectionViewer = new TreeViewer(tree);
setCurrentViewer(selectionViewer);
selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
selectionViewer.setInput(editingDomain.getResourceSet());
selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory);
getEditingDomain().getCommandStack().addCommandStackListener(new CommandStackListener() {
public void commandStackChanged(EventObject event) {
selectionViewer.refresh();
}
});
createContextMenuFor(selectionViewer);
int pageIndex = addPage(tree);
setPageText(pageIndex, getString("_UI_SelectionPage_label"));
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
setActivePage(0);
}
});
}
// Ensures that this editor will only display the page's tab
// area if there are more than one page
//
getContainer().addControlListener(new ControlAdapter() {
boolean guard = false;
@Override
public void controlResized(ControlEvent event) {
if (!guard) {
guard = true;
hideTabs();
guard = false;
}
}
});
getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
updateProblemIndication();
}
});
}
Aggregations