use of org.talend.dq.nodes.DBConnectionSubFolderRepNode in project tdq-studio-se by Talend.
the class DeleteResourceProvider method shouldShowRenameFolderMenu.
private boolean shouldShowRenameFolderMenu(RepositoryNode node) {
boolean show = false;
if (node instanceof AnalysisSubFolderRepNode) {
AnalysisSubFolderRepNode anaSubFolderNode = (AnalysisSubFolderRepNode) node;
show = !anaSubFolderNode.isVirtualFolder();
} else if (node instanceof ReportSubFolderRepNode) {
ReportSubFolderRepNode repSubFolderNode = (ReportSubFolderRepNode) node;
show = !repSubFolderNode.isVirtualFolder();
} else if (node instanceof UserDefIndicatorSubFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLSubFolderRepNode || node instanceof RulesParserSubFolderRepNode || node instanceof DBConnectionSubFolderRepNode || node instanceof DFConnectionSubFolderRepNode || node instanceof JrxmlTempSubFolderNode) {
show = true;
}
return show;
}
use of org.talend.dq.nodes.DBConnectionSubFolderRepNode in project tdq-studio-se by Talend.
the class SetJDBCDriverPreferencePage method createConnSelectDialog.
private CheckedTreeSelectionDialog createConnSelectDialog() {
RepositoryNode node = (RepositoryNode) RepositoryNodeHelper.getMetadataFolderNode(EResourceConstant.DB_CONNECTIONS);
CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(getShell(), new DQRepositoryViewLabelProvider(), new ResourceViewContentProvider());
dialog.setInput(node);
dialog.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof DBConnectionRepNode) {
return isJdbcConnectionNode((DBConnectionRepNode) element);
} else if (element instanceof DBConnectionSubFolderRepNode) {
return hasJdbcConnNodeChild((DBConnectionSubFolderRepNode) element);
}
return false;
}
});
dialog.setValidator(new ISelectionStatusValidator() {
public IStatus validate(Object[] selection) {
for (Object object : selection) {
if (object instanceof DBConnectionRepNode) {
IRepositoryViewObject nodeObject = ((DBConnectionRepNode) object).getObject();
// when it's locked, can not modify
if (nodeObject != null && nodeObject.getProperty() != null && nodeObject.getProperty().getItem() != null && (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER || nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_USER || RepositoryManager.isOpenedItemInEditor(nodeObject))) {
String displayName = nodeObject.getProperty().getDisplayName();
String version = nodeObject.getProperty().getVersion();
return new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.isLocked", // $NON-NLS-1$ //$NON-NLS-2$
displayName + " " + version));
}
}
}
return new // $NON-NLS-1$
Status(// $NON-NLS-1$
IStatus.OK, // $NON-NLS-1$
PlatformUI.PLUGIN_ID, // $NON-NLS-1$
IStatus.OK, // $NON-NLS-1$
"", null);
}
});
dialog.setContainerMode(true);
// $NON-NLS-1$
dialog.setTitle(DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.selectConnectionButton"));
// $NON-NLS-1$
dialog.setMessage(DefaultMessagesImpl.getString("SetJDBCDriverPreferencePage.ApplytoConnectionEditors"));
dialog.setSize(80, 30);
return dialog;
}
Aggregations