Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pharo-spec/commander2
Flexible implementation of the command design pattern.
https://github.com/pharo-spec/commander2
pharo
Last synced: 16 days ago
JSON representation
Flexible implementation of the command design pattern.
- Host: GitHub
- URL: https://github.com/pharo-spec/commander2
- Owner: pharo-spec
- Created: 2018-10-24T18:03:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-10T06:43:19.000Z (over 5 years ago)
- Last Synced: 2024-11-10T17:40:16.380Z (2 months ago)
- Topics: pharo
- Language: Smalltalk
- Homepage:
- Size: 217 KB
- Stars: 1
- Watchers: 9
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Commander 2
[![Build Status](https://travis-ci.org/pharo-spec/Commander2.svg?branch=master)](https://travis-ci.org/pharo-spec/Commander2)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/PolyMathOrg/DataFrame/master/LICENSE)
[![Pharo version](https://img.shields.io/badge/Pharo-8.0-%23aac9ff.svg)](https://pharo.org/download)Implementation of the command design pattern with the following objectives:
- Simple model of commands
- Ease reusability of commands accross multiple tools / framework
- Instance of commands can be modified (e.g., name, description, etc...)
- Pluging custom user-command made easy## Install
```Smalltalk
Metacello new
repository: 'github://pharo-spec/Commander2/src';
baseline: 'Commander2';
load
```## Example
> Note: This example is now shipped with the Spec2 integration which is managed by [Spec2 project](https://github.com/pharo-spec/Spec).
> The code is thus no longer available in this repository.`Commander2-ContactBook` package contains an example of Commander2 usage in the context of a Spec application.
The following code should be checked when learning how to use the framework:
- `CmContactBookCommand` and subclasses are the definition of commands required by the example application.
- `CmContactBookPresenter class>>#buildCommandsGroupWith:forRoot:` This method is the entry point to describe commands available to your Spec presenter. One can learn how to build group of commands from this method.
- `CmContactBookPresenter>>#initializeWidgets` This method shows how to inject a Spec's `MenuPresenter` built from a command group in your presenter.
- `CmContactBookPresenter>>#initializeWindow:` This method shows how to bind the shortcuts defined by your command group to your Spec presenter.