use of org.talend.mdm.repository.ui.editors.ViewBrowserInput in project tmdm-studio-se by Talend.
the class BrowseViewAction method doRun.
@Override
protected void doRun() {
Object obj = getSelectedObject().get(0);
if (obj instanceof IRepositoryViewObject) {
IRepositoryViewObject viewObject = (IRepositoryViewObject) obj;
WSViewItem item = (WSViewItem) viewObject.getProperty().getItem();
WSViewE wsView = item.getWsView();
MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
SelectServerDefDialog dlg = new SelectServerDefDialog(getShell());
dlg.create();
dlg.setSelectServer(lastServerDef);
if (dlg.open() == IDialogConstants.OK_ID) {
ViewBrowserInput input = new ViewBrowserInput(viewObject);
input.setServerDef(dlg.getSelectedServerDef());
if (page == null) {
page = commonViewer.getCommonNavigator().getSite().getWorkbenchWindow().getActivePage();
}
try {
IEditorPart oldEditor = page.findEditor(input);
if (oldEditor != null) {
page.closeEditor(oldEditor, false);
}
page.openEditor(input, XObjectBrowser2.EDITOR_ID);
} catch (PartInitException e) {
log.error(e.getMessage(), e);
}
}
}
}
Aggregations