Search in sources :

Example 6 with Tuple2

use of eu.ggnet.dwoss.util.Tuple2 in project dwoss by gg-net.

the class UniversalSearcherOperation method searchDocuments.

/**
 * Search for Documents where the search matches the identifier.
 * This method will search for any partial matches from the beginning of a identifier if a wildcard is used.
 * <p/>
 * @param identifier the identifier to search for
 * @param type
 * @return a List of Tuple2 containing document.id and string representation
 */
// Used in Misc. Unversal Search
@Override
public List<Tuple2<Long, String>> searchDocuments(String identifier, DocumentType type) {
    List<Tuple2<Long, String>> result = new ArrayList<>();
    List<Document> documents = new DocumentEao(redTapeEm).findByIdentifierAndType(identifier, type);
    for (Document document : documents) {
        String s = DocumentFormater.toHtmlSimple(document);
        Tuple2<Long, String> tuple = new Tuple2<>(document.getId(), s);
        result.add(tuple);
    }
    return result;
}
Also used : DocumentEao(eu.ggnet.dwoss.redtape.ee.eao.DocumentEao) Tuple2(eu.ggnet.dwoss.util.Tuple2) Document(eu.ggnet.dwoss.redtape.ee.entity.Document)

Example 7 with Tuple2

use of eu.ggnet.dwoss.util.Tuple2 in project dwoss by gg-net.

the class TupleHtmlRenderer method getListCellRendererComponent.

@Override
public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
    JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    if (value instanceof Tuple2) {
        label.setText("<html>" + ((Tuple2<Long, String>) value)._2 + "</html>");
        label.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    }
    return label;
}
Also used : Tuple2(eu.ggnet.dwoss.util.Tuple2) JLabel(javax.swing.JLabel)

Aggregations

Tuple2 (eu.ggnet.dwoss.util.Tuple2)7 UiCustomer (eu.ggnet.dwoss.customer.opi.UiCustomer)2 JLabel (javax.swing.JLabel)2 LegacyUnit (eu.ggnet.dwoss.redtape.ee.api.LegacyUnit)1 DocumentEao (eu.ggnet.dwoss.redtape.ee.eao.DocumentEao)1 DossierEao (eu.ggnet.dwoss.redtape.ee.eao.DossierEao)1 Document (eu.ggnet.dwoss.redtape.ee.entity.Document)1 Dossier (eu.ggnet.dwoss.redtape.ee.entity.Dossier)1 Position (eu.ggnet.dwoss.redtape.ee.entity.Position)1 UnitOverseer (eu.ggnet.dwoss.redtapext.ee.UnitOverseer)1 UnitAvailabilityViewCask (eu.ggnet.dwoss.redtapext.ui.cap.UnitAvailabilityViewCask)1 UnitShard (eu.ggnet.dwoss.uniqueunit.api.UnitShard)1 UniqueUnitEao (eu.ggnet.dwoss.uniqueunit.ee.eao.UniqueUnitEao)1 UniqueUnit (eu.ggnet.dwoss.uniqueunit.ee.entity.UniqueUnit)1 UserInfoException (eu.ggnet.dwoss.util.UserInfoException)1 Result (eu.ggnet.dwoss.util.interactiveresult.Result)1