Exemplo n.º 1
0
  /**
   * Creates a generic panel that holds the basic bean information System Name, User Name and
   * Comment
   */
  BeanItemPanel basicDetails() {
    BeanItemPanel basic = new BeanItemPanel();

    basic.setName(Bundle.getMessage("Basic"));
    basic.setLayout(new BoxLayout(basic, BoxLayout.Y_AXIS));

    basic.addItem(
        new BeanEditItem(
            new JLabel(bean.getSystemName()), Bundle.getMessage("ColumnSystemName"), null));

    basic.addItem(new BeanEditItem(userNameField, Bundle.getMessage("ColumnUserName"), null));

    basic.addItem(new BeanEditItem(commentFieldScroller, Bundle.getMessage("ColumnComment"), null));

    basic.setSaveItem(
        new AbstractAction() {
          /** */
          private static final long serialVersionUID = -1823311798750191527L;

          public void actionPerformed(ActionEvent e) {
            saveBasicItems(e);
          }
        });
    basic.setResetItem(
        new AbstractAction() {
          /** */
          private static final long serialVersionUID = 2590436299984618901L;

          public void actionPerformed(ActionEvent e) {
            resetBasicItems(e);
          }
        });
    bei.add(basic);
    return basic;
  }
Exemplo n.º 2
0
  BeanItemPanel usageDetails() {
    BeanItemPanel usage = new BeanItemPanel();

    usage.setName(Bundle.getMessage("Usage"));
    usage.setLayout(new BoxLayout(usage, BoxLayout.Y_AXIS));

    usage.addItem(
        new BeanEditItem(null, null, Bundle.getMessage("UsageText", bean.getDisplayName())));

    ArrayList<String> listeners = new ArrayList<String>();
    for (String ref : bean.getListenerRefs()) {
      if (!listeners.contains(ref)) {
        listeners.add(ref);
      }
    }

    Object[] strArray = new Object[listeners.size()];
    listeners.toArray(strArray);
    JList<Object> list = new JList<Object>(strArray);
    list.setLayoutOrientation(JList.VERTICAL);
    list.setVisibleRowCount(-1);
    list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    JScrollPane listScroller = new JScrollPane(list);
    listScroller.setPreferredSize(new Dimension(250, 80));
    listScroller.setBorder(
        BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.black)));
    usage.addItem(new BeanEditItem(listScroller, Bundle.getMessage("ColumnLocation"), null));

    bei.add(usage);
    return usage;
  }
Exemplo n.º 3
0
  BeanItemPanel propertiesDetails() {
    BeanItemPanel properties = new BeanItemPanel();
    properties.setName(Bundle.getMessage("Properties"));
    properties.addItem(
        new BeanEditItem(null, null, Bundle.getMessage("NamedBeanPropertiesTableDescription")));
    properties.setLayout(new BoxLayout(properties, BoxLayout.Y_AXIS));
    propertiesModel = new BeanPropertiesTableModel();
    JTable jtAttributes = new JTable();
    jtAttributes.setModel(propertiesModel);
    JScrollPane jsp = new JScrollPane(jtAttributes);
    Dimension tableDim = new Dimension(400, 200);
    jsp.setMinimumSize(tableDim);
    jsp.setMaximumSize(tableDim);
    jsp.setPreferredSize(tableDim);
    properties.addItem(new BeanEditItem(jsp, "", null));
    properties.setSaveItem(
        new AbstractAction() {
          /** */
          private static final long serialVersionUID = -5627203723098157467L;

          public void actionPerformed(ActionEvent e) {
            propertiesModel.updateModel(bean);
          }
        });
    properties.setResetItem(
        new AbstractAction() {
          /** */
          private static final long serialVersionUID = -956489116413677732L;

          public void actionPerformed(ActionEvent e) {
            propertiesModel.setModel(bean);
          }
        });

    bei.add(properties);
    return properties;
  }