Trait Action
Source pub trait Action: Send + Sync {
// Required methods
fn new() -> Self
where Self: Sized;
fn id(&self) -> TheId;
fn info(&self) -> String;
fn role(&self) -> ActionRole;
fn is_applicable(
&self,
map: &Map,
ctx: &mut TheContext,
server_ctx: &ServerContext,
) -> bool;
fn params(&self) -> TheNodeUI;
fn handle_event(
&mut self,
event: &TheEvent,
project: &mut Project,
ui: &mut TheUI,
ctx: &mut TheContext,
server_ctx: &mut ServerContext,
) -> bool;
// Provided methods
fn accel(&self) -> Option<TheAccelerator> { ... }
fn load_params(&mut self, map: &Map) { ... }
fn load_params_project(
&mut self,
project: &Project,
server_ctx: &mut ServerContext,
) { ... }
fn apply(
&self,
map: &mut Map,
ui: &mut TheUI,
ctx: &mut TheContext,
server_ctx: &mut ServerContext,
) -> Option<ProjectUndoAtom> { ... }
fn apply_project(
&self,
project: &mut Project,
ui: &mut TheUI,
ctx: &mut TheContext,
server_ctx: &mut ServerContext,
) { ... }
}