/** * Creates the fs index key description. * * @return the fs index key description */ public FsIndexKeyDescription createFsIndexKeyDescription() { return UIMAFramework.getResourceSpecifierFactory().createFsIndexKeyDescription(); }
/** * Make key. * * @param item the item * @return the fs index key description */ private FsIndexKeyDescription makeKey(TableItem item) { FsIndexKeyDescription key = UIMAFramework.getResourceSpecifierFactory() .createFsIndexKeyDescription(); boolean typePriority = TYPE_PRIORITY.equals(item.getText(1)); key.setTypePriority(typePriority); if (!typePriority) { key.setFeatureName(item.getText(0)); key.setComparator(STANDARD.equals(item.getText(1)) ? FSIndexComparator.STANDARD_COMPARE : FSIndexComparator.REVERSE_STANDARD_COMPARE); } return key; }
/** * Adds the or edit index key. * * @param dialog the dialog * @param key the key * @return the fs index key description */ public FsIndexKeyDescription addOrEditIndexKey(AddIndexKeyDialog dialog, FsIndexKeyDescription key) { if (dialog.open() == Window.CANCEL) { return null; } if (null == key) key = UIMAFramework.getResourceSpecifierFactory().createFsIndexKeyDescription(); if (dialog.typePriority) { key.setTypePriority(setValueChangedBoolean(true, key.isTypePriority())); key.setFeatureName(null); } else { key.setFeatureName(setValueChanged(dialog.featureName, key.getFeatureName())); key.setComparator(setValueChangedInt(dialog.direction, key.getComparator())); key.setTypePriority(false); } return key; }