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

net.java.truelicense.swing.util.ComponentEnabler Maven / Gradle / Ivy

Go to download

The TrueLicense Swing module provides a graphical user interface for consuming license keys.

There is a newer version: 2.6.6
Show newest version
/*
 * Copyright (C) 2005-2015 Schlichtherle IT Services.
 * All rights reserved. Use is subject to license terms.
 */

package net.java.truelicense.swing.util;

import java.awt.*;
import java.io.Serializable;
import javax.annotation.concurrent.Immutable;

/**
 * A proxy for enabling or disabling a {@link Component}.
 *
 * @since  TrueLicense 2.3
 * @author Christian Schlichtherle
 */
@Immutable
public abstract class ComponentEnabler implements Enabler, Serializable {

    private static final long serialVersionUID = 0L;

    protected abstract Component component();

    public final void enable() { enabled(true); }
    public final void disable() { enabled(false); }

    @Override public boolean enabled() { return component().isEnabled(); }
    @Override public void enabled(boolean value) { component().setEnabled(value); }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy