Search in sources :

Example 1 with ISearchableCallback

use of org.apache.hop.core.search.ISearchableCallback in project hop by apache.

the class HopDataOrchestrationPerspective method getSearchables.

@Override
public List<ISearchable> getSearchables() {
    List<ISearchable> searchables = new ArrayList<>();
    for (final TabItemHandler item : items) {
        // The type handler is the pipeline or workflow
        // 
        IHopFileTypeHandler typeHandler = item.getTypeHandler();
        searchables.add(new ISearchable() {

            @Override
            public String getLocation() {
                return "Data orchestration perspective in tab : " + item.getTabItem().getText();
            }

            @Override
            public String getName() {
                return typeHandler.getName();
            }

            @Override
            public String getType() {
                return typeHandler.getFileType().getName();
            }

            @Override
            public String getFilename() {
                return typeHandler.getFilename();
            }

            @Override
            public Object getSearchableObject() {
                return typeHandler.getSubject();
            }

            @Override
            public ISearchableCallback getSearchCallback() {
                return (searchable, searchResult) -> {
                    activate();
                    switchToTab(item);
                };
            }
        });
    }
    return searchables;
}
Also used : IHopFileTypeHandler(org.apache.hop.ui.hopgui.file.IHopFileTypeHandler) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) TabItemHandler(org.apache.hop.ui.hopgui.perspective.TabItemHandler) ISearchable(org.apache.hop.core.search.ISearchable) ISearchableCallback(org.apache.hop.core.search.ISearchableCallback)

Aggregations

ArrayList (java.util.ArrayList)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 ISearchable (org.apache.hop.core.search.ISearchable)1 ISearchableCallback (org.apache.hop.core.search.ISearchableCallback)1 IHopFileTypeHandler (org.apache.hop.ui.hopgui.file.IHopFileTypeHandler)1 TabItemHandler (org.apache.hop.ui.hopgui.perspective.TabItemHandler)1