Search in sources :

Example 1 with SGraphItemProviderAdapterFactory

use of org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory in project statecharts by Yakindu.

the class DiagramPartitioningBreadcrumbViewer method createDiagramViewer.

protected TreeViewer createDiagramViewer(final Composite composite, Diagram diagram) {
    TreeViewer viewer = new TreeViewer(composite);
    viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
    viewer.setContentProvider(new AdapterFactoryContentProvider(new BreadcrumbItemProviderAdapterFactory()));
    EObject element = diagram.getElement();
    viewer.setInput(element);
    viewer.addSelectionChangedListener(this);
    return viewer;
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer) EObject(org.eclipse.emf.ecore.EObject) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SGraphItemProviderAdapterFactory(org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)

Example 2 with SGraphItemProviderAdapterFactory

use of org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory in project statecharts by Yakindu.

the class DiagramPartitioningEditor method initializeTitle.

protected void initializeTitle(Diagram diagram) {
    EObject element = diagram.getElement();
    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory());
    setTitleImage(labelProvider.getImage(element));
    setPartName(labelProvider.getText(element));
}
Also used : EObject(org.eclipse.emf.ecore.EObject) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SGraphItemProviderAdapterFactory(org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory)

Example 3 with SGraphItemProviderAdapterFactory

use of org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory in project statecharts by Yakindu.

the class OrderElementControl method init.

private void init() {
    this.setLayout(new GridLayout(2, false));
    viewer = new TableViewer(this, SWT.SINGLE | SWT.BORDER);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new AdapterFactoryLabelProvider(new SGraphItemProviderAdapterFactory()));
    Composite buttonComposite = getToolkit().createComposite(this);
    buttonComposite.setLayout(new FillLayout(SWT.VERTICAL));
    btnUp = getToolkit().createButton(buttonComposite, "up", SWT.PUSH);
    btnDown = getToolkit().createButton(buttonComposite, "down", SWT.PUSH);
    viewer.addSelectionChangedListener(enableButtonListener);
    viewer.addSelectionChangedListener(editPartSelectionListener);
    btnUp.addSelectionListener(upButtonListener);
    btnDown.addSelectionListener(downButtonListener);
    GridDataFactory.fillDefaults().applyTo(viewer.getControl());
    GridDataFactory.fillDefaults().applyTo(buttonComposite);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(viewer.getControl());
    GridDataFactory.fillDefaults().grab(true, false).applyTo(this);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SGraphItemProviderAdapterFactory(org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory) FillLayout(org.eclipse.swt.layout.FillLayout) TableViewer(org.eclipse.jface.viewers.TableViewer)

Aggregations

AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)3 SGraphItemProviderAdapterFactory (org.yakindu.sct.model.sgraph.provider.SGraphItemProviderAdapterFactory)3 EObject (org.eclipse.emf.ecore.EObject)2 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)1 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1