Trait workspace2::item::Item
source · pub trait Item: FocusableView + EventEmitter<ItemEvent> {
Show 25 methods
// Required method
fn tab_content(
&self,
detail: Option<usize>,
cx: &WindowContext<'_>
) -> AnyElement;
// Provided methods
fn deactivated(&mut self, _: &mut ViewContext<'_, Self>) { ... }
fn workspace_deactivated(&mut self, _: &mut ViewContext<'_, Self>) { ... }
fn navigate(
&mut self,
_: Box<dyn Any>,
_: &mut ViewContext<'_, Self>
) -> bool { ... }
fn tab_tooltip_text(&self, _: &AppContext) -> Option<SharedString> { ... }
fn tab_description(&self, _: usize, _: &AppContext) -> Option<SharedString> { ... }
fn for_each_project_item(
&self,
_: &AppContext,
_: &mut dyn FnMut(EntityId, &dyn Item)
) { ... }
fn is_singleton(&self, _cx: &AppContext) -> bool { ... }
fn set_nav_history(
&mut self,
_: ItemNavHistory,
_: &mut ViewContext<'_, Self>
) { ... }
fn clone_on_split(
&self,
_workspace_id: WorkspaceId,
_: &mut ViewContext<'_, Self>
) -> Option<View<Self>>
where Self: Sized { ... }
fn is_dirty(&self, _: &AppContext) -> bool { ... }
fn has_conflict(&self, _: &AppContext) -> bool { ... }
fn can_save(&self, _cx: &AppContext) -> bool { ... }
fn save(
&mut self,
_project: Model<Project>,
_cx: &mut ViewContext<'_, Self>
) -> Task<Result<()>> { ... }
fn save_as(
&mut self,
_project: Model<Project>,
_abs_path: PathBuf,
_cx: &mut ViewContext<'_, Self>
) -> Task<Result<()>> { ... }
fn reload(
&mut self,
_project: Model<Project>,
_cx: &mut ViewContext<'_, Self>
) -> Task<Result<()>> { ... }
fn act_as_type<'a>(
&'a self,
type_id: TypeId,
self_handle: &'a View<Self>,
_: &'a AppContext
) -> Option<AnyView> { ... }
fn as_searchable(
&self,
_: &View<Self>
) -> Option<Box<dyn SearchableItemHandle>> { ... }
fn breadcrumb_location(&self) -> ToolbarItemLocation { ... }
fn breadcrumbs(
&self,
_theme: &Theme,
_cx: &AppContext
) -> Option<Vec<BreadcrumbText>> { ... }
fn added_to_workspace(
&mut self,
_workspace: &mut Workspace,
_cx: &mut ViewContext<'_, Self>
) { ... }
fn serialized_item_kind() -> Option<&'static str> { ... }
fn deserialize(
_project: Model<Project>,
_workspace: WeakView<Workspace>,
_workspace_id: WorkspaceId,
_item_id: ItemId,
_cx: &mut ViewContext<'_, Pane>
) -> Task<Result<View<Self>>> { ... }
fn show_toolbar(&self) -> bool { ... }
fn pixel_position_of_cursor(&self, _: &AppContext) -> Option<Point<Pixels>> { ... }
}
Required Methods§
fn tab_content( &self, detail: Option<usize>, cx: &WindowContext<'_> ) -> AnyElement
Provided Methods§
fn deactivated(&mut self, _: &mut ViewContext<'_, Self>)
fn workspace_deactivated(&mut self, _: &mut ViewContext<'_, Self>)
fn tab_tooltip_text(&self, _: &AppContext) -> Option<SharedString>
fn tab_description(&self, _: usize, _: &AppContext) -> Option<SharedString>
sourcefn for_each_project_item(
&self,
_: &AppContext,
_: &mut dyn FnMut(EntityId, &dyn Item)
)
fn for_each_project_item( &self, _: &AppContext, _: &mut dyn FnMut(EntityId, &dyn Item) )
(model id, Item)