mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Revert "Remove redundant data source name tool tips from ad hoc kws"
This reverts commit 57d9022c525d077a2b4443a5f1964e031b206df3.
This commit is contained in:
parent
c354181fbf
commit
bd202f5fbf
@ -43,6 +43,7 @@ abstract class AdHocSearchPanel extends javax.swing.JPanel {
|
|||||||
private final String keywordSearchErrorDialogHeader = org.openide.util.NbBundle.getMessage(this.getClass(), "AbstractKeywordSearchPerformer.search.dialogErrorHeader");
|
private final String keywordSearchErrorDialogHeader = org.openide.util.NbBundle.getMessage(this.getClass(), "AbstractKeywordSearchPerformer.search.dialogErrorHeader");
|
||||||
protected int filesIndexed;
|
protected int filesIndexed;
|
||||||
private final Map<Long, String> dataSourceMap = new HashMap<>();
|
private final Map<Long, String> dataSourceMap = new HashMap<>();
|
||||||
|
private final List<String> toolTipList = new ArrayList<>();
|
||||||
private List<DataSource> dataSources = new ArrayList<>();
|
private List<DataSource> dataSources = new ArrayList<>();
|
||||||
private final DefaultListModel<String> dataSourceListModel = new DefaultListModel<>();
|
private final DefaultListModel<String> dataSourceListModel = new DefaultListModel<>();
|
||||||
|
|
||||||
@ -152,12 +153,14 @@ abstract class AdHocSearchPanel extends javax.swing.JPanel {
|
|||||||
*/
|
*/
|
||||||
synchronized List<String> getDataSourceArray() {
|
synchronized List<String> getDataSourceArray() {
|
||||||
List<String> dsList = new ArrayList<>();
|
List<String> dsList = new ArrayList<>();
|
||||||
|
toolTipList.clear();
|
||||||
Collections.sort(this.dataSources, (DataSource ds1, DataSource ds2) -> ds1.getName().compareTo(ds2.getName()));
|
Collections.sort(this.dataSources, (DataSource ds1, DataSource ds2) -> ds1.getName().compareTo(ds2.getName()));
|
||||||
for (DataSource ds : dataSources) {
|
for (DataSource ds : dataSources) {
|
||||||
String dsName = ds.getName();
|
String dsName = ds.getName();
|
||||||
File dataSourceFullName = new File(dsName);
|
File dataSourceFullName = new File(dsName);
|
||||||
String displayName = dataSourceFullName.getName();
|
String displayName = dataSourceFullName.getName();
|
||||||
dataSourceMap.put(ds.getId(), displayName);
|
dataSourceMap.put(ds.getId(), displayName);
|
||||||
|
toolTipList.add(dsName);
|
||||||
dsList.add(displayName);
|
dsList.add(displayName);
|
||||||
}
|
}
|
||||||
return dsList;
|
return dsList;
|
||||||
@ -181,6 +184,14 @@ abstract class AdHocSearchPanel extends javax.swing.JPanel {
|
|||||||
return dataSourceMap;
|
return dataSourceMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of tooltip text for data source
|
||||||
|
* @return A list of tool tips
|
||||||
|
*/
|
||||||
|
List<String> getDataSourceToolTipList() {
|
||||||
|
return toolTipList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of DataSourceListModel
|
* Get a list of DataSourceListModel
|
||||||
* @return A list of DataSourceListModel
|
* @return A list of DataSourceListModel
|
||||||
|
@ -73,6 +73,22 @@ class DropdownListSearchPanel extends AdHocSearchPanel {
|
|||||||
dataSourceList.addListSelectionListener((ListSelectionEvent evt) -> {
|
dataSourceList.addListSelectionListener((ListSelectionEvent evt) -> {
|
||||||
firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null);
|
firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null);
|
||||||
});
|
});
|
||||||
|
dataSourceList.addMouseMotionListener(new MouseMotionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseDragged(MouseEvent evt) {
|
||||||
|
//Unused by now
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseMoved(MouseEvent evt) {
|
||||||
|
JList<String> dsList = (JList<String>) evt.getSource();
|
||||||
|
int index = dsList.locationToIndex(evt.getPoint());
|
||||||
|
if (index > -1) {
|
||||||
|
dsList.setToolTipText(getDataSourceToolTipList().get(index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static synchronized DropdownListSearchPanel getDefault() {
|
static synchronized DropdownListSearchPanel getDefault() {
|
||||||
|
@ -88,6 +88,22 @@ public class DropdownSingleTermSearchPanel extends AdHocSearchPanel {
|
|||||||
this.dataSourceList.addListSelectionListener((ListSelectionEvent evt) -> {
|
this.dataSourceList.addListSelectionListener((ListSelectionEvent evt) -> {
|
||||||
firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null);
|
firePropertyChange(Bundle.DropdownSingleTermSearchPanel_selected(), null, null);
|
||||||
});
|
});
|
||||||
|
this.dataSourceList.addMouseMotionListener(new MouseMotionListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseDragged(MouseEvent evt) {
|
||||||
|
//Unused by now
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseMoved(MouseEvent evt) {
|
||||||
|
JList<String> DsList = (JList<String>) evt.getSource();
|
||||||
|
int index = DsList.locationToIndex(evt.getPoint());
|
||||||
|
if (index > -1) {
|
||||||
|
DsList.setToolTipText(getDataSourceToolTipList().get(index));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user