Package org.dawb.common.ui.selection
Class SelectionUtils
java.lang.Object
org.dawb.common.ui.selection.SelectionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetFileName(org.eclipse.jface.viewers.IStructuredSelection selection) Method that gives the file name of the IStructuredSelectionstatic StringgetFullFilePath(org.eclipse.jface.viewers.IStructuredSelection selection) Method that gives the full file path of the IStructuredSelectionstatic org.eclipse.january.dataset.DatasetMethod that loads data given a filename and a data pathstatic org.eclipse.january.dataset.IDatasetloadData(org.eclipse.jface.viewers.IStructuredSelection selection) Method that loads data given an IStructuredSelectionstatic SelectedTreeItemInfo[]parseAsTreeSelection(org.eclipse.jface.viewers.ITreeSelection selection) Obtain file path, node path and last object from a tree selectionparseTreeSelectionAsFilePaths(org.eclipse.jface.viewers.ITreeSelection selection) Parse tree selection as file paths
-
Constructor Details
-
SelectionUtils
public SelectionUtils()
-
-
Method Details
-
loadData
public static org.eclipse.january.dataset.IDataset loadData(org.eclipse.jface.viewers.IStructuredSelection selection) Method that loads data given an IStructuredSelection- Parameters:
selection-- Returns:
- IDataset
-
loadData
Method that loads data given a filename and a data path- Parameters:
fileName- the name of the datadataPath- if a NXS file, the data path, otherwise can be null- Returns:
- the data loaded as an Dataset, null if none or not found
-
getFileName
Method that gives the file name of the IStructuredSelection- Parameters:
selection-- Returns:
- String
-
getFullFilePath
Method that gives the full file path of the IStructuredSelection- Parameters:
selection-- Returns:
- String
-
parseAsTreeSelection
public static SelectedTreeItemInfo[] parseAsTreeSelection(org.eclipse.jface.viewers.ITreeSelection selection) Obtain file path, node path and last object from a tree selection- Parameters:
selection-- Returns:
- array of file path, node path and last object (any can be null)
-
parseTreeSelectionAsFilePaths
public static List<String> parseTreeSelectionAsFilePaths(org.eclipse.jface.viewers.ITreeSelection selection) Parse tree selection as file paths- Parameters:
selection-- Returns:
- list of file paths
-