use of org.talend.dataprofiler.core.ui.editor.AbstractAnalysisActionHandler in project tdq-studio-se by Talend.
the class AnalysisColumnTreeViewer method createTree.
/**
* @param parent
*/
private Tree createTree(Composite parent) {
final Tree newTree = new TooltipTree(parent, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION) {
@Override
protected boolean isValidItem(TreeItem item) {
if (item == null) {
return false;
}
Object itemData = item.getData(INDICATOR_UNIT_KEY);
Object columnItemData = item.getData(MODELELEMENT_INDICATOR_KEY);
if (itemData != null) {
IndicatorUnit indicatorUnit = (IndicatorUnit) item.getData(INDICATOR_UNIT_KEY);
if (indicatorUnit != null && !(indicatorUnit.getIndicator() instanceof CompositeIndicator)) {
return true;
}
return false;
} else {
if (columnItemData != null) {
ModelElementIndicator modelElementIndicator = (ModelElementIndicator) columnItemData;
IRepositoryNode modelElementRepositoryNode = modelElementIndicator.getModelElementRepositoryNode();
return modelElementRepositoryNode == null ? false : true;
}
return false;
}
}
@Override
protected String getItemTooltipText(TreeItem item) {
String expCont = isExpressionNull(item);
if (expCont == null) {
// $NON-NLS-1$
return DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.queryNotGen");
}
return expCont;
}
};
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(newTree);
newTree.setHeaderVisible(true);
// $NON-NLS-1$
createTreeItem(newTree, 300, "AnalysisColumnTreeViewer.analyzedColumns");
createTreeDataminingItem(newTree);
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.pattern");
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.udi");
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.operation");
// TDQ-11622 : add a column here, let the width = 1 and text = EMPTY_STRING TODO need to find a better solution!
TreeColumn blankColumn = new TreeColumn(newTree, SWT.CENTER);
blankColumn.setWidth(1);
// ~ TDQ-11622
parent.layout();
AbstractAnalysisActionHandler actionHandler = new AbstractAnalysisActionHandler(parent) {
@Override
protected void handleRemove() {
removeSelectedElements(newTree);
}
};
parent.setData(AbstractMetadataFormPage.ACTION_HANDLER, actionHandler);
ColumnViewerDND.installDND(newTree);
this.addTreeListener(newTree);
newTree.setData(this);
return newTree;
}
use of org.talend.dataprofiler.core.ui.editor.AbstractAnalysisActionHandler in project tdq-studio-se by Talend.
the class AnalysisTableTreeViewer method createTree.
private Tree createTree(Composite parent) {
final Tree newTree = new TooltipTree(parent, SWT.MULTI | SWT.BORDER) {
@Override
protected boolean isValidItem(TreeItem item) {
if (item == null) {
return false;
}
Object itemData = item.getData(INDICATOR_UNIT_KEY);
if (itemData != null) {
TableIndicatorUnit indicatorUnit = (TableIndicatorUnit) item.getData(INDICATOR_UNIT_KEY);
if (indicatorUnit != null && !(indicatorUnit.getIndicator() instanceof CompositeIndicator)) {
return true;
}
return false;
} else {
return false;
}
}
@Override
protected String getItemTooltipText(TreeItem item) {
String expCont = isExpressionNull(item);
if (expCont == null) {
// $NON-NLS-1$
return DefaultMessagesImpl.getString("AnalysisTableTreeViewer.queryNotGen");
}
return expCont;
}
};
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(newTree);
newTree.setHeaderVisible(true);
// $NON-NLS-1$
createTreeItem(newTree, 190, "AnalysisTableTreeViewer.analyzedTables");
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisTableTreeViewer.dqrule");
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.operation");
parent.layout();
AbstractAnalysisActionHandler actionHandler = new AbstractAnalysisActionHandler(parent) {
@Override
protected void handleRemove() {
removeSelectedElements(newTree);
}
};
parent.setData(AbstractMetadataFormPage.ACTION_HANDLER, actionHandler);
TableViewerDND.installDND(newTree);
this.addTreeListener(newTree);
newTree.setData(this);
return newTree;
}
use of org.talend.dataprofiler.core.ui.editor.AbstractAnalysisActionHandler in project tdq-studio-se by Talend.
the class AnalysisColumnNominalIntervalTreeViewer method createTree.
/**
* @param parent
*/
private Tree createTree(Composite parent) {
final Tree newTree = new Tree(parent, SWT.MULTI | SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(newTree);
newTree.setHeaderVisible(true);
// $NON-NLS-1$
createTreeItem(newTree, 300, "AnalysisColumnTreeViewer.analyzedColumns");
createTreeDataminingItem(newTree);
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.operation");
parent.layout();
createTreeMenu(newTree, false);
AbstractAnalysisActionHandler actionHandler = new AbstractAnalysisActionHandler(parent) {
@Override
protected void handleRemove() {
removeSelectedElements(newTree);
// MOD mzhao 2005-05-05 bug 6587.
// MOD mzhao 2009-06-8, bug 5887.
// updateBindConnection(masterPage, tree);
}
};
parent.setData(AbstractMetadataFormPage.ACTION_HANDLER, actionHandler);
addSourceDND(newTree);
addTargetDND(newTree);
addTreeListener(newTree);
return newTree;
}
use of org.talend.dataprofiler.core.ui.editor.AbstractAnalysisActionHandler in project tdq-studio-se by Talend.
the class AnalysisColumnSetTreeViewer method createTree.
/**
* @param parent
*/
private Tree createTree(Composite parent) {
final Tree newTree = new TooltipTree(parent, SWT.MULTI | SWT.BORDER) {
@Override
protected String getItemTooltipText(TreeItem item) {
ModelElementIndicator meIndicator = (ModelElementIndicator) item.getData(MODELELEMENT_INDICATOR_KEY);
IRepositoryNode parentNodeForColumnNode = RepositoryNodeHelper.getParentNodeForColumnNode(meIndicator.getModelElementRepositoryNode());
return DefaultMessagesImpl.getString("AnalysisColumnTreeViewer.columnParent", // $NON-NLS-1$ //;
parentNodeForColumnNode.getObject().getLabel());
}
};
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(newTree);
newTree.setHeaderVisible(true);
// $NON-NLS-1$
createTreeItem(newTree, 300, "AnalysisColumnTreeViewer.analyzedColumns");
createTreeDataminingItem(newTree);
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.pattern");
// $NON-NLS-1$
createTreeItem(newTree, 80, "AnalysisColumnTreeViewer.operation");
parent.layout();
AbstractAnalysisActionHandler actionHandler = new AbstractAnalysisActionHandler(parent) {
@Override
protected void handleRemove() {
removeSelectedElements(newTree);
// MOD mzhao 2005-05-05 bug 6587.
// MOD mzhao 2009-06-8, bug 5887.
updateBindConnection(masterPage, tree);
}
};
parent.setData(AbstractMetadataFormPage.ACTION_HANDLER, actionHandler);
addTargetDND(newTree);
addTreeListener(newTree);
return newTree;
}
Aggregations