com.anrisoftware.prefdialog.annotations.Table Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prefdialog-api Show documentation
Show all versions of prefdialog-api Show documentation
Preferences dialog public application interface.
The newest version!
/*
* Copyright 2013-2016 Erwin Müller
*
* This file is part of prefdialog-api.
*
* prefdialog-api is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* prefdialog-api is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with prefdialog-api. If not, see .
*/
package com.anrisoftware.prefdialog.annotations;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.swing.table.TableModel;
/**
* Table field with a custom model. The field value of the table field is not
* used and is just a placeholder for the annotation. The model of the table
* must be set.
*
*
Example table model field:
*
*
* @FieldComponent
* @TableField(model = "tableModel")
* public Object table;
*
* public MyTableModel tableModel;
*
*
* Example table model class:
*
*
* @FieldComponent
* @TableField(modelClass = MyTableModel.class)
* public Object table;
*
*
* @author Erwin Mueller, [email protected]
* @since 3.0
*/
@Target({ FIELD, METHOD })
@Retention(RUNTIME)
@FieldAnnotation
@Documented
public @interface Table {
/**
* The name of the field name to use for the custom {@link TableModel}.
* Defaults to an empty name which means no field is set.
*/
String model() default "";
/**
* The custom {@link TableModel} to use with this table field. The model
* must have the default constructor available for instantiation.
*/
Class extends TableModel>[] modelClass() default {};
/**
* The names of the field names to use for the custom
* {@link TypedTableCellRenderer} default cell renderers. The table cell
* renderers are set for the returned cell type.
*
* @see DefaultTypedTableCellRenderer
*/
String[] renderers() default {};
/**
* The custom {@link TypedTableCellRenderer} renderers to use with this
* table field. The table cell renderers are set for the returned cell type.
* The renderers must have the default constructor available for
* instantiation.
*
* @see DefaultTypedTableCellRenderer
*/
Class extends TypedTableCellRenderer>[] rendererClasses() default {};
/**
* The names of the field names to use for the custom
* {@link TypedTableCellEditor} default cell editors. The table cell editors
* are set for the returned cell type.
*
* @see DefaultTypedTableCellEditor
*/
String[] editors() default {};
/**
* The custom {@link TypedTableCellEditor} editors to use with this table
* field. The table cell editors are set for the returned cell type. The
* editors must have the default constructor available for instantiation.
*
* @see DefaultTypedTableCellEditor
*/
Class extends TypedTableCellEditor>[] editorClasses() default {};
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy