use of org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider in project tdq-studio-se by Talend.
the class IndicatorSettingsPage method openAnalysesSelectionDialog.
/**
* DOC qzhang Comment method "openAnalysesSelectionDialog".
*/
protected void openAnalysesSelectionDialog(boolean isLowCase) {
SpecialLimitFrequencyAnalysisFilter limitFilter = new SpecialLimitFrequencyAnalysisFilter(isLowCase ? 0 : freResultLimit, isLowCase ? lowFreResultLimit : 0);
CheckedTreeSelectionDialog checkedTreeSelectionDialog = new CheckedTreeSelectionDialog(this.getShell(), new DQRepositoryViewLabelProviderWithFilter(limitFilter), new ResourceViewContentProvider());
// $NON-NLS-1$
checkedTreeSelectionDialog.setTitle(DefaultMessagesImpl.getString("IndicatorSettingsPage.analysisSelectDialog.title"));
checkedTreeSelectionDialog.setMessage(// $NON-NLS-1$
DefaultMessagesImpl.getString("IndicatorSettingsPage.analysisSelectDialog.message"));
checkedTreeSelectionDialog.setContainerMode(true);
checkedTreeSelectionDialog.addFilter(new SelectAnalysisDialogNodeFilter());
checkedTreeSelectionDialog.addFilter(limitFilter);
DQRepositoryNode analysisSelectDialogInputData = AnalysisUtils.getAnalysisSelectDialogInputDataWithoutRef(EResourceConstant.ANALYSIS);
checkedTreeSelectionDialog.setInput(analysisSelectDialogInputData);
if (checkedTreeSelectionDialog.open() == Dialog.OK) {
Object[] result = checkedTreeSelectionDialog.getResult();
for (Object obj : result) {
if (obj instanceof AnalysisRepNode) {
AnalysisRepNode anaNode = (AnalysisRepNode) obj;
modifyAndSaveLimit(anaNode, isLowCase);
}
}
}
}
use of org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider in project tdq-studio-se by Talend.
the class TwoPartCheckSelectionDialog method createFirstPart.
/**
* Creates the tree viewer.
*
* @param parent the parent composite
* @return the tree viewer
*/
protected CheckboxTreeViewer createFirstPart(Composite parent) {
if (fContainerMode) {
if (DIALOG_TYPE_TABLE == this.getDialogType()) {
fViewer = new TableSelectionViewer(parent, SWT.BORDER);
} else if (!this.addConnFilter) {
fViewer = new MatchColumnSelectionViewer(parent, SWT.BORDER);
} else {
fViewer = new ColumnSelectionViewer(parent, SWT.BORDER);
}
// {
//
// protected void handleTreeExpand(TreeEvent event) {
// super.handleTreeExpand(event);
// checkElementChecked();
// }
// };
} else {
fViewer = new CheckboxTreeViewer(parent, SWT.BORDER) {
@Override
protected void handleTreeExpand(TreeEvent event) {
super.handleTreeExpand(event);
// checkElementChecked();
}
};
}
fViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
applyDialogFont(fViewer.getTree());
fViewer.setContentProvider(fContentProvider);
// mod gdbu 2011-7-25 bug 23220
((ResourceViewContentProvider) fContentProvider).setTreeViewer(fViewer);
// ~23220
fViewer.setLabelProvider(fLabelProvider);
fViewer.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
updateOKStatus();
}
});
fViewer.setComparator(fComparator);
if (fFilters != null) {
for (int i = 0; i != fFilters.size(); i++) {
fViewer.addFilter(fFilters.get(i));
}
}
fViewer.setInput(fInput);
// fViewer.
fViewer.addSelectionChangedListener(this);
return fViewer;
}
use of org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider in project tdq-studio-se by Talend.
the class UDIUtils method createUdiCheckedTreeSelectionDialog.
/**
* DOC xqliu Comment method "createUdiCheckedTreeSelectionDialog".
*
* @param meIndicator
* @return
*/
public static CheckedTreeSelectionDialog createUdiCheckedTreeSelectionDialog(ModelElementIndicator meIndicator) {
CheckedTreeSelectionDialog dialog = new CheckedTreeSelectionDialog(null, new DQRepositoryViewLabelProvider(), new ResourceViewContentProvider());
dialog.addFilter(new FolderObjFilter());
DQRepositoryNode udiDialogInputData = AnalysisUtils.getSelectDialogInputData(EResourceConstant.USER_DEFINED_INDICATORS);
dialog.setInput(udiDialogInputData);
dialog.setValidator(new ISelectionStatusValidator() {
public IStatus validate(Object[] selection) {
for (Object patte : selection) {
if (patte instanceof SysIndicatorDefinitionRepNode) {
SysIndicatorDefinitionRepNode udiNode = (SysIndicatorDefinitionRepNode) patte;
IndicatorDefinition indicatorDefinition = udiNode.getIndicatorDefinition();
boolean validStatus = TaggedValueHelper.getValidStatus(indicatorDefinition);
if (!validStatus) {
return new Status(IStatus.ERROR, CorePlugin.PLUGIN_ID, DefaultMessagesImpl.getString(// $NON-NLS-1$
"AnalysisColumnTreeViewer.chooseValidUdis"));
}
}
}
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);
dialog.setInitialSelections(getUDIFilesByIndicator(udiDialogInputData, meIndicator));
// $NON-NLS-1$
dialog.setTitle(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.udiSelector"));
// $NON-NLS-1$
dialog.setMessage(DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.udis"));
dialog.setSize(80, 30);
return dialog;
}
use of org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider 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;
}
use of org.talend.dataprofiler.core.ui.views.provider.ResourceViewContentProvider in project tdq-studio-se by Talend.
the class AnalysisDPSelectionPage method createMetaDataTree.
private void createMetaDataTree(Composite parent) {
Composite treeContainer = new Composite(parent, SWT.NONE);
treeContainer.setLayoutData(new GridData(GridData.FILL_BOTH));
treeContainer.setLayout(new FillLayout());
int style = this.multiSelect ? SWT.BORDER | SWT.MULTI : SWT.BORDER;
fViewer = new TreeViewer(treeContainer, style);
fViewer.setContentProvider(fContentProvider);
fViewer.setLabelProvider(fLabelProvider);
fViewer.setInput(RepositoryNodeHelper.getRootNode(ERepositoryObjectType.METADATA, true));
// MOD gdbu 2011-7-25 bug : 23220
((ResourceViewContentProvider) fContentProvider).setTreeViewer(fViewer);
// ~23220
}
Aggregations