Search in sources :

Example 1 with UnknownInitialization

use of org.checkerframework.checker.initialization.qual.UnknownInitialization in project git-machete-intellij-plugin by VirtusLab.

the class GitPushDialog method createOptionsPanel.

protected JPanel createOptionsPanel() {
    // A separate local class needs to be extracted so that explicit `this` can be annotated in `add` method.
    class OptionsPanel extends JPanel {

        @UIEffect
        OptionsPanel() {
            super(new MigLayout(/* layoutConstraints */
            "ins 0 0, flowy"));
        }

        @Override
        @UIEffect
        public // `@UnknownInitialization` is needed to comply with Checker's Annotated JDK
        Component add(@UnknownInitialization(java.awt.Container.class) OptionsPanel this, Component comp) {
            JPanel wrapperPanel = new BorderLayoutPanel().addToCenter(comp);
            wrapperPanel.setBorder(JBUI.Borders.empty(5, 15, 0, 0));
            return super.add(wrapperPanel);
        }
    }
    return new OptionsPanel();
}
Also used : JPanel(javax.swing.JPanel) MigLayout(net.miginfocom.swing.MigLayout) JComponent(javax.swing.JComponent) Component(java.awt.Component) UnknownInitialization(org.checkerframework.checker.initialization.qual.UnknownInitialization) BorderLayoutPanel(com.intellij.util.ui.components.BorderLayoutPanel)

Aggregations

BorderLayoutPanel (com.intellij.util.ui.components.BorderLayoutPanel)1 Component (java.awt.Component)1 JComponent (javax.swing.JComponent)1 JPanel (javax.swing.JPanel)1 MigLayout (net.miginfocom.swing.MigLayout)1 UnknownInitialization (org.checkerframework.checker.initialization.qual.UnknownInitialization)1