本文整理了Java中org.eclipse.swt.widgets.MenuItem.isDisposed()
方法的一些代码示例,展示了MenuItem.isDisposed()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.isDisposed()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.MenuItem
类名称:MenuItem
方法名:isDisposed
暂无
代码示例来源:origin: pentaho/pentaho-kettle
private void setUndoMenu() {
TransAction prev = viewPreviousUndo();
TransAction next = viewNextUndo();
if ( miEditUndo.isDisposed() || miEditRedo.isDisposed() ) {
return;
}
if ( prev != null ) {
miEditUndo.setEnabled( true );
miEditUndo.setText( OsHelper.customizeMenuitemText( BaseMessages.getString( PKG, "TableView.menu.Undo", prev
.toString() ) ) );
} else {
miEditUndo.setEnabled( false );
miEditUndo.setText( OsHelper.customizeMenuitemText( BaseMessages.getString(
PKG, "TableView.menu.UndoNotAvailable" ) ) );
}
if ( next != null ) {
miEditRedo.setEnabled( true );
miEditRedo.setText( OsHelper.customizeMenuitemText( BaseMessages.getString( PKG, "TableView.menu.Redo", next
.toString() ) ) );
} else {
miEditRedo.setEnabled( false );
miEditRedo.setText( OsHelper.customizeMenuitemText( BaseMessages.getString(
PKG, "TableView.menu.RedoNotAvailable" ) ) );
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
@Override
public void widgetSelected(SelectionEvent e) {
if (text.getSelectionText().length() == 0) {
if (copyAction != null && !copyAction.isDisposed()) {
copyAction.setEnabled(false);
}
} else {
if (copyAction != null && !copyAction.isDisposed()) {
copyAction.setEnabled(true);
}
}
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void releaseChildren (boolean destroy) {
if (items != null) {
for (int i=0; i<items.length; i++) {
MenuItem item = items [i];
if (item != null && !item.isDisposed ()) {
item.release (false);
}
}
items = null;
}
super.releaseChildren (destroy);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Refreshes the selected menu items to match the current state of the model.
*/
private void refreshSelection() {
Iterator iter = items.iterator();
while (iter.hasNext()) {
MenuItem next = (MenuItem) iter.next();
if (!next.isDisposed()) {
next.setSelection(isEqual(data.getState(), next.getData()));
}
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
protected void disposeMenuItems() {
if (fMenu == null || fMenu.isDisposed()) {
return;
}
MenuItem[] items = fMenu.getItems();
for (int i=0; i < items.length; i++) {
MenuItem menuItem= items[i];
if (!menuItem.isDisposed()) {
menuItem.dispose();
}
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
private boolean isTopLevelMenu() {
if (menu != null && !menu.isDisposed() && menuItem != null
&& !menuItem.isDisposed()) {
Menu parentMenu = menuItem.getParent();
return parentMenu != null
&& ((parentMenu.getStyle() & SWT.BAR) == SWT.BAR);
}
return false;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
protected void disposeMenuItems() {
if (fMenu == null || fMenu.isDisposed()) {
return;
}
MenuItem[] items = fMenu.getItems();
for (int i=0; i < items.length; i++) {
MenuItem menuItem= items[i];
if (!menuItem.isDisposed()) {
menuItem.dispose();
}
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
private boolean isTopLevelMenu() {
if (menu != null && !menu.isDisposed() && menuItem != null
&& !menuItem.isDisposed()) {
Menu parentMenu = menuItem.getParent();
return parentMenu != null
&& ((parentMenu.getStyle() & SWT.BAR) == SWT.BAR);
}
return false;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
void releaseChildren (boolean destroy) {
MenuItem [] items = getItems ();
for (int i=0; i<items.length; i++) {
MenuItem item = items [i];
if (item != null && !item.isDisposed ()) {
item.release (false);
}
}
super.releaseChildren (destroy);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
private boolean isTopLevelMenu() {
if (menu != null && !menu.isDisposed() && menuItem != null
&& !menuItem.isDisposed()) {
Menu parentMenu = menuItem.getParent();
return parentMenu != null
&& ((parentMenu.getStyle() & SWT.BAR) == SWT.BAR);
}
return false;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
protected void disposeMenuItems() {
if (fMenu == null || fMenu.isDisposed()) {
return;
}
MenuItem[] items = fMenu.getItems();
for (int i=0; i < items.length; i++) {
MenuItem menuItem= items[i];
if (!menuItem.isDisposed()) {
menuItem.dispose();
}
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
void releaseChildren (boolean destroy) {
MenuItem [] items = getItems ();
for (int i=0; i<items.length; i++) {
MenuItem item = items [i];
if (item != null && !item.isDisposed ()) {
item.release (false);
}
}
super.releaseChildren (destroy);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
void releaseChildren (boolean destroy) {
MenuItem [] items = getItems ();
for (int i=0; i<items.length; i++) {
MenuItem item = items [i];
if (item != null && !item.isDisposed ()) {
item.release (false);
}
}
super.releaseChildren (destroy);
}
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event e) {
if (az_menuitem.getStyle() == MenuItem.STYLE_CHECK
|| az_menuitem.getStyle() == MenuItem.STYLE_RADIO) {
if (!menuItem.isDisposed()) {
az_menuitem.setData(Boolean.valueOf(menuItem.getSelection()));
}
}
main_listener.handleEvent(e);
}
});
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
if (!item.isDisposed()) {
item.setEnabled(!MiniBarManager.getManager().getShellManager().isEmpty());
}
}
};
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
if (MenuFactory.isEnabledForCurrentMode(item)) {
if (!item.isDisposed() && !event.widget.isDisposed()) {
boolean hasDetails = UIFunctionsManagerSWT.getUIFunctionsSWT().hasDetailViews();
item.setEnabled(hasDetails);
}
}
}
};
代码示例来源:origin: BiglySoftware/BiglyBT
@Override
public void handleEvent(Event event) {
if (item.isDisposed()) {
menu.removeListener(SWT.Show, this);
} else {
item.setSelection(!MiniBarManager.getManager().getShellManager().isEmpty());
}
}
});
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
boolean sendHelpEvent (long /*int*/ helpType) {
if (selectedItem != null && !selectedItem.isDisposed()) {
if (selectedItem.hooks (SWT.Help)) {
selectedItem.postEvent (SWT.Help);
return true;
}
}
if (hooks (SWT.Help)) {
postEvent (SWT.Help);
return true;
}
return parent.sendHelpEvent (helpType);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
boolean sendHelpEvent (int /*long*/ helpType) {
if (selectedItem != null && !selectedItem.isDisposed()) {
if (selectedItem.hooks (SWT.Help)) {
selectedItem.postEvent (SWT.Help);
return true;
}
}
if (hooks (SWT.Help)) {
postEvent (SWT.Help);
return true;
}
return parent.sendHelpEvent (helpType);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
boolean sendHelpEvent (int /*long*/ helpType) {
if (selectedItem != null && !selectedItem.isDisposed()) {
if (selectedItem.hooks (SWT.Help)) {
selectedItem.postEvent (SWT.Help);
return true;
}
}
if (hooks (SWT.Help)) {
postEvent (SWT.Help);
return true;
}
return parent.sendHelpEvent (helpType);
}
内容来源于网络,如有侵权,请联系作者删除!