Java Code Examples for com.intellij.openapi.ui.Messages#isMacSheetEmulation()

The following examples show how to use com.intellij.openapi.ui.Messages#isMacSheetEmulation() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
protected void _init(Project project,
                     String title,
                     String message,
                     @Nullable String checkboxText,
                     boolean checkboxStatus,
                     @Nullable DoNotAskOption doNotAskOption) {
    setTitle(title);
    if (Messages.isMacSheetEmulation()) {
        setUndecorated(true);
    }
    propertiesComponent = PropertiesComponent.getInstance(project);
    myMessage = message;
    myCheckboxText = checkboxText;
    myChecked = checkboxStatus;
    setButtonsAlignment(SwingConstants.RIGHT);
    setDoNotAskOption(doNotAskOption);
    init();
    if (Messages.isMacSheetEmulation()) {
        MacUtil.adjustFocusTraversal(myDisposable);
    }
}
 
Example 2
protected void _init(String title, String message) {
    setTitle(title);
    mMessage = message;
    if (Messages.isMacSheetEmulation()) {
        setUndecorated(true);
    }

    setButtonsAlignment(SwingConstants.RIGHT);
    setDoNotAskOption(null);
    init();
    if (Messages.isMacSheetEmulation()) {
        MacUtil.adjustFocusTraversal(myDisposable);
    }
}
 
Example 3
protected void _init(String title,
                     @Nullable DoNotAskOption doNotAskOption) {
    setTitle(title);
    if (Messages.isMacSheetEmulation()) {
        setUndecorated(true);
    }

    setButtonsAlignment(SwingConstants.RIGHT);
    setDoNotAskOption(doNotAskOption);
    init();
    if (Messages.isMacSheetEmulation()) {
        MacUtil.adjustFocusTraversal(myDisposable);
    }
}
 
Example 4
@Override
protected void dispose() {
    if (Messages.isMacSheetEmulation()) {
        animate();
    } else {
        super.dispose();
    }
}
 
Example 5
@Override
public void show() {
    if (Messages.isMacSheetEmulation()) {
        setInitialLocationCallback(new Computable<Point>() {
            @Override
            public Point compute() {
                JRootPane rootPane = SwingUtilities.getRootPane(getWindow().getParent());
                if (rootPane == null) {
                    rootPane = SwingUtilities.getRootPane(getWindow().getOwner());
                }

                Point p = rootPane.getLocationOnScreen();
                p.x += (rootPane.getWidth() - getWindow().getWidth()) / 2;
                return p;
            }
        });
        animate();
        if (SystemInfo.isJavaVersionAtLeast("1.7")) {
            try {
                Method method = Class.forName("java.awt.Window").getDeclaredMethod("setOpacity", float.class);
                if (method != null) method.invoke(getPeer().getWindow(), .8f);
            } catch (Exception exception) {
            }
        }
        setAutoAdjustable(false);
        setSize(getPreferredSize().width, 0);//initial state before animation, zero height
    }
    super.show();
}
 
Example 6
@Override
protected void dispose() {
    if (Messages.isMacSheetEmulation()) {
        animate();
    } else {
        super.dispose();
    }
}
 
Example 7
@Override
public void show() {
    if (Messages.isMacSheetEmulation()) {
        setInitialLocationCallback(new Computable<Point>() {
            @Override
            public Point compute() {
                JRootPane rootPane = SwingUtilities.getRootPane(getWindow().getParent());
                if (rootPane == null) {
                    rootPane = SwingUtilities.getRootPane(getWindow().getOwner());
                }

                Point p = rootPane.getLocationOnScreen();
                p.x += (rootPane.getWidth() - getWindow().getWidth()) / 2;
                return p;
            }
        });
        animate();
        if (SystemInfo.isJavaVersionAtLeast("1.7")) {
            try {
                Method method = Class.forName("java.awt.Window").getDeclaredMethod("setOpacity", float.class);
                if (method != null) method.invoke(getPeer().getWindow(), .8f);
            } catch (Exception exception) {
            }
        }
        setAutoAdjustable(false);
        setSize(getPreferredSize().width, 0);//initial state before animation, zero height
    }
    super.show();
}
 
Example 8
@NotNull
protected LayoutManager createRootLayout() {
    return Messages.isMacSheetEmulation() ? myLayout = new MyBorderLayout() : new BorderLayout();
}
 
Example 9
@NotNull
protected LayoutManager createRootLayout() {
    return Messages.isMacSheetEmulation() ? myLayout = new MyBorderLayout() : new BorderLayout();
}