Package javax.swing

Examples of javax.swing.DefaultCellEditor$EditorDelegate


      JComboBox _actionComboBox = new JComboBox();
    for (int i = 0; i < model.getColumnCount(); ++i) {
         final TableColumn col = new TableColumn(i, model.getColumnWidth(i));
         col.setHeaderValue(model.getColumnName(i));
         if (i == 3) {
            col.setCellEditor(new DefaultCellEditor(initCbo(_actionComboBox)));
         }
         tcm.addColumn(col);
      }
      setColumnModel(tcm);
      initPopup();
View Full Code Here


  col.setCellRenderer(renderer);
  col.setResizable(false);

  // Setup  Media file column
  col = getColumn("Media");
  TableCellEditor cellEditor = new DefaultCellEditor(new JTextField());
  MediaFileCellEditorListener mcl =
      new MediaFileCellEditorListener();
  cellEditor.addCellEditorListener(mcl);
        col.setCellEditor(cellEditor);
  MediaFileCellRenderer m_renderer = new MediaFileCellRenderer();
  col.setCellRenderer(m_renderer);

  // Setup StartTime column
  col = getColumn("Start Time");
  cellEditor = new DefaultCellEditor(new JTextField());
  StartCellEditorListener scl = new StartCellEditorListener(this);
  cellEditor.addCellEditorListener(scl);
        col.setCellEditor(cellEditor);
        col.setResizable(false);
  col.setCellRenderer(renderer);

  // Setup PlayingTime column
  col = getColumn("Play Time");
  cellEditor = new DefaultCellEditor(new JTextField());
  PlayingTimeCellEditorListener dcl = new PlayingTimeCellEditorListener();
  cellEditor.addCellEditorListener(dcl);
        col.setCellEditor(cellEditor);
  col.setResizable(false);
  col.setCellRenderer(renderer);
    }
View Full Code Here

   */
  public static DefaultCellEditor getInCellEditor(
    JTable table, ColumnDisplayDefinition colDef) {


    DefaultCellEditor ed;

    IDataTypeComponent dataTypeObject = getDataTypeObject(table, colDef);
   
    JTextField textField;
   
    // Default behavior if no data type found is to use a restorable text field
    // with no other special behavior and hope the object has a toString().
    if (dataTypeObject != null)
    {
      textField = dataTypeObject.getJTextField();
    }
    else
    {
      textField = new RestorableJTextField();
    }
         
    // When changing the backgroud color, it helps to set the inner component's border to zero.  Otherwise,
    // the border can obscure the text and make it hard to see.  This is especially seen when using the
    // kunstoff l&f.
    textField.setBackground(Color.yellow);
    textField.setBorder(new EmptyBorder(0,0,0,0));

    ed = new CellEditorUsingRenderer(textField, dataTypeObject);
    ed.setClickCountToStart(1);
    return ed;
  }
View Full Code Here

  public StringTable(StringTableModel stm) {
      super(stm);
      setShowVerticalLines(true);
      setShowHorizontalLines(true);
      setColumnSelectionAllowed(true);
      DefaultCellEditor dce = new DefaultCellEditor(new JTextField());
      dce.setClickCountToStart(2);
      setDefaultEditor(String.class, dce);
      TableColumnModel cm = getColumnModel();
      cm.getColumn(0).setPreferredWidth(800);
      cm.getColumn(1).setPreferredWidth(2000);
      sp.getViewport().setBackground(Globals.prefs.getColor("tableBackground"));
View Full Code Here

        }

        TableColumn resourcesColumn = resourceTable.getColumnModel().getColumn(
                1);
        comboBox.setEditable(false);
        resourcesColumn.setCellEditor(new DefaultCellEditor(comboBox));
    }
View Full Code Here

            comboBox.addItem(role);
        }

        TableColumn rolesColumn = resourceTable.getColumnModel().getColumn(4);
        comboBox.setEditable(false);
        rolesColumn.setCellEditor(new DefaultCellEditor(comboBox));
        rolesColumn.setCellRenderer(new DefaultTableCellRenderer());
    }
View Full Code Here

                    }
                }
            }
        });
        comboBox.setEditable(false);
        predecessorColumn.setCellEditor(new DefaultCellEditor(comboBox));
    }
View Full Code Here

        // Set up the editor for the sport cells.
        DefaultComboBoxModel model = new DefaultComboBoxModel(CONSTRAINTS);
        JComboBox comboBox = new JComboBox(model);
        comboBox.setSelectedIndex(0);
        comboBox.setEditable(false);
        typeColumn.setCellEditor(new DefaultCellEditor(comboBox));
    }
View Full Code Here

    private void setUpHardnessColumnEditor(TableColumn hardnessColumn) {
        DefaultComboBoxModel model = new DefaultComboBoxModel(HARDNESS);
        JComboBox comboBox = new JComboBox(model);
        comboBox.setSelectedIndex(0);
        comboBox.setEditable(false);
        hardnessColumn.setCellEditor(new DefaultCellEditor(comboBox));     
    }
View Full Code Here

        try {
            TableColumn roleColumn = this
                    .getColumn(ResourceTreeTableModel.strResourceRole);
            comboBox.setEditable(false);
            roleColumn.setCellEditor(new DefaultCellEditor(comboBox));
        } catch (IllegalArgumentException ex) {

        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.DefaultCellEditor$EditorDelegate

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.