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;
}
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));
}
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);
}
Aggregations