use of org.eclipse.vorto.perspective.dnd.ModelDragListener in project vorto by eclipse.
the class AbstractModelRepositoryViewPart method createTableViewer.
private TableViewer createTableViewer(Composite parent, Button btnSearch) {
TableViewer viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
FormData fd_table = new FormData();
fd_table.top = new FormAttachment(btnSearch, 2);
fd_table.left = new FormAttachment(searchField, 0, SWT.LEFT);
fd_table.bottom = new FormAttachment(100, -5);
fd_table.right = new FormAttachment(100, -10);
viewer.getTable().setLayoutData(fd_table);
viewer.getTable().setHeaderVisible(true);
viewer.getTable().setLinesVisible(true);
String[] columnLabels = { "", NAMESPACE, NAME, VERSION, DESCRIPTION };
int[] columnBounds = { 50, 300, 200, 100, 400 };
for (int i = 0; i < columnLabels.length; i++) {
createTableViewerColumn(viewer, columnLabels[i], columnBounds[i]);
}
viewer.setContentProvider(new ModelRepositoryContentProvider());
viewer.setLabelProvider(new ModelRepositoryLabelProvider());
comparator = new ModelResourceViewerComparator();
viewer.setComparator(comparator);
viewer.setInput(getViewSite());
viewer.addDragSupport(DND.DROP_COPY | DND.DROP_MOVE, new Transfer[] { LocalSelectionTransfer.getTransfer() }, new ModelDragListener(viewer));
return viewer;
}
use of org.eclipse.vorto.perspective.dnd.ModelDragListener in project vorto by eclipse.
the class DatatypeTreeViewer method init.
@Override
protected void init() {
super.init();
int operations = DND.DROP_COPY | DND.DROP_MOVE;
Transfer[] transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
treeViewer.addDragSupport(operations, transferTypes, new ModelDragListener(treeViewer));
treeViewer.addDropSupport(operations, transferTypes, ModelDropListenerFactory.datatypeViewPartDropListener(treeViewer, localModelWorkspace));
}
use of org.eclipse.vorto.perspective.dnd.ModelDragListener in project vorto by eclipse.
the class FunctionblockTreeViewer method init.
@Override
public void init() {
super.init();
int operations = DND.DROP_COPY | DND.DROP_MOVE;
Transfer[] transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
treeViewer.addDragSupport(operations, transferTypes, new ModelDragListener(treeViewer));
treeViewer.addDropSupport(operations, transferTypes, ModelDropListenerFactory.functionblockViewPartDropListener(treeViewer, localModelWorkspace));
}
Aggregations