Package org.fusesource.ide.commons.ui.label

Examples of org.fusesource.ide.commons.ui.label.FunctionColumnLabelProvider


    for (Entry<String, Function1> entry : entrySet) {
      String header = entry.getKey();
      Function1 function = entry.getValue();
      addFunction(function);
      TreeViewerColumn col = createTreeViewerColumn(header, bounds, column++);
      col.setLabelProvider(new FunctionColumnLabelProvider(function));
    }
  }
View Full Code Here


      }
    }
  }

  protected CellLabelProvider createColumnLabelProvider(String header, Function1 function) {
    return new FunctionColumnLabelProvider(function);
  }
View Full Code Here

   * Based on the table configuration and defaults lets update the label provider for the column
   */
  protected void configureLabelProvider(ViewerColumn viewerColumn, ColumnConfiguration config, CellLabelProvider labelProvider) {
    Class<?> returnType = Objects.getReturnType(labelProvider);
    String style = config.getLabelProviderStyle();
    FunctionColumnLabelProvider flp = null;
    if (labelProvider instanceof FunctionColumnLabelProvider) {
      flp = (FunctionColumnLabelProvider) labelProvider;
      returnType = flp.getReturnType();
    }
    if (viewerColumn != null) {
      CellLabelProvider provider = config.getLabelProvider();
      if (provider != null) {
        viewerColumn.setLabelProvider(provider);
      } else {
        if (style != null && style.equals("timeThenDate")) {
          if (flp != null) {
            viewerColumn.setLabelProvider(new TimeThenDateFunctionLabelProvider(flp.getFunction()));
          } else {
            viewerColumn.setLabelProvider(new TimeThenDateLabelProvider());
          }
        } else if (style != null && style.equals("longTimestampAsTimeThenDate")) {
          viewerColumn.setLabelProvider(new LongTimestampAsTimeThenDateLabelProvider());
        } else if (Objects.isNumberType(returnType)) {
          if (style == null || !style.equals("plain")) {
            viewerColumn.setLabelProvider(new ChartLabelProvider(labelProvider, getViewer()));
          }
        } else if (Objects.equal(style, "image") && flp != null) {
          viewerColumn.setLabelProvider(new ImageLabelProvider(flp.getFunction()));
        }
      }
    }
  }
View Full Code Here

    col.setLabelProvider(labelProvider);
    return column;
  }

  protected int addColumnFunction(int bounds, int column, final Function1 function, String columnName) {
    return addColumnFunction(bounds, column, function, columnName, new FunctionColumnLabelProvider(function));
  }
View Full Code Here

  protected int addColumnFunction(int bounds, int column, final Function1<Object, Object> function, String columnName) {
    addFunction(function);
    TableViewerColumn col = createTableViewerColumn(columnName,
        bounds, column++);
    col.setLabelProvider(new FunctionColumnLabelProvider(function));
    return column;
  }
View Full Code Here

TOP

Related Classes of org.fusesource.ide.commons.ui.label.FunctionColumnLabelProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.