Java Code Examples for java.awt.peer.MenuItemPeer

The following are top voted examples for showing how to use java.awt.peer.MenuItemPeer. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenJSharp   File: MenuItem.java   View source code 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
Project: OpenJSharp   File: MenuItem.java   View source code 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
Project: OpenJSharp   File: MenuItem.java   View source code 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
Project: OpenJSharp   File: MenuItem.java   View source code 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
Project: OpenJSharp   File: MenuItem.java   View source code 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 6
Project: OpenJSharp   File: CMenu.java   View source code 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
Project: jdk8u-jdk   File: MenuItem.java   View source code 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 8
Project: jdk8u-jdk   File: MenuItem.java   View source code 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 9
Project: jdk8u-jdk   File: MenuItem.java   View source code 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 10
Project: jdk8u-jdk   File: MenuItem.java   View source code 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 11
Project: jdk8u-jdk   File: MenuItem.java   View source code 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 12
Project: jdk8u-jdk   File: CMenu.java   View source code 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 13
Project: openjdk-jdk10   File: MenuItem.java   View source code 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} for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 14
Project: openjdk-jdk10   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setEnabled(boolean)}.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 15
Project: openjdk-jdk10   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setEnabled(boolean)}.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 16
Project: openjdk-jdk10   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * Delete any {@code MenuShortcut} object associated
 * with this menu item.
 * @since      1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 17
Project: openjdk-jdk10   File: MenuItem.java   View source code 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 18
Project: openjdk-jdk10   File: CMenu.java   View source code 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 19
Project: openjdk9   File: MenuItem.java   View source code 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} for no label.
 * @see       java.awt.MenuItem#getLabel
 * @since     1.0
 */
public synchronized void setLabel(String label) {
    this.label = label;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 20
Project: openjdk9   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setEnabled(boolean)}.
 */
@Deprecated
public synchronized void enable() {
    enabled = true;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(true);
    }
}
 
Example 21
Project: openjdk9   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * @deprecated As of JDK version 1.1,
 * replaced by {@code setEnabled(boolean)}.
 */
@Deprecated
public synchronized void disable() {
    enabled = false;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setEnabled(false);
    }
}
 
Example 22
Project: openjdk9   File: MenuItem.java   View source code 5 votes vote down vote up
/**
 * Delete any {@code MenuShortcut} object associated
 * with this menu item.
 * @since      1.1
 */
public void deleteShortcut() {
    shortcut = null;
    MenuItemPeer peer = (MenuItemPeer)this.peer;
    if (peer != null) {
        peer.setLabel(label);
    }
}
 
Example 23
Project: openjdk9   File: MenuItem.java   View source code 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 24
Project: openjdk9   File: CMenu.java   View source code 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 25
Project: Java8CN   File: MenuItem.java   View source code 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 26
Project: Java8CN   File: MenuItem.java   View source code 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 27
Project: Java8CN   File: MenuItem.java   View source code 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 28
Project: Java8CN   File: MenuItem.java   View source code 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
Project: Java8CN   File: MenuItem.java   View source code 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
Project: jdk8u_jdk   File: MenuItem.java   View source code 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 31
Project: jdk8u_jdk   File: MenuItem.java   View source code 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 32
Project: jdk8u_jdk   File: MenuItem.java   View source code 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 33
Project: jdk8u_jdk   File: MenuItem.java   View source code 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 34
Project: jdk8u_jdk   File: MenuItem.java   View source code 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 35
Project: jdk8u_jdk   File: CMenu.java   View source code 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 36
Project: lookaside_java-1.8.0-openjdk   File: MenuItem.java   View source code 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 37
Project: lookaside_java-1.8.0-openjdk   File: MenuItem.java   View source code 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 38
Project: lookaside_java-1.8.0-openjdk   File: MenuItem.java   View source code 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 39
Project: lookaside_java-1.8.0-openjdk   File: MenuItem.java   View source code 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 40
Project: lookaside_java-1.8.0-openjdk   File: MenuItem.java   View source code 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);
        }
    }
}