Examples of ListSelectionValueModelAdapter


Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

            }
        });

        widget.getTable().addMouseListener(new PopupMenuMouseListener(popupMenu));

        ValueModel selectionHolder = new ListSelectionValueModelAdapter(widget.getTable().getSelectionModel());
        new ListSingleSelectionGuard(selectionHolder, deleteExecutor);
        new ListSingleSelectionGuard(selectionHolder, propertiesExecutor);

        JPanel view = new JPanel(new BorderLayout());
        view.add(widget.getTextFilterField(), BorderLayout.NORTH);
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

            // These guard objects operate by inspecting a list selection model
            // (held within a ValueModel) and then either enabling or disabling the
            // guarded object (our executors) based on the configured criteria.
            // This configuration greatly simplifies the interaction between commands
            // that require a selection on which to operate.
            ValueModel selectionHolder = new ListSelectionValueModelAdapter(contactTable.getSelectionModel());
            new ListSingleSelectionGuard(selectionHolder, deleteExecutor);
            new ListSingleSelectionGuard(selectionHolder, propertiesExecutor);

            return contactTable;
        }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                logger.debug("Adjusting commands to new model");
                final ListModel listModel = (ListModel) evt.getNewValue();
                final ValueModel selectionModel = new ListSelectionValueModelAdapter(masterDetailList.getDetailList().getSelectionModel());
                final ValueModel vModel = new JListSelectionValueModelAdapter(listModel, (ListSelectionValueModelAdapter) selectionModel);
                typeHierarchyCommand.setValueModel(vModel);
                typeInspectionCommand.setValueModel(vModel);
                numTypes.setValue(listModel.getSize());
            }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                logger.debug("Adjusting commands to new model " + evt.getPropertyName());
                final ListModel listModel = (ListModel) evt.getNewValue();
                final ValueModel selectionModel = new ListSelectionValueModelAdapter(masterDetailList.getMasterList().getSelectionModel());
                final ValueModel vModel = new JListSelectionValueModelAdapter(listModel, (ListSelectionValueModelAdapter) selectionModel);
                similarTypesTypeHierarchyCommand.setValueModel(vModel);
                similarTypesInspectionCommand.setValueModel(vModel);
                numSimilarTypesSchema.setValue(listModel.getSize());
            }
        });

        masterDetailList.addPropertyChangeListener(MasterListDetailList.PC_DETAILLIST_LISTMODEL, new PropertyChangeListener() {

            @Override
            public void propertyChange(PropertyChangeEvent evt) {
                logger.debug("Adjusting commands to new model " + evt.getPropertyName());
                final ListModel listModel = (ListModel) evt.getNewValue();
                final ValueModel selectionModel = new ListSelectionValueModelAdapter(masterDetailList.getDetailList().getSelectionModel());
                final ValueModel vModel = new JListSelectionValueModelAdapter(listModel, (ListSelectionValueModelAdapter) selectionModel);
                typesListTypeHierarchyCommand.setValueModel(vModel);
                typesListTypeInspectionCommand.setValueModel(vModel);
                numSimilarTypes.setValue(listModel.getSize());
            }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

            final UnusedTypesListModelAdapter unusedTypesListModelAdapter = new UnusedTypesListModelAdapter(unusedTypes);
            final FilteredListModel filteredModel = new FilteredListModel(unusedTypesListModelAdapter, unusedTypesConstraint);
            jlUnusedTypes.setModel(filteredModel);
            numUnusedTypes.setValue(unusedTypesListModelAdapter.getSize());

            final ValueModel selectionModel = new ListSelectionValueModelAdapter(jlUnusedTypes.getSelectionModel());
            final ValueModel vModel = new JListSelectionValueModelAdapter(jlUnusedTypes.getModel(), (ListSelectionValueModelAdapter) selectionModel);
            unusedTypeHierarchyCommand.setValueModel(vModel);
            unusedTypeInspectionCommand.setValueModel(vModel);

        }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

      @NotNull
      public Collection<? extends ActionCommand> getCommands( @NotNull ValueModel selectionHolder ) {
        ObjectTable<T> objectTable = panel.getObjectTable();

        //noinspection ResultOfObjectAllocationIgnored
        new ListSingleSelectionGuard( new ListSelectionValueModelAdapter( objectTable.getSelectionModel() ), editCommand );
        return Collections.singletonList( editCommand );
      }

      @Override
      public void registerLocalCommandExecutors( @NotNull PageComponentContext context ) {
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

  /**
   * Adds the commands
   */
  private void addCommands() {
    List<Collection<? extends ActionCommand>> commands = getCommands( new ListSelectionValueModelAdapter( getObjectTable().getSelectionModel() ) );

    if ( commands.isEmpty() ) {
      //No commands --> exit fast
      return;
    }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

  public void configurePreShow( @NotNull ObjectTable<T> objectTable ) {
  }

  @Override
  public void configurePostShow( @NotNull ObjectTable<T> objectTable ) {
    ValueModel selectionHolder = new ListSelectionValueModelAdapter( objectTable.getSelectionModel() );
    configureCommandGuards( selectionHolder );
  }
View Full Code Here

Examples of org.springframework.richclient.list.ListSelectionValueModelAdapter

    return newCommand;
  }

  @Override
  public void initialize() {
    ValueModel selectionHolder = new ListSelectionValueModelAdapter( listView.getTable().getSelectionModel() );

    //noinspection ResultOfObjectAllocationIgnored
    new ListSingleSelectionGuard( selectionHolder, deleteCommand );
    //noinspection ResultOfObjectAllocationIgnored
    new ListSingleSelectionGuard( selectionHolder, propertiesCommand );
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.