use of org.gephi.datalab.api.SearchReplaceController.SearchOptions in project gephi by gephi.
the class SearchReplaceUI method createSearchOptions.
private void createSearchOptions() {
boolean onlyVisibleElements = Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible();
searchResult = null;
columnsToSearchComboBox.removeAllItems();
Table table;
if (mode == Mode.NODES_TABLE) {
Node[] nodes;
if (onlyVisibleElements) {
//Search on visible nodes:
nodes = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible().getNodes().toArray();
} else {
//Search on all nodes
nodes = new Node[0];
}
searchOptions = new SearchOptions(nodes, null);
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getNodeTable();
} else {
Edge[] edges;
if (onlyVisibleElements) {
//Search on visible edges:
edges = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible().getEdges().toArray();
} else {
//Search on all edges
edges = new Edge[0];
}
searchOptions = new SearchOptions(edges, null);
table = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getEdgeTable();
}
//Fill possible columns to search (first value is all columns):
columnsToSearchComboBox.addItem(NbBundle.getMessage(SearchReplaceUI.class, "SearchReplaceUI.allColumns"));
for (Column c : table) {
columnsToSearchComboBox.addItem(new ColumnWrapper(c));
}
}
Aggregations