use of com.amalto.workbench.utils.CompositeViewersSelectionProvider in project tmdm-studio-se by Talend.
the class DataModelMainPage method hookSelectionProvider.
private void hookSelectionProvider() {
selectionProvider = new CompositeViewersSelectionProvider(new Viewer[] { viewer, typesViewer });
getSite().setSelectionProvider(selectionProvider);
}
use of com.amalto.workbench.utils.CompositeViewersSelectionProvider in project tmdm-studio-se by Talend.
the class XSDEditor2 method createPages.
@Override
protected void createPages() {
super.createPages();
XSDEditorInput2 editorInput = (XSDEditorInput2) getEditorInput();
TreeObject treeObject = editorInput.getTreeObject();
IRepositoryViewEditorInput xobjectEditorinput = new XObjectEditorInput2(editorInput.getViewObject(), treeObject, treeObject.getDisplayName());
xobjectEditorinput.setReadOnly(editorInput.isReadOnly());
IFile xsdFile = null;
try {
xsdFile = getXSDFile(treeObject);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
dMainPage = new DataModelMainPage2(treeObject);
dMainPage.addPropertyListener(this);
try {
MODEL_PAGE_INDEX = addPage(dMainPage, xobjectEditorinput);
} catch (PartInitException e) {
log.error(e.getMessage(), e);
}
// Add ER Editor
if (isEE()) {
exAdapter.addPage(xsdFile, editorInput.isReadOnly());
}
// add repository view object in selectionprovider
// ContainerCacheService.get(editorInput.getInputItem().getProperty());
IRepositoryViewObject repositoryViewObj = editorInput.getViewObject();
CompositeViewersSelectionProvider selectionProvider = (CompositeViewersSelectionProvider) dMainPage.getSelectionProvider();
selectionProvider.setRepositoryViewObj(repositoryViewObj);
//
// add XSDSelectionListener
XSDSelectionListener xsdListener = new XSDSelectionListener(this, dMainPage);
dMainPage.getTypesViewer().addSelectionChangedListener(xsdListener);
dMainPage.getElementsViewer().addSelectionChangedListener(xsdListener);
//
setXObject(treeObject);
//
folder = (CTabFolder) dMainPage.getMainControl().getParent();
// $NON-NLS-1$
folder.getItem(MODEL_PAGE_INDEX).setText(treeObject.getDisplayName() + " " + Util.getRevision(treeObject));
folder.getItem(SOURCE_PAGE_INDEX).setText(Messages.XSDEditor2_schemaSource);
// default use
activePage(xsdFile);
}
Aggregations