本文整理汇总了Java中java.awt.peer.MenuItemPeer类的典型用法代码示例。如果您正苦于以下问题:Java MenuItemPeer类的具体用法?Java MenuItemPeer怎么用?Java MenuItemPeer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MenuItemPeer类属于java.awt.peer包,在下文中一共展示了MenuItemPeer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setLabel
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* 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);
}
}
示例2: enable
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* @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);
}
}
示例3: disable
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* @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);
}
}
示例4: deleteShortcut
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* 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);
}
}
示例5: setEnabled
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
@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());
}
}
}
示例6: setLabel
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* 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);
}
}
示例7: enable
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* @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);
}
}
示例8: disable
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* @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);
}
}
示例9: deleteShortcut
import java.awt.peer.MenuItemPeer; //导入依赖的package包/类
/**
* 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);
}
}