Search in sources :

Example 1 with XObjectBrowserInput2

use of org.talend.mdm.repository.ui.editors.XObjectBrowserInput2 in project tmdm-studio-se by Talend.

the class MDMEventManagerAction method doRun.

@Override
protected void doRun() {
    boolean checkMissingJar = MissingJarService.getInstance().checkMissingJar(true);
    if (!checkMissingJar) {
        return;
    }
    MDMServerDef serverDef = getServerDef();
    if (serverDef != null) {
        try {
            ServerDefService.checkMDMConnection(serverDef);
        } catch (Exception e) {
            MessageDialog.openError(getShell(), Messages.MDMEventManagerAction_CheckConnection, Messages.MDMEventManagerAction_connectFailed);
            return;
        }
        IRepositoryViewObject eventViewObj = getEventMangerViewObject();
        TreeObject treeObj = createModel();
        XObjectBrowserInput2 input = new XObjectBrowserInput2(eventViewObj, treeObj, Messages.EventManager_text);
        input.setServerDef(serverDef);
        if (page == null) {
            this.page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        }
        try {
            this.page.openEditor(input, XObjectBrowser2.EDITOR_ID);
        } catch (PartInitException e) {
            log.error(e.getMessage(), e);
        }
        setServerDef(null);
    }
}
Also used : XObjectBrowserInput2(org.talend.mdm.repository.ui.editors.XObjectBrowserInput2) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TreeObject(com.amalto.workbench.models.TreeObject) PartInitException(org.eclipse.ui.PartInitException) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with XObjectBrowserInput2

use of org.talend.mdm.repository.ui.editors.XObjectBrowserInput2 in project tmdm-studio-se by Talend.

the class RepositoryNodeActionProviderAdapter method getOpenEditorInput.

/**
 * The child class can override this method, current implement is adapt to most of MDMServerobject
 */
@Override
public IRepositoryViewEditorInput getOpenEditorInput(IRepositoryViewObject viewObj) {
    Item item = viewObj.getProperty().getItem();
    MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
    if (serverObject.getType() == TreeObject.DATA_CLUSTER) {
        // Data Cluster
        return new XObjectBrowserInput2(viewObj);
    }
    return new XObjectEditorInput2(viewObj);
}
Also used : WorkspaceRootItem(org.talend.mdm.repository.model.mdmproperties.WorkspaceRootItem) Item(org.talend.core.model.properties.Item) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) FolderItem(org.talend.core.model.properties.FolderItem) MDMItem(org.talend.mdm.repository.model.mdmproperties.MDMItem) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) XObjectEditorInput2(org.talend.mdm.repository.ui.editors.XObjectEditorInput2) XObjectBrowserInput2(org.talend.mdm.repository.ui.editors.XObjectBrowserInput2) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)

Aggregations

XObjectBrowserInput2 (org.talend.mdm.repository.ui.editors.XObjectBrowserInput2)2 TreeObject (com.amalto.workbench.models.TreeObject)1 PartInitException (org.eclipse.ui.PartInitException)1 FolderItem (org.talend.core.model.properties.FolderItem)1 Item (org.talend.core.model.properties.Item)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)1 ContainerItem (org.talend.mdm.repository.model.mdmproperties.ContainerItem)1 MDMItem (org.talend.mdm.repository.model.mdmproperties.MDMItem)1 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)1 WorkspaceRootItem (org.talend.mdm.repository.model.mdmproperties.WorkspaceRootItem)1 MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)1 XObjectEditorInput2 (org.talend.mdm.repository.ui.editors.XObjectEditorInput2)1