sun.lwawt.macosx.CMenuItem Java Examples

The following examples show how to use sun.lwawt.macosx.CMenuItem. 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: ScreenMenuItem.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #2
Source File: ScreenMenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #3
Source File: ScreenMenuItem.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #4
Source File: ScreenMenuItem.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #5
Source File: ScreenMenuItem.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #6
Source File: ScreenMenuItem.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #7
Source File: ScreenMenuItem.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #8
Source File: ScreenMenuItem.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #9
Source File: ScreenMenuItem.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #10
Source File: ScreenMenuItem.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #11
Source File: ScreenMenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #12
Source File: ScreenMenuItem.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #13
Source File: ScreenMenuItem.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #14
Source File: ScreenMenuItem.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #15
Source File: ScreenMenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #16
Source File: ScreenMenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #17
Source File: ScreenMenuItem.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #18
Source File: ScreenMenuItem.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #19
Source File: ScreenMenuItem.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #20
Source File: ScreenMenuItem.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #21
Source File: ScreenMenuItem.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #22
Source File: ScreenMenuItem.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #23
Source File: ScreenMenuItem.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #24
Source File: ScreenMenuItem.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #25
Source File: ScreenMenuItem.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #26
Source File: ScreenMenuItem.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #27
Source File: ScreenMenuItem.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}
 
Example #28
Source File: ScreenMenuItem.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setToolTipText(final String text) {
    final MenuComponentPeer peer = getPeer();
    if (!(peer instanceof CMenuItem)) return;

    final CMenuItem cmi = (CMenuItem)peer;
    cmi.setToolTipText(text);
}
 
Example #29
Source File: ScreenMenuItem.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void setIcon(final Icon i) {
final MenuComponentPeer peer = getPeer();
if (!(peer instanceof CMenuItem)) return;

final CMenuItem cmi = (CMenuItem)peer;
    Image img = null;

if (i != null) {
    if (i.getIconWidth() > 0 && i.getIconHeight() > 0) {
            img = AquaIcon.getImageForIcon(i);
        }
}
    cmi.setImage(img);
}
 
Example #30
Source File: ScreenMenuItem.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static void syncLabelAndKS(MenuItem menuItem, String label, KeyStroke ks) {
    final MenuComponentPeer peer = menuItem.getPeer();
    if (!(peer instanceof CMenuItem)) {
        //Is it possible?
        return;
    }
    final CMenuItem cmi = (CMenuItem) peer;
    if (ks == null) {
        cmi.setLabel(label);
    } else {
        cmi.setLabel(label, ks.getKeyChar(), ks.getKeyCode(),
                     ks.getModifiers());
    }
}