Examples of ListSelectionModel


Examples of javax.swing.ListSelectionModel

        model = new CObjTableModel();
  table = new JTable(model);

  table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
  ListSelectionModel lsm = table.getSelectionModel();
  lsm.addListSelectionListener(this);
  scrollPane = new JScrollPane(table);

  listPanel.setLayout(new BorderLayout());
  listPanel.add(scrollPane, BorderLayout.CENTER);
View Full Code Here

Examples of javax.swing.ListSelectionModel

    /*
     * BEGIN INTERFACE ListSelectionListener
     */
    public void valueChanged(ListSelectionEvent e)  {
  ListSelectionModel lsm = (ListSelectionModel)e.getSource();
  boolean  isAdjusting = e.getValueIsAdjusting();
  int  firstIndex = e.getFirstIndex();
  int  lastIndex = e.getLastIndex();

  if (isAdjusting == false) {
      /*
       * Query model for selected index and get the object at the
       * index.
       */
      if (lsm.isSelectionEmpty()) {
    /*
          System.out.println("nothing selected");
    */
      } else {
          int selectedRow = lsm.getMinSelectionIndex();
    /*
          System.err.println("selected row : " + selectedRow);
    */

    Object o = model.getValueAt(selectedRow, 0);
View Full Code Here

Examples of javax.swing.ListSelectionModel

  {
    final BulkDataProvider bulkListModel = (BulkDataProvider) list.getModel();
    final JButton otherAdd = new BorderlessButton(addAction);
    final JLabel otherLabel = new JLabel(Messages.getString(labelText));

    final ListSelectionModel otherSelectionModel = list.getSelectionModel();
    final JButton otherSortUp = new BorderlessButton(new SortBulkUpAction(bulkListModel, otherSelectionModel));
    final JButton otherSortDown = new BorderlessButton(new SortBulkDownAction(bulkListModel, otherSelectionModel));
    final JButton otherRemove = new BorderlessButton(new RemoveBulkAction(bulkListModel, otherSelectionModel));

    GridBagConstraints gbc = new GridBagConstraints();
View Full Code Here

Examples of javax.swing.ListSelectionModel

  {
    final DefaultBulkListModel bulkListModel = (DefaultBulkListModel) list.getModel();
    final JButton otherAdd = new BorderlessButton(new AddListSelectionAction(availableFields, bulkListModel));
    final JLabel otherLabel = new JLabel(Messages.getString(labelText));

    final ListSelectionModel otherSelectionModel = list.getSelectionModel();
    final JButton otherSortUp = new BorderlessButton(new SortBulkUpAction(bulkListModel, otherSelectionModel));
    final JButton otherSortDown = new BorderlessButton(new SortBulkDownAction(bulkListModel, otherSelectionModel));
    final JButton otherRemove = new BorderlessButton(new RemoveBulkAction(bulkListModel, otherSelectionModel));

    GridBagConstraints gbc = new GridBagConstraints();
View Full Code Here

Examples of javax.swing.ListSelectionModel

    return null;
  }

  private void configurePanelWithSelection()
  {
    final ListSelectionModel selectionModel = table.getSelectionModel();
    final JLabel columnsLabel = new JLabel(Messages.getInstance().getString("ArrayCellEditorDialog.SelectedItems"));

    final Action addGroupAction = new AddEntryAction(tableModel);
    final Action removeGroupAction = new RemoveEntryAction(tableModel, selectionModel);
    final Action sortUpAction = new SortBulkUpAction(tableModel, selectionModel, table);
View Full Code Here

Examples of javax.swing.ListSelectionModel


  private void configurePanelWithoutSelection()
  {
    final JLabel columnsLabel = new JLabel(Messages.getInstance().getString("ArrayCellEditorDialog.SelectedItems"));
    final ListSelectionModel selectionModel = table.getSelectionModel();

    final Action addGroupAction = new AddEntryAction(tableModel);
    final Action removeGroupAction = new RemoveEntryAction(tableModel, selectionModel);
    final Action sortUpAction = new SortBulkUpAction(tableModel, selectionModel, table);
    final Action sortDownAction = new SortBulkDownAction(tableModel, selectionModel, table);
View Full Code Here

Examples of javax.swing.ListSelectionModel

  }

  private JPanel createTablePanel(final ElementMetaDataTable dateFormatTable,
                                  final ArrayTableModel dateFormatModel)
  {
    final ListSelectionModel selectionModel = dateFormatTable.getSelectionModel();
    final Action addGroupAction = new AddEntryAction(dateFormatModel);
    final Action removeGroupAction = new RemoveEntryAction(dateFormatModel, selectionModel, dateFormatTable);

    final Action sortUpAction = new SortBulkUpAction(dateFormatModel, selectionModel, dateFormatTable);
    final Action sortDownAction = new SortBulkDownAction(dateFormatModel, selectionModel, dateFormatTable);
View Full Code Here

Examples of javax.swing.ListSelectionModel

  private JPanel createSelectionPane()
  {
    final JButton columnsAdd = new BorderlessButton(new AddSelectionAction(availableFields.getSelectionModel()));
    final JLabel columnsLabel = new JLabel(Messages.getString("EditGroupDetailsDialog.SelectedItems"));

    final ListSelectionModel columnsSelectionModel = groupFields.getSelectionModel();
    final JButton columnsSortUp = new BorderlessButton(new SortBulkUpAction(groupFieldsModel, columnsSelectionModel));
    final JButton columnsSortDown = new BorderlessButton(new SortBulkDownAction(groupFieldsModel, columnsSelectionModel));
    final JButton columnsRemove = new BorderlessButton(new RemoveBulkAction(groupFieldsModel, columnsSelectionModel));

    final JPanel tablesPane = new JPanel();
View Full Code Here

Examples of javax.swing.ListSelectionModel

      {
        return;
      }

      final DrillDownParameter[] data = parameterTableModel.getGroupedData();
      final ListSelectionModel listSelectionModel = table.getSelectionModel();
      final ArrayList<DrillDownParameter> result = new ArrayList<DrillDownParameter>(data.length);
      for (int i = 0; i < data.length; i++)
      {
        final DrillDownParameter parameter = data[i];
        if (parameter == null)
        {
          continue;
        }
        if (listSelectionModel.isSelectedIndex(model.mapFromModel(i)) == false ||
            parameter.getType() != DrillDownParameter.Type.MANUAL)
        {
          result.add(data[i]);
        }
      }
View Full Code Here

Examples of javax.swing.ListSelectionModel

    return null;
  }

  private void configurePanelWithSelection()
  {
    final ListSelectionModel selectionModel = table.getSelectionModel();
    final JLabel columnsLabel = new JLabel(UtilMessages.getInstance().getString("ArrayCellEditorDialog.SelectedItems"));

    final Action addGroupAction = new AddEntryAction(tableModel);
    final Action removeGroupAction = new RemoveEntryAction(tableModel, selectionModel);
    final Action sortUpAction = new SortBulkUpAction(tableModel, selectionModel, table);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.