All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anrisoftware.prefdialog.annotations.ButtonGroup Maven / Gradle / Ivy

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.Action;

/**
 * 

* Field with a group of buttons. The value must be set to an array or an * {@link Iterable} that contains the {@link Action} for each button. *

* Examples: a) array of actions field * *
 * @FieldComponent
 * @ButtonGroup
 * public Action[] buttons = { ... };
 * 
* * b) collection of actions field * *
 * @FieldComponent
 * @ButtonGroup
 * public Iterable<Action> buttons = ...;
 * 
* * c) array of actions method * *
 * @FieldComponent
 * @ButtonGroup
 * public Action[] getButtons() {
 *   return new Action[] { ... };
 * }
 * 
* * d) collection of actions method * *
 * @FieldComponent
 * @ButtonGroup
 * public Iterable<Action> getButtons() {
 * 	return list;
 * }
 * 
* * @author Erwin Mueller, [email protected] * @since 1.0 */ @Target({ FIELD, METHOD }) @Retention(RUNTIME) @FieldAnnotation @Documented public @interface ButtonGroup { /** * The horizontal alignment of the buttons. Defaults to * {@link HorizontalAlignment#RIGHT}. * * @see HorizontalAlignment */ HorizontalAlignment horizontalAlignment() default HorizontalAlignment.RIGHT; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy