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

org.valkyriercp.dialog.control.VetoableSingleSelectionModel Maven / Gradle / Ivy

There is a newer version: 1.3
Show newest version
package org.valkyriercp.dialog.control;

import javax.swing.*;

/**
 * Custom SingleSelectionModel implementation that allows for
 * vetoing the selection of tabs.
 * 

* The {@link #selectionAllowed(int)} method must return true if * the tab at the index can be selected, or false if not. * * @author Peter De Bruycker */ public abstract class VetoableSingleSelectionModel extends DefaultSingleSelectionModel { public final void setSelectedIndex(int index) { if (selectionAllowed(index)) { super.setSelectedIndex(index); } } protected abstract boolean selectionAllowed(int index); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy