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

The following examples show how to use com.intellij.openapi.ui.Messages#isMacSheetEmulation() . 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
Source File: MultiSelectDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 6 votes vote down vote up
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
Source File: GoogleAlertDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
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
Source File: AddFilterRuleDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
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
Source File: AddFilterRuleDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
@Override
protected void dispose() {
    if (Messages.isMacSheetEmulation()) {
        animate();
    } else {
        super.dispose();
    }
}
 
Example 5
Source File: AddFilterRuleDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
@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
Source File: MultiSelectDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
@Override
protected void dispose() {
    if (Messages.isMacSheetEmulation()) {
        animate();
    } else {
        super.dispose();
    }
}
 
Example 7
Source File: MultiSelectDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 5 votes vote down vote up
@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
Source File: AddFilterRuleDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 4 votes vote down vote up
@NotNull
protected LayoutManager createRootLayout() {
    return Messages.isMacSheetEmulation() ? myLayout = new MyBorderLayout() : new BorderLayout();
}
 
Example 9
Source File: MultiSelectDialog.java    From AndroidStringsOneTabTranslation with Apache License 2.0 4 votes vote down vote up
@NotNull
protected LayoutManager createRootLayout() {
    return Messages.isMacSheetEmulation() ? myLayout = new MyBorderLayout() : new BorderLayout();
}