Search in sources :

Example 11 with TdViewRepositoryObject

use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.

the class CreateColumnAnalysis method init.

@Override
public void init(ICommonActionExtensionSite site) {
    if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
        StructuredSelection selection = (StructuredSelection) site.getStructuredViewer().getSelection();
        Object fe = selection.getFirstElement();
        if (fe instanceof IRepositoryNode) {
            IRepositoryViewObject object = ((IRepositoryNode) fe).getObject();
            if (object instanceof TdTableRepositoryObject) {
                TdTableRepositoryObject tableObject = (TdTableRepositoryObject) object;
                modelElement = tableObject.getTdTable();
            } else if (object instanceof TdViewRepositoryObject) {
                TdViewRepositoryObject viewObject = (TdViewRepositoryObject) object;
                modelElement = viewObject.getTdView();
            }
        }
    }
    super.init(site);
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TdViewRepositoryObject(org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TdTableRepositoryObject(org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject) TdTableRepositoryObject(org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject) TdViewRepositoryObject(org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Aggregations

TdViewRepositoryObject (org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject)11 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)8 TdTableRepositoryObject (org.talend.core.repository.model.repositoryObject.TdTableRepositoryObject)8 IRepositoryNode (org.talend.repository.model.IRepositoryNode)7 TdView (org.talend.cwm.relational.TdView)4 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 ICommonViewerWorkbenchSite (org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)3 RepositoryNode (org.talend.repository.model.RepositoryNode)3 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)2 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)2 TdColumn (org.talend.cwm.relational.TdColumn)2 TdTable (org.talend.cwm.relational.TdTable)2 DBViewRepNode (org.talend.dq.nodes.DBViewRepNode)2 Catalog (orgomg.cwm.resource.relational.Catalog)2 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 Test (org.junit.Test)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 ConnectionItem (org.talend.core.model.properties.ConnectionItem)1