Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 package org.apache.cayenne.modeler.util;
 public class CellEditorForAttributeTable implements TableCellEditor {
         protected Hashtable editors;
         protected TableCellEditor editordefaultEditor;
         JTable table;
         public CellEditorForAttributeTable(JTable tableJComboBox combo) {
             this. = table;
              = new Hashtable();
             if (combo != null) {
                  = new DefaultCellEditor(combo);
             else {
                  = new DefaultCellEditor(new JComboBox());
         public void setEditorAt(int rowTableCellEditor editor) {
             .put(new Integer(row), editor);
         public Component getTableCellEditorComponent(
                 JTable table,
                 Object value,
                 boolean isSelected,
                 int row,
                 int column) {
             return .getTableCellEditorComponent(
         public Object getCellEditorValue() {
             return .getCellEditorValue();
         public boolean stopCellEditing() {
             return .stopCellEditing();
         public void cancelCellEditing() {
         public boolean isCellEditable(EventObject anEvent) {
             return .isCellEditable(anEvent);
         public void addCellEditorListener(CellEditorListener l) {
         public void removeCellEditorListener(CellEditorListener l) {
         public boolean shouldSelectCell(EventObject anEvent) {
             return .shouldSelectCell(anEvent);
         protected void selectEditor(MouseEvent e) {
            int row;
            if (e == null) {
                row = .getSelectionModel().getAnchorSelectionIndex();
            else {
                row = .rowAtPoint(e.getPoint());
             = (TableCellEditor.get(new Integer(row));
            if ( == null) {
                 = ;
New to GrepCode? Check out our FAQ X