Java Code Examples for java.awt.peer.MenuItemPeer

The following examples show how to use java.awt.peer.MenuItemPeer. 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 want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: jdk1.8-source-analysis   Source File: MenuItem.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 2
Source Project: jdk1.8-source-analysis   Source File: MenuItem.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 3
Source Project: jdk1.8-source-analysis   Source File: MenuItem.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 4
Source Project: jdk1.8-source-analysis   Source File: MenuItem.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Delete any <code>MenuShortcut</code> object associated
 * with this menu item.
 * @since      JDK1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 5
Source Project: hottub   Source File: CMenu.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void setEnabled(final boolean b) {
    super.setEnabled(b);
    final Menu target = (Menu) getTarget();
    final int count = target.getItemCount();
    for (int i = 0; i < count; ++i) {
        MenuItem item = target.getItem(i);
        MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
        if (p != null) {
            p.setEnabled(b && item.isEnabled());
        }
    }
}
 
Example 6
Source Project: openjdk-8   Source File: CMenu.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void setEnabled(final boolean b) {
    super.setEnabled(b);
    final Menu target = (Menu) getTarget();
    final int count = target.getItemCount();
    for (int i = 0; i < count; ++i) {
        MenuItem item = target.getItem(i);
        MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
        if (p != null) {
            p.setEnabled(b && item.isEnabled());
        }
    }
}
 
Example 7
Source Project: dragonwell8_jdk   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 8
Source Project: dragonwell8_jdk   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 9
Source Project: openjdk-8-source   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 10
Source Project: dragonwell8_jdk   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 11
Source Project: dragonwell8_jdk   Source File: CMenu.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void setEnabled(final boolean b) {
    super.setEnabled(b);
    final Menu target = (Menu) getTarget();
    final int count = target.getItemCount();
    for (int i = 0; i < count; ++i) {
        MenuItem item = target.getItem(i);
        MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
        if (p != null) {
            p.setEnabled(b && item.isEnabled());
        }
    }
}
 
Example 12
Source Project: TencentKona-8   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 13
Source Project: TencentKona-8   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 14
Source Project: TencentKona-8   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 15
Source Project: TencentKona-8   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Delete any <code>MenuShortcut</code> object associated
 * with this menu item.
 * @since      JDK1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 16
Source Project: openjdk-8-source   Source File: CMenu.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void setEnabled(final boolean b) {
    super.setEnabled(b);
    final Menu target = (Menu) getTarget();
    final int count = target.getItemCount();
    for (int i = 0; i < count; ++i) {
        MenuItem item = target.getItem(i);
        MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
        if (p != null) {
            p.setEnabled(b && item.isEnabled());
        }
    }
}
 
Example 17
Source Project: jdk8u_jdk   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 18
Source Project: jdk8u60   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 19
Source Project: jdk8u60   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 20
Source Project: jdk8u60   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 21
Source Project: jdk8u60   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Delete any <code>MenuShortcut</code> object associated
 * with this menu item.
 * @since      JDK1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 22
Source Project: jdk8u60   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 23
Source Project: jdk8u60   Source File: CMenu.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public final void setEnabled(final boolean b) {
    super.setEnabled(b);
    final Menu target = (Menu) getTarget();
    final int count = target.getItemCount();
    for (int i = 0; i < count; ++i) {
        MenuItem item = target.getItem(i);
        MenuItemPeer p = (MenuItemPeer) LWCToolkit.targetToPeer(item);
        if (p != null) {
            p.setEnabled(b && item.isEnabled());
        }
    }
}
 
Example 24
Source Project: JDKSourceCode1.8   Source File: MenuItem.java    License: MIT License 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 25
Source Project: JDKSourceCode1.8   Source File: MenuItem.java    License: MIT License 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 26
Source Project: JDKSourceCode1.8   Source File: MenuItem.java    License: MIT License 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by <code>setEnabled(boolean)</code>.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 27
Source Project: openjdk-8-source   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Delete any <code>MenuShortcut</code> object associated
 * with this menu item.
 * @since      JDK1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 28
Source Project: JDKSourceCode1.8   Source File: MenuItem.java    License: MIT License 5 votes vote down vote up
/**
 * Delete any <code>MenuShortcut</code> object associated
 * with this menu item.
 * @since      JDK1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 29
Source Project: JDKSourceCode1.8   Source File: MenuItem.java    License: MIT License 5 votes vote down vote up
void deleteShortcut(MenuShortcut s) {
    if (s.equals(shortcut)) {
        shortcut = null;
        MenuItemPeer peer = (MenuItemPeer)this.peer;
        if (peer != null) {
            peer.setLabel(label);
        }
    }
}
 
Example 30
Source Project: openjdk-jdk8u   Source File: MenuItem.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Sets the label for this menu item to the specified label.
 * @param     label   the new label, or <code>null</code> for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     JDK1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}