use of org.talend.dataprofiler.core.model.ModelElementIndicator in project tdq-studio-se by Talend.
the class MasterPaginationInfo method render.
@Override
protected void render() {
// refresh analysis tree
if (treeViewer != null) {
treeViewer.setElements(modelElementIndicators.toArray(new ModelElementIndicator[modelElementIndicators.size()]), false);
}
// chart composite don't display So need't consider it.
if (previewChartList == null || uiPagination.getChartComposite() == null) {
return;
}
previewChartList.clear();
clearDynamicList();
if (EditorPreferencePage.isHideGraphicsSectionForSettingsPage() || !TOPChartUtils.getInstance().isTOPChartInstalled()) {
return;
}
for (ModelElementIndicator modelElementIndicator : modelElementIndicators) {
final ExpandableComposite exComp = uiPagination.getToolkit().createExpandableComposite(uiPagination.getChartComposite(), ExpandableComposite.TREE_NODE | ExpandableComposite.CLIENT_INDENT);
needDispostWidgets.add(exComp);
exComp.setText(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.column", // $NON-NLS-1$
modelElementIndicator.getElementName()));
exComp.setLayout(new GridLayout());
exComp.setData(modelElementIndicator);
previewChartList.add(exComp);
Composite comp = uiPagination.getToolkit().createComposite(exComp);
comp.setLayout(new GridLayout());
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
Map<EIndicatorChartType, List<IndicatorUnit>> indicatorComposite = CompositeIndicator.getInstance().getIndicatorComposite(modelElementIndicator);
for (EIndicatorChartType chartType : indicatorComposite.keySet()) {
List<IndicatorUnit> units = indicatorComposite.get(chartType);
if (!units.isEmpty()) {
if (chartType == EIndicatorChartType.UDI_FREQUENCY) {
for (IndicatorUnit unit : units) {
List<IndicatorUnit> specialUnit = new ArrayList<IndicatorUnit>();
specialUnit.add(unit);
createChart(comp, chartType, specialUnit);
}
} else {
createChart(comp, chartType, units);
}
}
}
exComp.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
uiPagination.getChartComposite().layout();
form.reflow(true);
if (e.getState()) {
exComp.setExpanded(e.getState());
exComp.getParent().pack();
}
}
});
exComp.setExpanded(true);
exComp.setClient(comp);
uiPagination.getChartComposite().layout();
}
}
use of org.talend.dataprofiler.core.model.ModelElementIndicator in project tdq-studio-se by Talend.
the class ResultPaginationInfo method render.
@Override
protected void render() {
clearDynamicList();
allExpandableCompositeList.clear();
columnCompositeMap.clear();
for (ModelElementIndicator modelElementIndicator : modelElementIndicators) {
ExpandableComposite exComp = uiPagination.getToolkit().createExpandableComposite(uiPagination.getChartComposite(), ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.EXPANDED | ExpandableComposite.LEFT_TEXT_CLIENT_ALIGNMENT);
needDispostWidgets.add(exComp);
allExpandableCompositeList.add(exComp);
// MOD klliu add more information about the column belongs to which table/view.
IRepositoryNode modelElementRepositoryNode = modelElementIndicator.getModelElementRepositoryNode();
IRepositoryNode parentNodeForColumnNode = RepositoryNodeHelper.getParentNodeForColumnNode(modelElementRepositoryNode);
String label = parentNodeForColumnNode.getObject().getLabel();
if (label != null && !label.equals("")) {
// $NON-NLS-1$
// $NON-NLS-1$
label = label.concat(".").concat(modelElementIndicator.getElementName());
} else {
label = modelElementIndicator.getElementName();
}
// ~
// $NON-NLS-1$
exComp.setText(DefaultMessagesImpl.getString("ColumnAnalysisResultPage.Column", label));
exComp.setLayout(new GridLayout());
exComp.setLayoutData(new GridData(GridData.FILL_BOTH));
// MOD xqliu 2009-06-23 bug 7481
exComp.setExpanded(EditorPreferencePage.isUnfoldingAnalyzedEelementsResultPage());
// ~
// TDQ-11525 msjian : Add "expand all" and "fold all" icon buttons in the "Analysis Results" section
Composite collapseExpandComposite = uiPagination.getToolkit().createComposite(exComp);
GridLayout gdLayout = new GridLayout();
gdLayout.numColumns = 2;
collapseExpandComposite.setLayout(gdLayout);
createCollapseAllLink(collapseExpandComposite, label);
createExpandAllLink(collapseExpandComposite, label);
exComp.setTextClient(collapseExpandComposite);
// TDQ-11525~
Composite comp = uiPagination.getToolkit().createComposite(exComp);
comp.setLayout(new GridLayout());
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
exComp.setClient(comp);
createResultDataComposite(comp, modelElementIndicator);
columnCompositeMap.put(label, comp);
exComp.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
uiPagination.getChartComposite().layout();
form.reflow(true);
}
});
uiPagination.getChartComposite().layout();
masterPage.registerSection(exComp);
}
}
use of org.talend.dataprofiler.core.model.ModelElementIndicator in project tdq-studio-se by Talend.
the class ColumnAnalysisDetailsPage method propertyChange.
public void propertyChange(PropertyChangeEvent evt) {
if (PluginConstant.ISDIRTY_PROPERTY.equals(evt.getPropertyName())) {
((AnalysisEditor) currentEditor).firePropertyChange(IEditorPart.PROP_DIRTY);
((AnalysisEditor) currentEditor).setRefreshResultPage(true);
// synNagivatorStat();
} else if (PluginConstant.DATAFILTER_PROPERTY.equals(evt.getPropertyName())) {
this.analysisHandler.setStringDataFilter((String) evt.getNewValue());
} else if (PluginConstant.EXPAND_TREE.equals(evt.getPropertyName())) {
ModelElementIndicator indicator = (ModelElementIndicator) ((Widget) evt.getNewValue()).getData(AbstractColumnDropTree.MODELELEMENT_INDICATOR_KEY);
expandChart(indicator);
}
}
use of org.talend.dataprofiler.core.model.ModelElementIndicator in project tdq-studio-se by Talend.
the class ColumnAnalysisDetailsPage method computePagination.
/**
* DOC zshen Comment method "computePagination".
*/
private void computePagination() {
disposeChartComposite();
if (uiPagination == null) {
uiPagination = new UIPagination(toolkit, navigationComposite);
} else {
lastTimePageNumber = uiPagination.getCurrentPageNumber();
uiPagination.reset();
}
final ModelElementIndicator[] modelElementIndicatorArrary = this.getCurrentModelElementIndicators();
int pageSize = IndicatorPaginationInfo.getPageSize();
int totalPages = modelElementIndicatorArrary.length / pageSize;
List<ModelElementIndicator> modelElementIndicatorList = null;
for (int index = 0; index < totalPages; index++) {
modelElementIndicatorList = new ArrayList<ModelElementIndicator>();
for (int idx = 0; idx < pageSize; idx++) {
modelElementIndicatorList.add(modelElementIndicatorArrary[index * pageSize + idx]);
}
IndicatorPaginationInfo pginfo = new MasterPaginationInfo(form, previewChartList, modelElementIndicatorList, uiPagination, treeViewer);
uiPagination.addPage(pginfo);
}
int left = modelElementIndicatorArrary.length % pageSize;
if (left != 0 || totalPages == 0) {
modelElementIndicatorList = new ArrayList<ModelElementIndicator>();
for (int leftIdx = 0; leftIdx < left; leftIdx++) {
modelElementIndicatorList.add(modelElementIndicatorArrary[totalPages * pageSize + leftIdx]);
}
IndicatorPaginationInfo pginfo = new MasterPaginationInfo(form, previewChartList, modelElementIndicatorList, uiPagination, treeViewer);
uiPagination.addPage(pginfo);
// FIXME totalPages won't used anymore.
totalPages++;
}
uiPagination.init();
}
use of org.talend.dataprofiler.core.model.ModelElementIndicator in project tdq-studio-se by Talend.
the class ColumnAnalysisDetailsPage method canSave.
@Override
public ReturnCode canSave() {
// MOD by gdbu 2011-3-21 bug 19179
ReturnCode canModRetCode = super.canSave();
if (!canModRetCode.isOk()) {
return canModRetCode;
}
// ~19179
List<ModelElement> analyzedElement = new ArrayList<ModelElement>();
for (ModelElementIndicator modelElementIndicator : treeViewer.getModelElementIndicator()) {
IRepositoryViewObject modelElementRepositoryObj = modelElementIndicator.getModelElementRepositoryNode().getObject();
if (modelElementRepositoryObj instanceof MetadataColumnRepositoryObject) {
analyzedElement.add(((MetadataColumnRepositoryObject) modelElementRepositoryObj).getTdColumn());
}
}
if (!analyzedElement.isEmpty()) {
if (!ModelElementHelper.isFromSameTable(analyzedElement) && !"".equals(dataFilterComp.getDataFilterString())) {
// $NON-NLS-1$
return new ReturnCode(DefaultMessagesImpl.getString("ColumnMasterDetailsPage.CannotCreatAnalysis"), false);
}
}
if (!this.isValidateRowCount()) {
// $NON-NLS-1$
return new ReturnCode(DefaultMessagesImpl.getString("MatchMasterDetailsPage.LoadedRowCountError"), false);
}
return new ReturnCode(true);
}
Aggregations