/**
   * Insert the method's description here. Creation date: (28.1.2001 13:12:23)
   *
   * @param field com.cosylab.vdct.vdb.VDBFieldData
   */
  public void fieldValueChanged(VDBFieldData field) {
    Record visualRecord = (Record) Group.getRoot().findObject(getName(), true);
    if (visualRecord == null) {
      // com.cosylab.vdct.Console.getInstance().println("o) Internal error: no visual representation
      // of record "+getName()+" found.");
      return;
    }

    com.cosylab.vdct.inspector.InspectorManager.getInstance().updateProperty(visualRecord, field);
    visualRecord.fieldChanged(field);
  }
    public void actionPerformed(ActionEvent e) {
      String recordName = e.getActionCommand();
      Console.getInstance().println("CosyBeansPlugin action: " + recordName);

      // TBD: special case for "Show all..." -> should have other handler, etc...

      Group root = Group.getRoot();
      if (root == null) {
        Console.getInstance().println("CosyBeansPlugin: failed to find database.");
        return;
      }

      // search for record object
      Record record = (Record) root.findObject(recordName, true);
      if (record == null) {
        Console.getInstance()
            .println("CosyBeansPlugin: failed to find '" + recordName + "' record.");
        return;
      }

      // search for record definition object
      DBDRecordData recordDefinition =
          DataProvider.getInstance().getDbdDB().getDBDRecordData(record.getRecordData().getType());
      if (recordDefinition == null) {
        Console.getInstance()
            .println(
                "CosyBeansPlugin: failed to find '"
                    + record.getRecordData().getType()
                    + "' record definition.");
        return;
      }

      // find VAL field
      DBDFieldData fieldData = recordDefinition.getDBDFieldData("VAL");
      if (fieldData == null) {
        Console.getInstance()
            .println(
                "CosyBeansPlugin: failed to find VAL field in '"
                    + record.getRecordData().getType()
                    + "' record definition.");
        return;
      }

      // String channelType = getFieldType(fieldData.getField_type());

      // call abeans

    }
  /** @see com.cosylab.vdct.plugin.popup.ContextPopupPlugin#getItems(Vector) */
  public Vector getItems(Vector selectedObjects) {
    Vector items = null;

    // workspace popup
    if (selectedObjects == null) {
      // nothing to do here
      return null;
    }

    // we have some selected objects
    else {
      JMenu popupMenu = new JMenu(getName());

      Enumeration e = selectedObjects.elements();
      while (e.hasMoreElements()) {
        Object obj = e.nextElement();
        if (obj instanceof Record) {
          Record rec = (Record) obj;

          JMenuItem item = new JMenuItem(rec.getName());
          item.addActionListener(getMenuHandler());

          popupMenu.add(item);
        }
      }

      // add group launcher
      if (popupMenu.getItemCount() > 1) {
        JMenuItem item = new JMenuItem("Show all " + popupMenu.getItemCount() + " records");
        item.addActionListener(getMenuHandler());

        popupMenu.add(new JSeparator());
        popupMenu.add(item);
      }

      // add group launcher
      if (popupMenu.getItemCount() > 0) {
        items = new Vector();
        items.addElement(popupMenu);
      }
    }

    return items;
  }