8250849: Address reliance on default constructors in the javax.swing.plaf APIs

Reviewed-by: prr, serb
This commit is contained in:
Prasanta Sadhukhan 2020-08-17 13:36:36 +05:30
parent 2ef86262e0
commit 69c0df6b8f
31 changed files with 137 additions and 2 deletions

View File

@ -36,4 +36,8 @@ import java.awt.Insets;
* @author Jeff Dinkins
*/
public abstract class ButtonUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ButtonUI() {}
}

View File

@ -37,5 +37,8 @@ import javax.swing.colorchooser.*;
public abstract class ColorChooserUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected ColorChooserUI() {}
}

View File

@ -35,6 +35,11 @@ import javax.swing.JComboBox;
*/
public abstract class ComboBoxUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ComboBoxUI() {}
/**
* Set the visibility of the popup
*

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @author David Kloba
*/
public abstract class DesktopIconUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected DesktopIconUI() {}
}

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @author David Kloba
*/
public abstract class DesktopPaneUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected DesktopPaneUI() {}
}

View File

@ -38,6 +38,11 @@ import java.io.File;
public abstract class FileChooserUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected FileChooserUI() {}
/**
* Returns an accept-all file filter.
* @param fc the file chooser

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author David Kloba
*/
public abstract class InternalFrameUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected InternalFrameUI() {}
}

View File

@ -31,4 +31,9 @@ package javax.swing.plaf;
* @author Hans Muller
*/
public abstract class LabelUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected LabelUI() {}
}

View File

@ -65,6 +65,11 @@ public class LayerUI<V extends Component>
private final PropertyChangeSupport propertyChangeSupport =
new PropertyChangeSupport(this);
/**
* Constructs a {@code LayerUI}.
*/
public LayerUI() {}
/**
* Paints the specified component.
* Subclasses should override this method and use

View File

@ -38,6 +38,11 @@ import java.awt.Rectangle;
public abstract class ListUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected ListUI() {}
/**
* Returns the cell index in the specified {@code JList} closest to the
* given location in the list's coordinate system. To determine if the

View File

@ -36,4 +36,9 @@ import javax.swing.JMenu;
* @author David Karlton
*/
public abstract class MenuBarUI extends ComponentUI { }
public abstract class MenuBarUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected MenuBarUI() {}
}

View File

@ -35,4 +35,8 @@ import java.awt.event.*;
* @author Arnaud Weber
*/
public abstract class MenuItemUI extends ButtonUI {
/**
* Constructor for subclasses to call.
*/
protected MenuItemUI() {}
}

View File

@ -35,6 +35,11 @@ import javax.swing.JOptionPane;
public abstract class OptionPaneUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected OptionPaneUI() {}
/**
* Requests the component representing the default value to have
* focus.

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @author Steve Wilson
*/
public abstract class PanelUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected PanelUI() {}
}

View File

@ -38,6 +38,11 @@ import javax.swing.JPopupMenu;
*/
public abstract class PopupMenuUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected PopupMenuUI() {}
/**
* Returns whether or not the given {@code MouseEvent} is the popup menu
* trigger event for the platform

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @author Rob Davis
*/
public abstract class ProgressBarUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ProgressBarUI() {}
}

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @since 1.3
*/
public abstract class RootPaneUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected RootPaneUI() {}
}

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author David Kloba
*/
public abstract class ScrollBarUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ScrollBarUI() {}
}

View File

@ -33,4 +33,8 @@ package javax.swing.plaf;
*/
public abstract class ScrollPaneUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ScrollPaneUI() {}
}

View File

@ -33,4 +33,8 @@ package javax.swing.plaf;
*/
public abstract class SeparatorUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected SeparatorUI() {}
}

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author Hans Muller
*/
public abstract class SliderUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected SliderUI() {}
}

View File

@ -33,4 +33,8 @@ package javax.swing.plaf;
* @since 1.4
*/
public abstract class SpinnerUI extends javax.swing.plaf.ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected SpinnerUI() {}
}

View File

@ -35,6 +35,11 @@ import java.awt.Graphics;
*/
public abstract class SplitPaneUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected SplitPaneUI() {}
/**
* Messaged to relayout the JSplitPane based on the preferred size
* of the children components.

View File

@ -35,6 +35,11 @@ import javax.swing.JTabbedPane;
* @author Amy Fowler
*/
public abstract class TabbedPaneUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected TabbedPaneUI() {}
/**
* Returns the tab for the coordinate.
* @param pane the pane

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author Alan Chung
*/
public abstract class TableHeaderUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected TableHeaderUI() {}
}

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author Alan Chung
*/
public abstract class TableUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected TableUI() {}
}

View File

@ -37,6 +37,11 @@ import javax.swing.text.*;
*/
public abstract class TextUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected TextUI() {}
/**
* Converts the given location in the model to a place in
* the view coordinate system.

View File

@ -35,4 +35,8 @@ import javax.swing.JToolBar;
*/
public abstract class ToolBarUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ToolBarUI() {}
}

View File

@ -31,4 +31,8 @@ package javax.swing.plaf;
* @author Dave Moore
*/
public abstract class ToolTipUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ToolTipUI() {}
}

View File

@ -37,6 +37,11 @@ import javax.swing.tree.TreePath;
*/
public abstract class TreeUI extends ComponentUI
{
/**
* Constructor for subclasses to call.
*/
protected TreeUI() {}
/**
* Returns the Rectangle enclosing the label portion that the
* last item in path will be drawn into. Will return null if

View File

@ -32,4 +32,8 @@ package javax.swing.plaf;
* @author Rich Schiavi
*/
public abstract class ViewportUI extends ComponentUI {
/**
* Constructor for subclasses to call.
*/
protected ViewportUI() {}
}