Package javax.swing.table

Examples of javax.swing.table.TableCellEditor


    return dataModel.getData();
  }

  public void setData(final ReportElement[] elements)
  {
    final TableCellEditor tableCellEditor = table.getCellEditor();
    if (tableCellEditor != null)
    {
      tableCellEditor.stopCellEditing();
    }

    dataModel.setData(elements);
  }
View Full Code Here


    return dataModel.getData();
  }

  public void setData(final Element[] elements)
  {
    final TableCellEditor tableCellEditor = table.getCellEditor();
    if (tableCellEditor != null)
    {
      tableCellEditor.stopCellEditing();
    }

    dataModel.setData(elements);
  }
View Full Code Here

  public void test(TestHarness harness)
  {
    TableColumn c = new TableColumn();
    harness.check(c.getCellEditor(), null);
    c.addPropertyChangeListener(this);
    TableCellEditor editor = new DefaultCellEditor(new JTextField());
    c.setCellEditor(editor);
    harness.check(c.getCellEditor(), editor);
    PropertyChangeEvent e = (PropertyChangeEvent) events.get(0);
    harness.check(e.getPropertyName(), "cellEditor");
    harness.check(e.getOldValue(), null);
View Full Code Here

 
  private void testConstructor4(TestHarness harness
  {
    harness.checkPoint("TableColumn(int, int, TableCellRenderer, TableCellEditor)");
    TableCellRenderer renderer = new DefaultTableCellRenderer();
    TableCellEditor editor = new DefaultCellEditor(new JCheckBox());
    TableColumn c1 = new TableColumn(1, 33, renderer, editor);
    harness.check(c1.getModelIndex(), 1);
    harness.check(c1.getMinWidth(), 15);
    harness.check(c1.getWidth(), 33);
    harness.check(c1.getMaxWidth(), Integer.MAX_VALUE);
View Full Code Here

    cellEditors.clear();
  }

  //overwritten JTable method 
  public TableCellEditor getCellEditor(int row,int col) {
    TableCellEditor tce = (TableCellEditor) cellEditors.get(new Integer(row));
    if( tce != null) {
      return tce;
    } else {
      return super.getCellEditor(row,col);
    }
View Full Code Here

      final JTableHeader tableHeader = (JTableHeader) eventSource;

      removeColumnAction.setEnabled(table.getColumnCount() > 1);
      removeRowAction.setEnabled(false);

      final TableCellEditor theTableCellEditor = table.getCellEditor();
      if (theTableCellEditor != null)
      {
        table.getCellEditor().stopCellEditing();
      }
View Full Code Here

    setSequence(sequenceModel.getSelectedKey());
  }

  public void stopEditing ()
  {
    final TableCellEditor cellEditor = propertyTable.getCellEditor();
    if (cellEditor != null)
    {
      cellEditor.stopCellEditing();
    }
  }
View Full Code Here

    }
    if (!isCellEditable(index))
    {
      return false;
    }
    final TableCellEditor editor = getCellEditor(index);

    if (editor != null && editor.isCellEditable(e))
    {
      editorComp = prepareEditor(editor, index);
      editorComp.setBounds(getHeaderRect(index));
      add(editorComp);
      editorComp.validate();
      setCellEditor(editor);
      setEditingColumn(index);
      editor.addCellEditorListener(this);

      return true;
    }
    return false;
  }
View Full Code Here

    return col.getHeaderEditor();
  }

  public void setCellEditor(final TableCellEditor newEditor)
  {
    final TableCellEditor oldEditor = cellEditor;
    cellEditor = newEditor;
    if (oldEditor != null)
    {
      oldEditor.removeCellEditorListener(this);
    }
    if (newEditor != null)
    {
      newEditor.addCellEditorListener(this);
    }
View Full Code Here

    return editingColumn;
  }

  public void removeEditor()
  {
    final TableCellEditor editor = getCellEditor();
    if (editor != null)
    {
      editor.removeCellEditorListener(this);

      requestFocus();
      remove(editorComp);

      final int index = getEditingColumn();
View Full Code Here

TOP

Related Classes of javax.swing.table.TableCellEditor

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.