use of org.talend.dataprofiler.core.sql.AddSqlFileAction in project tdq-studio-se by Talend.
the class NewSourceFileActionProvider method fillContextMenu.
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
TreeSelection treeSelection = ((TreeSelection) this.getContext().getSelection());
List<IFile> selectedFiles = new ArrayList<IFile>();
if (treeSelection.size() == 1) {
RepositoryNode node = (RepositoryNode) treeSelection.getFirstElement();
if (node instanceof SourceFileSubFolderNode) {
menu.add(new AddSqlFileAction(node));
menu.add(new ImportSqlFileAction(node));
menu.add(new RenameTdqFolderAction(node));
} else if (node instanceof SourceFileFolderRepNode) {
menu.add(new AddSqlFileAction(node));
menu.add(new ImportSqlFileAction(node));
} else if (node instanceof SourceFileRepNode) {
// MOD klliu bug TDQ-4797 2012-02-29
menu.add(new RenameSqlFileAction(node));
}
boolean isSelectFile = computeSelectedFiles(treeSelection, selectedFiles);
if (isSelectFile && !selectedFiles.isEmpty()) {
menu.add(new OpenSqlFileAction(selectedFiles));
}
}
}
Aggregations