org.jdesktop.swingbinding.adapters.JTableAdapterProvider Maven / Gradle / Ivy
The newest version!
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc. All rights reserved. Use is
* subject to license terms.
*/
package org.jdesktop.swingbinding.adapters;
import java.beans.*;
import javax.swing.*;
import org.jdesktop.beansbinding.ext.BeanAdapterProvider;
import org.jdesktop.swingbinding.impl.ListBindingManager;
import javax.swing.event.*;
import javax.swing.table.*;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.lang.reflect.InvocationTargetException;
/**
* @author Shannon Hickey
*/
public final class JTableAdapterProvider implements BeanAdapterProvider {
private static final String SELECTED_ELEMENT_P = "selectedElement";
private static final String SELECTED_ELEMENTS_P = "selectedElements";
private static final String SELECTED_ELEMENT_IA_P = SELECTED_ELEMENT_P + "_IGNORE_ADJUSTING";
private static final String SELECTED_ELEMENTS_IA_P = SELECTED_ELEMENTS_P + "_IGNORE_ADJUSTING";
private static boolean IS_JAVA_15 =
System.getProperty("java.version").startsWith("1.5");
public final class Adapter extends BeanAdapterBase {
private JTable table;
private Handler handler;
private Object cachedElementOrElements;
private Adapter(JTable table, String property) {
super(property);
this.table = table;
}
private boolean isPlural() {
return property == SELECTED_ELEMENTS_P || property == SELECTED_ELEMENTS_IA_P;
}
public Object getSelectedElement() {
return JTableAdapterProvider.getSelectedElement(table);
}
public Object getSelectedElement_IGNORE_ADJUSTING() {
return getSelectedElement();
}
public List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy