mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-17 03:13:11 +00:00
8238719: [macOS] Delete the property which use deprecated prefix "com.apple.macos."
Reviewed-by: psadhukhan, jdv, prr
This commit is contained in:
parent
3399842d7e
commit
cf22b4e7c8
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,22 +25,43 @@
|
||||
|
||||
package com.apple.laf;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.util.*;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.Action;
|
||||
import javax.swing.ActionMap;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.DefaultListCellRenderer;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.PopupFactory;
|
||||
import javax.swing.SwingConstants;
|
||||
import javax.swing.UIDefaults;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.plaf.*;
|
||||
import javax.swing.plaf.ActionMapUIResource;
|
||||
import javax.swing.plaf.BorderUIResource;
|
||||
import javax.swing.plaf.ColorUIResource;
|
||||
import javax.swing.plaf.DimensionUIResource;
|
||||
import javax.swing.plaf.InsetsUIResource;
|
||||
import javax.swing.plaf.basic.BasicBorders;
|
||||
import javax.swing.plaf.basic.BasicLookAndFeel;
|
||||
|
||||
import apple.laf.JRSUIControl;
|
||||
import apple.laf.JRSUIUtils;
|
||||
import sun.swing.SwingAccessor;
|
||||
import sun.swing.SwingUtilities2;
|
||||
|
||||
import static javax.swing.UIDefaults.LazyValue;
|
||||
import sun.swing.*;
|
||||
import apple.laf.*;
|
||||
|
||||
@SuppressWarnings("serial") // Superclass is not serializable across versions
|
||||
public class AquaLookAndFeel extends BasicLookAndFeel {
|
||||
static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
|
||||
static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'
|
||||
|
||||
// for lazy initalizers. Following the pattern from metal.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -25,10 +25,15 @@
|
||||
|
||||
package com.apple.laf;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Component;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.MenuBar;
|
||||
import java.security.AccessController;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.plaf.ComponentUI;
|
||||
import javax.swing.plaf.basic.BasicMenuBarUI;
|
||||
|
||||
@ -145,17 +150,7 @@ public class AquaMenuBarUI extends BasicMenuBarUI implements ScreenMenuBarProvid
|
||||
public static boolean getScreenMenuBarProperty() {
|
||||
// Do not allow AWT to set the screen menu bar if it's embedded in another UI toolkit
|
||||
if (LWCToolkit.isEmbedded()) return false;
|
||||
if (AccessController.doPrivileged(
|
||||
new GetBooleanAction(AquaLookAndFeel.sPropertyPrefix + "useScreenMenuBar"))) {
|
||||
return true;
|
||||
}
|
||||
if (AccessController.doPrivileged(
|
||||
new GetBooleanAction(AquaLookAndFeel.sOldPropertyPrefix + "useScreenMenuBar"))) {
|
||||
System.err.println(AquaLookAndFeel.sOldPropertyPrefix +
|
||||
"useScreenMenuBar has been deprecated. Please switch to " +
|
||||
AquaLookAndFeel.sPropertyPrefix + "useScreenMenuBar");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return AccessController.doPrivileged(new GetBooleanAction(
|
||||
AquaLookAndFeel.sPropertyPrefix + "useScreenMenuBar"));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user