use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class DBTablesViewLabelProvider method getImage.
@Override
public Image getImage(Object element) {
if (element instanceof IProject) {
return ImageLib.getImage(ImageLib.PROJECT_ACTIVE);
} else if (element instanceof IFolder) {
IFolder folder = (IFolder) element;
if (ResourceManager.isDBConnectionFolder(folder)) {
return ImageLib.getImage(ImageLib.CONNECTION);
}
return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
} else if (element instanceof IFolderNode) {
return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
} else if (element instanceof IFile) {
return ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
} else if (element instanceof IRepositoryViewObject) {
IRepositoryViewObject conn = (IRepositoryViewObject) element;
Item connItem = conn.getProperty().getItem();
return ImageLib.getImage(ImageLib.TD_DATAPROVIDER);
}
return super.getImage(element);
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class ModelElementCompareEditorLauncher method open.
@Override
public void open(IPath file) {
try {
// final EObject snapshot = ModelUtils.load(file.toFile(), new ResourceSetImpl());
// if (snapshot instanceof ComparisonResourceSnapshot) {
CompareConfiguration comapreConfiguration = new CompareConfiguration();
comapreConfiguration.setDefaultLabelProvider(new ICompareInputLabelProvider() {
@Override
public Image getAncestorImage(Object input) {
return null;
}
@Override
public String getAncestorLabel(Object input) {
// $NON-NLS-1$
return "";
}
@Override
public Image getLeftImage(Object input) {
return null;
}
@Override
public String getLeftLabel(Object input) {
// $NON-NLS-1$
String showLabel = Messages.getString("ModelElementCompareEditorLauncher.LocalStructure", connectionName);
if (compareEachOther) {
// $NON-NLS-1$
showLabel = Messages.getString("ModelElementCompareEditorLauncher.FirstElement");
}
return showLabel;
}
@Override
public Image getRightImage(Object input) {
return null;
}
@Override
public String getRightLabel(Object input) {
// $NON-NLS-1$
String showLabel = Messages.getString("ModelElementCompareEditorLauncher.DistantStructure");
if (compareEachOther) {
// $NON-NLS-1$
showLabel = Messages.getString("ModelElementCompareEditorLauncher.SecondElement");
}
return showLabel;
}
@Override
public Image getImage(Object element) {
return null;
}
@Override
public String getText(Object element) {
// $NON-NLS-1$
return Messages.getString("ModelElementCompareEditorLauncher.TextLabel");
}
@Override
public void addListener(ILabelProviderListener listener) {
// needn't to do anything ???
}
@Override
public void dispose() {
// needn't to do anything ???
}
@Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@Override
public void removeListener(ILabelProviderListener listener) {
// needn't to do anything ???
}
});
// ModelElementCompareEditorInput compEditorInput = new ModelElementCompareEditorInput(
// (ComparisonResourceSnapshot) snapshot, comapreConfiguration, selectedObject);
// MOD mzhao bug 8581 Add the specific title for comparison
// editor.
// $NON-NLS-1$
String editorTitle = Messages.getString("ModelElementCompareEditorLauncher.Compare");
if (selectedObject instanceof IFile) {
editorTitle = PrvResourceFileHelper.getInstance().findProvider((IFile) selectedObject).getName();
} else if (selectedObject instanceof IFolderNode) {
editorTitle = ((ModelElement) ((IFolderNode) selectedObject).getParent()).getName();
} else if (selectedObject instanceof Catalog) {
editorTitle = ((Catalog) selectedObject).getName();
} else if (selectedObject instanceof IRepositoryViewObject) {
editorTitle = ((ConnectionItem) ((IRepositoryViewObject) selectedObject).getProperty().getItem()).getConnection().getName();
} else if (selectedObject instanceof Connection) {
editorTitle = ((Connection) selectedObject).getName();
}
// compEditorInput.setTitle(editorTitle);
// CompareUI.openCompareEditor(compEditorInput);
// compEditorInput.hookLeftPanelContextMenu(compareEachOther);
// compEditorInput.hookToolBar(compareEachOther);
// }
// } catch (IOException e) {
} catch (Exception e) {
// Fichier non lisible
System.out.println(e);
assert false;
}
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class FolderNodeHelper method createColumFolderNodes.
private static IFolderNode[] createColumFolderNodes(org.eclipse.emf.ecore.EObject eObject) {
IFolderNode[] folderNodes;
IFolderNode columnFolderNode = new ColumnFolderNode();
columnFolderNode.setParent(eObject);
folderNodes = new IFolderNode[] { columnFolderNode };
catalogFolderNodeMap.put(eObject, folderNodes);
return folderNodes;
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class FolderNodeHelper method createTableViewNodes.
/**
* @param catalog
* @return
*/
private static IFolderNode[] createTableViewNodes(EObject eObject) {
IFolderNode[] folderNodes;
IFolderNode tabbleFolderNode = new TableFolderNode();
tabbleFolderNode.setParent(eObject);
IFolderNode viewFolderNode = new ViewFolderNode();
viewFolderNode.setParent(eObject);
folderNodes = new IFolderNode[] { tabbleFolderNode, viewFolderNode };
catalogFolderNodeMap.put(eObject, folderNodes);
return folderNodes;
}
use of org.talend.dq.nodes.foldernode.IFolderNode in project tdq-studio-se by Talend.
the class ChangeConnectionAction method reloadByColumnSetFolderLevel.
private void reloadByColumnSetFolderLevel(List<SynTreeModel> treeModelLs, AnalyzedElementSynDialog anaEleSynDialog, Connection newDataProv) throws ReloadCompareException {
ModelElement oldDataProviderModel = treeModelLs.get(0).getOldDataProvElement();
// Reload columnSet folder
ColumnSet columnset = null;
if (oldDataProviderModel instanceof ColumnSet) {
columnset = (ColumnSet) oldDataProviderModel;
} else if (oldDataProviderModel instanceof TdColumn) {
columnset = ColumnHelper.getColumnOwnerAsColumnSet(oldDataProviderModel);
} else {
return;
}
// MOD mzhao bug 8567 2010-03-29
IFolderNode reloadFolder = FolderNodeHelper.getFolderNode((Package) treeModelLs.get(0).getNewDataProvElement(), columnset);
if (reloadFolder != null) {
IComparisonLevel creatComparisonLevel = ComparisonLevelFactory.creatComparisonLevel(reloadFolder);
if (creatComparisonLevel != null) {
// FIXME newDataProv is never used in the following codes.
newDataProv = creatComparisonLevel.reloadCurrentLevelElement();
}
// Recompute after reload
// FIXME treeModelLs is never used in the following codes.
treeModelLs = anaEleSynDialog.getSynInputModel();
}
}
Aggregations