javax.swing.JMenuItem.isEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中javax.swing.JMenuItem.isEnabled()方法的一些代码示例,展示了JMenuItem.isEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.isEnabled()方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:isEnabled

JMenuItem.isEnabled介绍

暂无

代码示例

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Used to change the status of the saveHistory file menu item to reflect
 * whether any search statistics are available to save
 */
public void setSaveHistoryEnabled(boolean enabled) {
 if(saveHistory.isEnabled() != enabled)
  saveHistory.setEnabled(enabled);
}

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Used to change the status of the tsurgeon file menu item to reflect
 * whether tsurgeon is enabled
 */
public void setTsurgeonEnabled(boolean enabled) {
 if (loadTsurgeon.isEnabled() != enabled)
  loadTsurgeon.setEnabled(enabled);
}

代码示例来源:origin: stanfordnlp/CoreNLP

/**
 * Used to change the status of the save file menu item to reflect
 * whether any trees are available to save.
 */
public void setSaveEnabled(boolean enabled) {
 if(saveMatches.isEnabled() != enabled) {
  saveMatches.setEnabled(enabled);
  saveSentences.setEnabled(enabled);
 }
}

代码示例来源:origin: org.netbeans.api/org-openide-awt

public @Override Component[] convertComponents(Component comp) {
  if (comp instanceof JMenuItem) {
    JMenuItem item = (JMenuItem) comp;
    if (Boolean.TRUE.equals(item.getClientProperty(DynamicMenuContent.HIDE_WHEN_DISABLED)) && !item.isEnabled()) {
      return new Component[0];

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

/**
 * 
 * @return true if the add file or folders menu item is enabled.
 */
public boolean getAddEnabled() {
  return jMenuItemAddFileOrFolders.isEnabled();
}

代码示例来源:origin: digital-preservation/droid

/**
 * 
 * @return true if the add file or folders menu item is enabled.
 */
public boolean getAddEnabled() {
  return jMenuItemAddFileOrFolders.isEnabled();
}

代码示例来源:origin: uk.gov.nationalarchives/droid-ui

/**
 * 
 * @return true if the remove file or folders menu item is enabled.
 */
public boolean getRemoveEnabled() {
  return jMenuItemRemoveFolder.isEnabled();
}

代码示例来源:origin: digital-preservation/droid

/**
 * 
 * @return true if the remove file or folders menu item is enabled.
 */
public boolean getRemoveEnabled() {
  return jMenuItemRemoveFolder.isEnabled();
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

/**
 * Used to change the status of the saveHistory file menu item to reflect
 * whether any search statistics are available to save
 */
public void setSaveHistoryEnabled(boolean enabled) {
 if(saveHistory.isEnabled() != enabled)
  saveHistory.setEnabled(enabled);
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

/**
 * Used to change the status of the tsurgeon file menu item to reflect
 * whether tsurgeon is enabled
 */
public void setTsurgeonEnabled(boolean enabled) {
 if (loadTsurgeon.isEnabled() != enabled)
  loadTsurgeon.setEnabled(enabled);
}

代码示例来源:origin: edu.stanford.nlp/stanford-corenlp

/**
 * Used to change the status of the save file menu item to reflect
 * whether any trees are available to save.
 */
public void setSaveEnabled(boolean enabled) {
 if(saveMatches.isEnabled() != enabled) {
  saveMatches.setEnabled(enabled);
  saveSentences.setEnabled(enabled);
 }
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction(jsDoc = ENABLED_JSDOC)
@Override
public boolean getEnabled() {
  return super.isEnabled();
}

代码示例来源:origin: sing-group/GC4S

@Override
  public void setVisible(boolean b) {
    if(b) {
      b = Stream.of(this.getComponents())
        .filter(c -> c instanceof JMenuItem)
        .filter(c -> {
          return ((JMenuItem) c).isEnabled();
        }).findAny().isPresent();
    }
    super.setVisible(b);
  }
}

代码示例来源:origin: robotframework/SwingLibrary

private boolean menuItemIsEnabled(String identifier, String nodeIdentifier, String menuPath) {
  try {
    return createPopupMenuItem(identifier, nodeIdentifier, menuPath).isEnabled();
  } finally {
    closePopup();
  }
}

代码示例来源:origin: UISpec4J/UISpec4J

public void click() {
 AssertAdapter.assertTrue("The menu item is not enabled, it cannot be activated",
              menuItem.isEnabled());
 AbstractButton.doClick(menuItem);
}

代码示例来源:origin: com.jidesoft/jide-oss

public void menuDragMouseDragged(MenuDragMouseEvent e) {
  if (menuItem != null && menuItem.isEnabled()) {
    MenuSelectionManager manager = e.getMenuSelectionManager();
    MenuElement path[] = e.getPath();
    manager.setSelectedPath(path);
  }
}

代码示例来源:origin: com.jidesoft/jide-oss

public void menuDragMouseDragged(MenuDragMouseEvent e) {
  if (menuItem != null && menuItem.isEnabled()) {
    MenuSelectionManager manager = e.getMenuSelectionManager();
    MenuElement path[] = e.getPath();
    manager.setSelectedPath(path);
  }
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-mercurial

protected static void enableMenu (JMenu menu) {
  boolean enabled = false;
  for (int i = 0; i < menu.getItemCount(); ++i) {
    JMenuItem item = menu.getItem(i);
    if (item != null && item.isEnabled()) {
      enabled = true;
      break;
    }
  }
  menu.setEnabled(enabled);
}

代码示例来源:origin: com.jidesoft/jide-oss

public void menuDragMouseDragged(MenuDragMouseEvent e) {
  if (menuItem != null && menuItem.isEnabled()) {
    MenuSelectionManager manager = e.getMenuSelectionManager();
    MenuElement path[] = e.getPath();
    manager.setSelectedPath(path);
  }
}

代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler

public void popupMenuFilter() {
  Action cutAction = mediator.getApplication().getActionManager().getAction(CutAction.class);
  for (MenuElement element : popup.getSubElements()) {
    JMenuItem item = (JMenuItem) element;
    if (!item.getAction().equals(cutAction)) {
      item.setVisible(item.isEnabled());
    } else {
      break;
    }
  }
}

相关文章

JMenuItem类方法