@ApplicationScoped public class WorkspaceProjectContext extends Object
Project context contains the active organizational unit, project, module, and package (referred to as the "active unit" henceforth). This context represents the active unit currently displayed in the UI by this workbench instance. If a screen or perspective that displays an active unit is shown or hidden, it is that screen's responsibility (or that of a related component) to fire a WorkspaceProjectContextChangeEvent to alter the context. This context should NOT directly observe deletion events. Instead it should be the relevant UI components job to observe such events and react (likely by closing themselves, and changing the active unit in this context).
Each field can be null, then there is nothing active.
Only the WorkspaceProjectContextChangeEvent can change this and after each change we need to alert the change handlers.
Constructor and Description |
---|
WorkspaceProjectContext() |
WorkspaceProjectContext(javax.enterprise.event.Event<WorkspaceProjectContextChangeEvent> contextChangeEvent) |
public WorkspaceProjectContext()
@Inject public WorkspaceProjectContext(javax.enterprise.event.Event<WorkspaceProjectContextChangeEvent> contextChangeEvent)
public void onOrganizationalUnitUpdated(@Observes UpdatedOrganizationalUnitEvent event)
public void onModuleUpdated(@Observes ModuleUpdatedEvent moduleUpdatedEvent)
public void onProjectContextChanged(@Observes WorkspaceProjectContextChangeEvent event)
protected void setActiveOrganizationalUnit(OrganizationalUnit activeOrganizationalUnit)
public Optional<OrganizationalUnit> getActiveOrganizationalUnit()
protected void setActiveWorkspaceProject(WorkspaceProject activeWorkspaceProject)
public Optional<WorkspaceProject> getActiveWorkspaceProject()
protected void setActiveModule(Module activeModule)
protected void setActivePackage(Package activePackage)
public ProjectContextChangeHandle addChangeHandler(WorkspaceProjectContextChangeHandler changeHandler)
public void removeChangeHandler(ProjectContextChangeHandle projectContextChangeHandle)
public void updateProjectModule(Module module)
Copyright © 2012–2020 JBoss by Red Hat. All rights reserved.