use of org.talend.mdm.workbench.serverexplorer.ui.providers.TreeContentProvider in project tmdm-studio-se by Talend.
the class ServerExplorer method createPartControl.
/**
* Create contents of the view part.
*
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
Composite container = new Composite(parent, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setSorter(new ServerSorter());
tree = treeViewer.getTree();
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
IRepositoryViewObject viewObject = getCurSelectedViewObject();
String name = null;
if (viewObject != null) {
MDMServerDefItem serverDefItem = getMDMItem(viewObject);
name = serverDefItem.getServerDef().getName();
}
editServerDef();
}
});
toolkit.paintBordersFor(tree);
treeViewer.setContentProvider(new TreeContentProvider());
treeViewer.setLabelProvider(new ViewerLabelProvider());
initAdapter();
initializeToolBar();
initializeMenu();
refreshServerDefs();
reInputPassword();
}
use of org.talend.mdm.workbench.serverexplorer.ui.providers.TreeContentProvider in project tmdm-studio-se by Talend.
the class SelectServerDefDialog method createDialogArea.
/**
* Create contents of the dialog.
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
setTitle(Messages.SelectServerDefDialog_selectServerLocation);
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayout(new FillLayout(SWT.HORIZONTAL));
container.setLayoutData(new GridData(GridData.FILL_BOTH));
treeViewer = new TreeViewer(container, SWT.BORDER);
treeViewer.setSorter(new ServerSorter());
treeViewer.setContentProvider(new TreeContentProvider());
treeViewer.setLabelProvider(new ViewerLabelProvider());
//
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IRepositoryViewObject viewObject = getCurSelectedViewObject();
if (viewObject == null)
return;
MDMServerDefItem item = (MDMServerDefItem) viewObject.getProperty().getItem();
serverDef = item.getServerDef();
okBun.setEnabled(serverDef != null);
}
});
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
});
//
initServerDefList();
return area;
}
Aggregations