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

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

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

JMenuItem.getClientProperty介绍

暂无

代码示例

代码示例来源: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: net.sf.squirrel-sql.plugins/graph

public void actionPerformed(ActionEvent e)
  {
   onAddTableForForeignKey((ColumnInfo)_mnuAddTableForForeignKey.getClientProperty(MNU_PROP_COLUMN_INFO));
  }
});

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

public void actionPerformed(ActionEvent e) {
    if (e.getSource() instanceof JMenuItem) {
      JMenuItem jmi = (JMenuItem) e.getSource();
      ExecutionEnvironment execEnv = (ExecutionEnvironment) jmi.getClientProperty(HOST_ENV);
      MakeConfiguration mconf = (MakeConfiguration) jmi.getClientProperty(CONF);
      Project project = (Project) jmi.getClientProperty(PROJECT);
      setRemoteDevelopmentHost(jmi, mconf, execEnv, project);
    }
  }
}

代码示例来源:origin: jawi/ols

/**
 * Returns whether or not the given menu item is "persistent", i.e., it
 * should not be removed automagically from the menu.
 *
 * @param aMenuItem
 *          the menu item to test, cannot be <code>null</code>.
 * @return <code>true</code> if the menu item is persistent,
 *         <code>false</code> otherwise.
 */
private boolean isPersistentMenuItem( final JMenuItem aMenuItem )
{
 final Object isPersistent = aMenuItem.getClientProperty( PERSISTENT_MENU_ITEM_KEY );
 return Boolean.TRUE.equals( isPersistent );
}

代码示例来源:origin: stackoverflow.com

public void actionPerformed(ActionEvent e) {
 JMenuItem item = (JMenuItem)e.getSource();
 Object value = item.getClientProperty("keyValue");
 if (value instanceof Integer) {
   int index = ((Integer)value).intValue();

代码示例来源:origin: com.fifesoft.rtext/fife.common

@Override
public void mouseEntered(MouseEvent e) {
  JMenuItem item = (JMenuItem)e.getSource();
  Timer timer = (Timer)item.getClientProperty(PROPERTY_TIMER);
  timer.start();
}

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

public void mouseEntered(MouseEvent e) {
  JMenuItem item = (JMenuItem)e.getSource();
  Timer timer = (Timer)item.getClientProperty(PROPERTY_TIMER);
  timer.start();
}

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

public void mouseExited(MouseEvent e) {
    JMenuItem item = (JMenuItem)e.getSource();
    Timer timer = (Timer)item.getClientProperty(PROPERTY_TIMER);
    timer.stop();
  }
}

代码示例来源:origin: com.fifesoft.rtext/fife.common

@Override
  public void mouseExited(MouseEvent e) {
    JMenuItem item = (JMenuItem)e.getSource();
    Timer timer = (Timer)item.getClientProperty(PROPERTY_TIMER);
    timer.stop();
  }
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public void mouseEntered(MouseEvent e) {
  JMenuItem item = (JMenuItem) e.getSource();
  Timer timer = (Timer) item.getClientProperty(PROPERTY_TIMER);
  timer.start();
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public void mouseExited(MouseEvent e) {
    JMenuItem item = (JMenuItem) e.getSource();
    Timer timer = (Timer) item.getClientProperty(PROPERTY_TIMER);
    timer.stop();
  }
}

代码示例来源:origin: tulskiy/musique

@Override
  public void actionPerformed(ActionEvent e) {
    JMenuItem item = (JMenuItem) e.getSource();
    int index = (Integer) item.getClientProperty("order");
    config.setInt("player.playbackOrder", index);
  }
};

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

@Override
public void actionPerformed(ActionEvent ae) {
  JMenuItem item = (JMenuItem) ae.getSource();
  CsmOffsetableDeclaration decl = (CsmOffsetableDeclaration) item.getClientProperty(PROP_DECLARATION);
  GoToDeclarationAction action = new GoToDeclarationAction(decl, true);
  action.actionPerformed(null);
}

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

public void actionPerformed( ActionEvent e ) {
  if ( e.getSource() instanceof JMenuItem ) {
    JMenuItem jmi = (JMenuItem)e.getSource();
ConfigurationDescriptor projectDescriptor = (ConfigurationDescriptor)jmi.getClientProperty( PROJECT_KEY );
    if (projectDescriptor != null ) {
      projectDescriptor.getConfs().setActive(jmi.getText());
  //SprojectDescriptor.setModified();
    }
    
  }
  
}

代码示例来源:origin: tulskiy/musique

@Override
  public void actionPerformed(ActionEvent e) {
    JMenuItem src = (JMenuItem) e.getSource();
    Integer index = (Integer) src.getClientProperty("index");
    switch (index) {
      case 0:
        String ret = JOptionPane.showInputDialog(null,
            "Sort By...",
            config.getString("playlist.sortString", ""));
        if (ret != null) {
          Collections.sort(tracks, new TrackComparator(Parser.parse(ret)));
          config.setString("playlist.sortString", ret);
        }
        break;
      case 1:
        Collections.shuffle(tracks);
        break;
      case 2:
        Collections.reverse(tracks);
        break;
      default:
        Collections.sort(tracks, new TrackComparator(Parser.parse(sortValues[index])));
    }
  }
};

代码示例来源:origin: uk.co.caprica/vlcj

@Override
  public void actionPerformed(ActionEvent e) {
    JMenuItem source = (JMenuItem)e.getSource();
    String audioOutputName = (String)source.getClientProperty("AudioOutputName");
    String audioDeviceId = (String)source.getClientProperty("AudioDeviceId");
    mediaPlayer.audio().setOutput(audioOutputName);
    if(audioDeviceId != null) {
      mediaPlayer.audio().setOutputDevice(audioOutputName, audioDeviceId);
    }
    audioOutputTextField.setText(audioOutputName);
    audioDeviceTextField.setText(audioDeviceId);
    // If you do not revalidate after setting the text, bizarrely the menu
    // appears behind the heavy-weight Canvas
    controlsPanel.revalidate();
  }
};

代码示例来源:origin: tulskiy/musique

@Override
public void actionPerformed(ActionEvent e) {
  JMenuItem src = (JMenuItem) e.getSource();
  Integer index = (Integer) src.getClientProperty("index");
  PlaylistTable table = tabs.getSelectedTable();
  if (table == null)

代码示例来源:origin: omegat-org/omegat

public void actionPerformed(ActionEvent e) {
    JMenuItem source = (JMenuItem) e.getSource();
    ScriptSet set = (ScriptSet) source.getClientProperty("set");
    // Unset all previous scripts
    for (int i = 0; i < NUMBERS_OF_QUICK_SCRIPTS; i++) {
      Preferences.setPreference(Preferences.SCRIPTS_QUICK_PREFIX + scriptKey(i), "");
      unsetQuickScriptMenu(i);
    }
    for (int i = 0; i < NUMBERS_OF_QUICK_SCRIPTS; i++) {
      ScriptItem si = set.getScriptItem(scriptKey(i));
      if (si != null) {
        Preferences.setPreference(Preferences.SCRIPTS_QUICK_PREFIX + scriptKey(i),
            si.getFile().getName());
        new QuickScriptUpdater(i).updateQuickScript(si);
        updateQuickScripts();
      }
    }
  }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-config

Integer selectedColumn = (Integer) ui.getCopyCellValue().getClientProperty("selectedColumn");

代码示例来源:origin: tulskiy/musique

Integer index = (Integer) src.getClientProperty("index");
if (index < groupItems.length - 1) {
  playlist.setGroupBy(groupValues[index]);

相关文章

JMenuItem类方法