javax.swing.JMenu.getClientProperty()方法的使用及代码示例

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

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

JMenu.getClientProperty介绍

暂无

代码示例

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

public boolean isExtraSubMenu(final Component c) {
  return (c instanceof JMenu) &&  (Boolean.TRUE.equals(((JMenu)c).getClientProperty(EXTRA_SUBMENU)));
}

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

/** Adds the specified action as a menu item to the supplied menu. */
protected void addMenuItem(JMenu m, JMenuItem mi) {
  if (mi != null) {
    if (m.getClientProperty("needsSeparator") == Boolean.TRUE) {
      m.addSeparator();
      m.putClientProperty("needsSeparator", null);
    }
    m.add(mi);
  }
}

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

/** Adds the specified action as a menu item to the supplied menu. */
protected void addAction(JMenu m, Action a) {
  if (a != null) {
    if (m.getClientProperty("needsSeparator") == Boolean.TRUE) {
      m.addSeparator();
      m.putClientProperty("needsSeparator", null);
    }
    JMenuItem mi;
    mi = m.add(a);
    mi.setIcon(null);
    mi.setToolTipText(null);
  }
}

代码示例来源:origin: net.sf.doolin/doolin-gui

@Override
public MenuBuilder createSubMenu(String name, String label) {
  JMenu subMenu = getMenuByName(name);
  if (subMenu != null) {
    return (JMenuBuilder) subMenu.getClientProperty(JMenuBuilder.class);
  } else {
    subMenu = createMenu(name, label);
    this.menu.add(subMenu);
    noSeparator();
    JMenuBuilder menuContainer = new JMenuBuilder(subMenu);
    subMenu.putClientProperty(JMenuBuilder.class, menuContainer);
    return menuContainer;
  }
}

代码示例来源:origin: net.sf.doolin/doolin-gui

@Override
public MenuBuilder createSubMenu(String name, String label) {
  JMenu subMenu = getMenuByName(name);
  if (subMenu != null) {
    return (JMenuBuilder) subMenu.getClientProperty(JMenuBuilder.class);
  } else {
    subMenu = createMenu(name, label);
    this.popupMenu.add(subMenu);
    noSeparator();
    JMenuBuilder menuContainer = new JMenuBuilder(subMenu);
    subMenu.putClientProperty(JMenuBuilder.class, menuContainer);
    return menuContainer;
  }
}

代码示例来源:origin: net.sf.doolin/doolin-gui

@Override
public MenuBuilder createSubMenu(String name, String label) {
  JMenu menu = getMenuByName(name);
  if (menu != null) {
    return (JMenuBuilder) menu.getClientProperty(JMenuBuilder.class);
  } else {
    menu = createMenu(name, label);
    this.menuBar.add(menu);
    noSeparator();
    JMenuBuilder menuContainer = new JMenuBuilder(menu);
    menu.putClientProperty(JMenuBuilder.class, menuContainer);
    return menuContainer;
  }
}

相关文章