use of com.amalto.workbench.dialogs.filter.SortFieldSelectionFilter in project tmdm-studio-se by Talend.
the class ViewMainPage method addListener.
private void addListener() {
combox_policy.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
boolean toSelectXPath = combox_policy.getText().equals(selectXPath);
if (toSelectXPath) {
String modelName = getDatamodelName();
String entityName = concept;
XpathSelectDialog dlg = getXPathSelectionDialog(Messages.ViewMainPage_titleSelectField, modelName, new SortFieldSelectionFilter());
dlg.setConceptName(entityName);
String xpath = null;
if (dlg.open() == IDialogConstants.OK_ID) {
xpath = dlg.getXpath();
}
if (xpath != null) {
combox_policy.setItems(new String[] { SORT_FIELD[0], SORT_FIELD[1], xpath, selectXPath });
combox_policy.setText(xpath);
combox_sortdirection.setVisible(true);
combox_sortdirection.select(0);
markDirtyWithoutCommit();
} else {
lastSortField = lastSortField == null ? SORT_FIELD[0] : lastSortField;
combox_policy.setText(lastSortField);
}
} else if (combox_policy.getSelectionIndex() != 0 && combox_policy.getSelectionIndex() != 1) {
combox_sortdirection.setVisible(true);
combox_sortdirection.select(0);
lastSortField = combox_policy.getText();
markDirtyWithoutCommit();
} else {
lastSortField = combox_policy.getText();
combox_sortdirection.setVisible(false);
markDirtyWithoutCommit();
}
}
});
combox_policy.addMouseTrackListener(new MouseTrackAdapter() {
@Override
public void mouseHover(MouseEvent e) {
combox_policy.setToolTipText(combox_policy.getText());
}
});
combox_sortdirection.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
markDirtyWithoutCommit();
}
});
}
Aggregations