单击swt中表列中的图像时如何打开FileDialog?

时间:2019-03-15 16:04:19

标签: swt jface rcp e4

我正在尝试实现一个具有三列的可编辑表(前两列是可编辑的文本字段,最后一列具有图像)。单击图像时将打开FileDialog。我该如何实施? 最后一列图像来自getImage方法,该方法被ColumnLabelProvider类的重写。

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    //Organization will always be of type text.  The others will be should be numbers, unless user error
    #"Changed Type" = Table.TransformColumnTypes(Source, {{"Organization", type text}, {"A", Int64.Type}, {"B", Int64.Type}, {"C", Int64.Type}}),
   //function to replace all values in all columns with multiplied values
   MultiplyReplace = (DataTable as table, DataTableColumns as list) =>
     let
        Counter = Table.ColumnCount(DataTable),
        ReplaceCol = (DataTableTemp, i) =>
            let
                colName = DataTableColumns{i},
                //LINE THAT WORKS- want this functionality for ALL columns
                ReplaceTable = Table.ReplaceValue(DataTableTemp,each Record.Field(_, colName), each if Record.Field(_, colName) is number then Record.Field(_, colName)*100 else Record.Field(_, colName),Replacer.ReplaceValue,{colName})
                //ReplaceTable = Table.ReplaceValue(DataTableTemp, each col, each if col is number then col*100 else col, Replace.ReplaceValue, colName)
            in
                if i = Counter-1 then ReplaceTable else @ReplaceCol(ReplaceTable, i+1)
     in
        ReplaceCol(DataTable, 0),
    allColumns = Table.ColumnNames(#"Changed Type"),
    #"Multiplied Numerics" = MultiplyReplace(#"Changed Type", allColumns)
    //#"Restored Type" = Value.ReplaceTypes(#"Multiplied Numerics", #"Changed Type")
in
    #"Multiplied Numerics"

enter image description here

0 个答案:

没有答案