Package com.projity.pm.graphic.spreadsheet.renderer

Examples of com.projity.pm.graphic.spreadsheet.renderer.SpreadSheetCellRendererAdapter


        tc.setCellRenderer(new SpreadSheetNameCellRenderer());
//        tc.setCellEditor(new SpreadSheetNameCellEditor(new SimpleEditor(String.class)));
        tc.setCellEditor(new SpreadSheetCellEditorAdapter(new SimpleEditor(String.class)));
      } else if (field == Configuration.getFieldFromId("Field.indicators")) {
        tc.setPreferredWidth(50);
        tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new IndicatorsRenderer()));
        tc.setHeaderRenderer(new SpreadSheetColumnHeaderRenderer(IndicatorsRenderer.getCellHeader()));
      } else if (field.getLookupTypes() != null) {
        tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new LookupRenderer()));
      } else {
        tc.setPreferredWidth(150);
        if (field.hasOptions()) {
          tc.setPreferredWidth(150);
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new SimpleRenderer()));
          // note that in Spreadsheet, there getCellEditor() is
          // overridden and dynamic combos are filled there
          tc.setCellEditor(new SpreadSheetCellEditorAdapter(new SimpleComboBoxEditor(new DefaultComboBoxModel(field.getOptions(null)))));
        } else if (field.getRange() != null) {
          if (field.isPercent())
            tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new PercentRenderer()));
          else
            tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new SimpleRenderer()));
          tc.setCellEditor(new SpreadSheetCellEditorAdapter(new SpinEditor(field)));
        } else if (field.isRate()) {
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new RateRenderer()));
          tc.setCellEditor(new SpreadSheetCellEditorAdapter(new RateEditor(null, field.isMoney(),field.isPercent(),true)));
        } else if (field.isMoney()) {
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new SimpleRenderer()));
          tc.setCellEditor(new SpreadSheetCellEditorAdapter(new MoneyEditor()));
        } else if (field.isPercent()) {
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new PercentRenderer()));
        } else if (field.isDate()) {
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new DateRenderer()));
        } else if (field.isBoolean()){
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new OfflineCapableBooleanRenderer()));
        } else {
          //SimpleRenderer in other cases, LC 8/2006
          tc.setCellRenderer(new SpreadSheetCellRendererAdapter(new SimpleRenderer()));
          tc.setPreferredWidth(field.getColumnWidth(svg));
        }
      }
      Integer size=colWidthMap.get(field.getId());
      if (size==null||size<=0) colWidthMap.put(field.getId(),tc.getPreferredWidth());
View Full Code Here


    setAdaptedEditor(Money.class,new SimpleEditor(Money.class));
   
    editorsRegistered=true;
  }
  protected void setAdaptedRenderer(Class columnClass,TableCellRenderer renderer) {
    setDefaultRenderer(columnClass,new SpreadSheetCellRendererAdapter(
        (renderer==null)?getDefaultRenderer(columnClass):renderer));
  }
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.spreadsheet.renderer.SpreadSheetCellRendererAdapter

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.