Class SelectionUtils

java.lang.Object
org.dawb.common.ui.selection.SelectionUtils

public class SelectionUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getFileName(org.eclipse.jface.viewers.IStructuredSelection selection)
    Method that gives the file name of the IStructuredSelection
    static String
    getFullFilePath(org.eclipse.jface.viewers.IStructuredSelection selection)
    Method that gives the full file path of the IStructuredSelection
    static org.eclipse.january.dataset.Dataset
    loadData(String fileName, String dataPath)
    Method that loads data given a filename and a data path
    static org.eclipse.january.dataset.IDataset
    loadData(org.eclipse.jface.viewers.IStructuredSelection selection)
    Method that loads data given an IStructuredSelection
    parseAsTreeSelection(org.eclipse.jface.viewers.ITreeSelection selection)
    Obtain file path, node path and last object from a tree selection
    static List<String>
    parseTreeSelectionAsFilePaths(org.eclipse.jface.viewers.ITreeSelection selection)
    Parse tree selection as file paths

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public static org.eclipse.january.dataset.Dataset loadData(String fileName, String dataPath)
      Method that loads data given a filename and a data path
      Parameters:
      fileName - the name of the data
      dataPath - 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

      public static String getFileName(org.eclipse.jface.viewers.IStructuredSelection selection)
      Method that gives the file name of the IStructuredSelection
      Parameters:
      selection -
      Returns:
      String
    • getFullFilePath

      public static String getFullFilePath(org.eclipse.jface.viewers.IStructuredSelection selection)
      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