pub trait Item: View {
Show 28 methods
// Required method
fn tab_content<V: 'static>(
&self,
detail: Option<usize>,
style: &Tab,
cx: &AppContext
) -> AnyElement<V>;
// 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<Cow<'_, str>> { ... }
fn tab_description<'a>(
&'a self,
_: usize,
_: &'a AppContext
) -> Option<Cow<'_, str>> { ... }
fn for_each_project_item(
&self,
_: &AppContext,
_: &mut dyn FnMut(usize, &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<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: ModelHandle<Project>,
_cx: &mut ViewContext<'_, '_, Self>
) -> Task<Result<()>> { ... }
fn save_as(
&mut self,
_project: ModelHandle<Project>,
_abs_path: PathBuf,
_cx: &mut ViewContext<'_, '_, Self>
) -> Task<Result<()>> { ... }
fn reload(
&mut self,
_project: ModelHandle<Project>,
_cx: &mut ViewContext<'_, '_, Self>
) -> Task<Result<()>> { ... }
fn to_item_events(_event: &Self::Event) -> SmallVec<[ItemEvent; 2]> { ... }
fn should_close_item_on_event(_: &Self::Event) -> bool { ... }
fn should_update_tab_on_event(_: &Self::Event) -> bool { ... }
fn act_as_type<'a>(
&'a self,
type_id: TypeId,
self_handle: &'a ViewHandle<Self>,
_: &'a AppContext
) -> Option<&AnyViewHandle> { ... }
fn as_searchable(
&self,
_: &ViewHandle<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: ModelHandle<Project>,
_workspace: WeakViewHandle<Workspace>,
_workspace_id: WorkspaceId,
_item_id: ItemId,
_cx: &mut ViewContext<'_, '_, Pane>
) -> Task<Result<ViewHandle<Self>>> { ... }
fn show_toolbar(&self) -> bool { ... }
fn pixel_position_of_cursor(&self, _: &AppContext) -> Option<Vector2F> { ... }
}