Search in sources :

Example 1 with ExternalFinderItem

use of org.omegat.externalfinder.item.ExternalFinderItem in project omegat by omegat-org.

the class ExternalFinder method getItems.

public static List<ExternalFinderItem> getItems() {
    // replace duplicated items based on name
    List<ExternalFinderItem> result = new ArrayList<>(getGlobalConfig().getItems());
    ExternalFinderConfiguration projectConfig = getProjectConfig();
    if (projectConfig != null) {
        projectConfig.getItems().forEach(item -> addOrReplaceByName(result, item));
    }
    return Collections.unmodifiableList(result);
}
Also used : ExternalFinderItem(org.omegat.externalfinder.item.ExternalFinderItem) ArrayList(java.util.ArrayList) ExternalFinderConfiguration(org.omegat.externalfinder.item.ExternalFinderConfiguration)

Example 2 with ExternalFinderItem

use of org.omegat.externalfinder.item.ExternalFinderItem in project omegat by omegat-org.

the class ExternalFinderPreferencesController method editSelection.

private void editSelection() {
    int row = panel.itemTable.getSelectedRow();
    if (row >= 0) {
        ItemsTableModel model = (ItemsTableModel) panel.itemTable.getModel();
        ExternalFinderItem item = model.getItemAtRow(row);
        ExternalFinderItemEditorController editor = new ExternalFinderItemEditorController(item);
        if (editor.show(SwingUtilities.windowForComponent(panel))) {
            model.setItemAtRow(row, editor.getResult());
        }
    }
}
Also used : ExternalFinderItem(org.omegat.externalfinder.item.ExternalFinderItem)

Aggregations

ExternalFinderItem (org.omegat.externalfinder.item.ExternalFinderItem)2 ArrayList (java.util.ArrayList)1 ExternalFinderConfiguration (org.omegat.externalfinder.item.ExternalFinderConfiguration)1