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

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


        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


    if (editorsRegistered) return;
    GraphicConfiguration config=GraphicConfiguration.getInstance();
   
    //Modify here to register a custom editor
    //all the types used have to be registered here
    setAdaptedRenderer(String.class,new SimpleRenderer());
    setAdaptedEditor(String.class,new SimpleEditor(String.class));
   
    setAdaptedRenderer(Integer.class,new SimpleRenderer());
    setAdaptedEditor(Integer.class,new SimpleEditor(Integer.class));
   
    setAdaptedRenderer(Double.class,new SimpleRenderer());
    setAdaptedEditor(Double.class,new SimpleEditor(Double.class));
   
       setAdaptedEditor(Date.class, new DateEditor());
//       setAdaptedRenderer(Date.class, new DateRendererDecorator( new SimpleRenderer(), format)); // format will be used
       setAdaptedRenderer(Date.class,new DateRenderer());
      
       setAdaptedRenderer(Boolean.class,new OfflineCapableBooleanRenderer());
    //setAdaptedRenderer(Boolean.class,null);
    setAdaptedEditor(Boolean.class,null);
   
    setAdaptedRenderer(Work.class,new SimpleRenderer(compact));
    setAdaptedEditor(Work.class,new SimpleEditor(Work.class));

    setAdaptedRenderer(Duration.class,new SimpleRenderer());
    setAdaptedEditor(Duration.class,new SimpleEditor(Duration.class));
//    setDefaultEditor(Duration.class,new DefaultCellEditor(new JTextField()));
    setAdaptedRenderer(Money.class,new SimpleRenderer(compact));
    setAdaptedEditor(Money.class,new SimpleEditor(Money.class));
   
    editorsRegistered=true;
  }
View Full Code Here

TOP

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

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.