javax.swing.JPopupMenu.setEnabled()方法的使用及代码示例

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

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

JPopupMenu.setEnabled介绍

暂无

代码示例

代码示例来源:origin: eu.mihosoft.vrl/vrl

@Override
public void setEnabled(boolean v) {
  if (menu != null) {
    menu.setEnabled(v);
  } else if (popup != null) {
    popup.setEnabled(v);
  }
}

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

@ScriptFunction
@Override
public void setEnabled(boolean aValue) {
  super.setEnabled(aValue);
}

代码示例来源:origin: net.sf.mmax2/mmax2

protected final void activateFloatingAttributeWindow()
  floatingAttributeWindow.setEnabled(false);
  JMenuItem item = null;

代码示例来源:origin: net.sf.meka/meka

((JPopupMenu) m_Menu).setEnabled(m_RecentItems.size() > 0);

代码示例来源:origin: Waikato/meka

((JPopupMenu) m_Menu).setEnabled(m_RecentItems.size() > 0);

代码示例来源:origin: nroduit/Weasis

@Override
  public void showPopup(Component invoker, int x, int y) {
    final EventManager evtMgr = EventManager.getInstance();
    ComboItemListener<?> koSelectionAction =
      ((ComboItemListener<?>) evtMgr.getAction(ActionW.KO_SELECTION));
    JPopupMenu popupMenu = new JPopupMenu();
    popupMenu.add(new TitleMenuItem(ActionW.KO_SELECTION.getTitle(), popupMenu.getInsets()));
    popupMenu.addSeparator();
    GroupPopup groupRadioMenu = koSelectionAction.createUnregisteredGroupRadioMenu();
    if (groupRadioMenu instanceof GroupRadioMenu) {
      for (RadioMenuItem item : ((GroupRadioMenu<?>) groupRadioMenu).getRadioMenuItemListCopy()) {
        popupMenu.add(item);
      }
    }
    popupMenu.addSeparator();
    ToggleButtonListener koFilterAction = (ToggleButtonListener) evtMgr.getAction(ActionW.KO_FILTER);
    final JCheckBoxMenuItem menuItem =
      koFilterAction.createUnregiteredJCheckBoxMenuItem(ActionW.KO_FILTER.getTitle());
    popupMenu.add(menuItem);
    popupMenu.setEnabled(koSelectionAction.isActionEnabled());
    popupMenu.show(invoker, x, y);
  }
}, View2d.KO_ICON);

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void updateEnabledState() {
  setEnabled(getEditor() != null && getEditor().isEnabled());
  if (getView() != null && colorChooser != null && popupMenu != null) {
    colorChooser.setEnabled(getView().getSelectionCount() > 0);
    popupMenu.setEnabled(getView().getSelectionCount() > 0);
    isUpdating++;
    Color drawingColor = getView().getDrawing().get(key);
    colorChooser.setColor(drawingColor == null ? new Color(0, true) : drawingColor);
    isUpdating--;
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void updateEnabledState() {
  setEnabled(getEditor().isEnabled());
  if (getView() != null && colorChooser != null && popupMenu != null) {
    colorChooser.setEnabled(getView().getSelectionCount() > 0);
    popupMenu.setEnabled(getView().getSelectionCount() > 0);
    isUpdating++;
    if (getView().getSelectionCount() > 0 /*&& colorChooser.isShowing()*/) {
      for (Figure f : getView().getSelectedFigures()) {
          Color figureColor = f.get(key);
          colorChooser.setColor(figureColor==null?new Color(0,true):figureColor);
          break;
      }
    }
    isUpdating--;
  }
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
protected void updateEnabledState() {
  setEnabled(getEditor().isEnabled());
  if (getView() != null && fontChooser != null && popupMenu != null) {
    fontChooser.setEnabled(getView().getSelectionCount() > 0);
    popupMenu.setEnabled(getView().getSelectionCount() > 0);
    isUpdating++;
    if (getView().getSelectionCount() > 0 /*&& fontChooser.isShowing()*/) {
      for (Figure f : getView().getSelectedFigures()) {
        if (f instanceof TextHolderFigure) {
          TextHolderFigure thf = (TextHolderFigure) f;
          fontChooser.setSelectedFont(thf.getFont());
          break;
        }
      }
    }
    isUpdating--;
  }
}

相关文章

JPopupMenu类方法