/** * Removes the aggr. * * @param aggrSofa the aggr sofa */ private void removeAggr(String aggrSofa) { Comparator comparator = new Comparator() { @Override public int compare(Object aggrSofaName, Object o2) { SofaMapping sofaMapping = (SofaMapping) o2; if (sofaMapping.getAggregateSofaName().equals(aggrSofaName)) return 0; else return -1; } }; editor.getAeDescription().setSofaMappings( (SofaMapping[]) Utility.removeElementsFromArray(getSofaMappings(), aggrSofa, SofaMapping.class, comparator)); }
pEditor.getAeDescription().setSofaMappings( (SofaMapping[]) Utility.removeElementsFromArray(getSofaMappings(pEditor), null, SofaMapping.class, comparator));
desc.setSofaMappings(sofaMappings);
/** * Adds the aggr. * * @param aggrSofa the aggr sofa * @param sofaNames the sofa names */ private void addAggr(String aggrSofa, String[] sofaNames) { SofaMapping[] newSofas = new SofaMapping[sofaNames.length]; for (int i = 0; i < sofaNames.length; i++) { newSofas[i] = UIMAFramework.getResourceSpecifierFactory().createSofaMapping(); newSofas[i].setAggregateSofaName(aggrSofa); newSofas[i].setComponentKey(getComponentOnly(sofaNames[i])); newSofas[i].setComponentSofaName(getSofaOnly(sofaNames[i])); } SofaMapping[] oldSofas = getSofaMappings(); SofaMapping[] result = new SofaMapping[oldSofas.length + newSofas.length]; System.arraycopy(oldSofas, 0, result, 0, oldSofas.length); System.arraycopy(newSofas, 0, result, oldSofas.length, newSofas.length); editor.getAeDescription().setSofaMappings(result); }
editor.getAeDescription().setSofaMappings( (SofaMapping[]) Utility.removeElementsFromArray(getSofaMappings(), selected.getText(), SofaMapping.class, comparator));
sofaMapping3.setAggregateSofaName("plainTextDocument"); aggDesc.setSofaMappings(new SofaMapping[] {sofaMapping1, sofaMapping2, sofaMapping3});
editor.getAeDescription().setSofaMappings( (SofaMapping[]) Utility.removeElementsFromArray(getSofaMappings(), sofaName, SofaMapping.class, comparator));