Package org.jamesii.gui.model.editor.ca.cellrenderer

Examples of org.jamesii.gui.model.editor.ca.cellrenderer.ICACellRenderer


   * @return A {@link JPopupMenu} that allows for changing value mappings.
   */
  private JPopupMenu setUpPopupMenu(final int itemIndex) {
    JPopupMenu m = new JPopupMenu();

    final ICACellRenderer cr = getCACellRenderer();
    final List<ICAValueMapper> mappers = cr.getMappers();

    for (ICAValueMapper vm : mappers) {
      vm.addMappingChangedListener(this);
    }

    for (int i = 0; i < cr.getInputs().size(); i++) {
      Class<?> c = cr.getInputs().get(i);
      final int j = i;

      final ICAValueMapperEditor editor =
          CAValueMapperEditorManager.getValueMapperEditorFor(c);

      JMenuItem mi =
          new JMenuItem("Edit " + cr.getInputName(i) + " for "
              + getModel().getElementAt(itemIndex) + " ...");

      if (editor == null) {
        mi.setEnabled(false);
      } else {
        mi.addActionListener(new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent e) {
            editor.editMappingFor(cr.getInputName(j), itemIndex, mappers.get(j));
          }
        });
      }

      m.add(mi);
View Full Code Here

TOP

Related Classes of org.jamesii.gui.model.editor.ca.cellrenderer.ICACellRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.