/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
final class ScreenMenuItemCheckbox extends CheckboxMenuItem implements ActionListener, ComponentListener, ScreenMenuPropertyHandler, ItemListener {
}
}
}
public void addNotify() {
super.addNotify();
// Avoid the Auto toggle behavior of AWT CheckBoxMenuItem
ccb.setAutoToggle(false);
fMenuItem.addComponentListener(this);
fPropertyListener = new ScreenMenuPropertyListener(this);
addActionListener(this);
addItemListener(this);
fMenuItem.addItemListener(this);
// can't setState or setAccelerator or setIcon till we have a peer
}
if (tooltipText != null) {
this.setToolTipText(tooltipText);
}
// sja fix is this needed?
fMenuItem.addItemListener(this);
if (ui instanceof ScreenMenuItemUI) {
}
if (fMenuItem instanceof JCheckBoxMenuItem) {
} else {
}
}
public void removeNotify() {
fMenuItem.removeComponentListener(this);
removeActionListener(this);
removeItemListener(this);
fMenuItem.removeItemListener(this);
super.removeNotify();
}
}
// We call CMenuItem.setLabel(..,..,..) directly and does not initialize
// shortcut property. So shortcut property should not be used from the
// peers code directly or indirectly.
}
}
/**
* Invoked when the component's size changes.
*/
/**
* Invoked when the component's position changes.
*/
/**
* Invoked when the component has been made visible.
* See componentHidden - we should still have a MenuItem
* it just isn't inserted
*/
setVisible(true);
}
/**
* Invoked when the component has been made invisible.
* MenuComponent.setVisible does nothing,
* so we remove the ScreenMenuItem from the ScreenMenu
* but leave it in fItems
*/
setVisible(false);
}
}
if (i != null) {
}
}
}
public void setVisible(final boolean b) {
// Hang on to our parent
}
// we have no children
/**
* Invoked when an item's state has been changed.
*/
if (e.getSource() == this) {
return;
}
switch (e.getStateChange()) {
setState(true);
break;
case ItemEvent.DESELECTED:
setState(false);
break;
}
}
if (peer instanceof CCheckboxMenuItem) {
}
}
}