use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.
the class RepositoryNodeHelper method isStateDeleted.
/**
* if logical delete state is true .
*
* @param node
* @return
*/
public static boolean isStateDeleted(IRepositoryNode node) {
final IRepositoryViewObject viewObject = node.getObject();
final IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
// TDQ's ISubRepositoryObject will return a null when call getAbstractMetadataObject()
if (viewObject instanceof ISubRepositoryObject) {
ISubRepositoryObject subRepositoryObject = (ISubRepositoryObject) viewObject;
if (subRepositoryObject.getAbstractMetadataObject() == null) {
return false;
}
}
if (node instanceof ReportAnalysisRepNode || node instanceof ReportFileRepNode) {
return false;
} else {
if (viewObject != null && factory.getStatus(viewObject) == ERepositoryStatus.DELETED) {
return true;
}
}
return false;
}
use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.
the class ModelElementTreeMenuProvider method getSelectedNode.
/**
* DOC msjian Comment method "getSelectedNode".
*
* @param selection
* @return
*/
protected RepositoryNode getSelectedNode(TreeItem[] selection) {
ModelElementIndicator meIndicator = (ModelElementIndicator) selection[0].getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
ModelElement me = ((ISubRepositoryObject) meIndicator.getModelElementRepositoryNode().getObject()).getModelElement();
RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(me);
if (recursiveFind == null) {
recursiveFind = RepositoryNodeHelper.createRepositoryNode(me);
}
return recursiveFind;
}
use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.
the class DQDBFolderRepositoryNode method getConnectionFromViewObject.
protected void getConnectionFromViewObject() {
IRepositoryViewObject object = this.getObject() == null ? this.getParent().getObject() : this.getObject();
if (object != null && object instanceof ISubRepositoryObject) {
Property property = ((ISubRepositoryObject) object).getProperty();
if (property == null) {
return;
}
Item theItem = property.getItem();
if (theItem != null && theItem instanceof ConnectionItem) {
connection = ((ConnectionItem) theItem).getConnection();
}
}
}
use of org.talend.core.model.repository.ISubRepositoryObject in project tdq-studio-se by Talend.
the class TwoPartCheckSelectionDialog method getRealNodeFromRepository.
/**
* DOC talend Comment method "getRealNodeFromRepository".
*
* @param selectNode
* @return
*/
protected IRepositoryNode getRealNodeFromRepository(IRepositoryNode selectNode) {
IRepositoryNode returnNode = null;
ModelElement currModelElement = null;
if (selectNode.getObject() instanceof ISubRepositoryObject) {
currModelElement = ((ISubRepositoryObject) selectNode.getObject()).getModelElement();
}
if (currModelElement != null) {
returnNode = RepositoryNodeHelper.recursiveFind(currModelElement);
}
return returnNode;
}
Aggregations