BrightSide Workbench Full Report + Source Code
ProjectPhaseWrapper.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2016 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
package
org.turro.dossier.project;
20
21
import
java.util.Date;
22
import
org.turro.dossier.entity.Project;
23
import
org.turro.phase.Phase;
24
import
org.turro.phase.PhaseDefinition;
25
import
org.turro.phase.PhaseDefinitions;
26
31
public
class
ProjectPhaseWrapper
extends
Phase
{
32
33
private
final
Project
project;
34
35
public
ProjectPhaseWrapper
(
Project
project) {
36
super(
PhaseDefinitions
.
instance
().
get
(project.
getPhase
()));
37
this.project = project;
38
}
39
40
@Override
41
protected
PhaseDefinition
doCheckPhase
(Date now) {
42
return
current
;
43
}
44
45
@Override
46
protected
PhaseDefinition
doChangeTo
(
PhaseDefinition
newPhase) {
47
project.
setPhase
(newPhase.
getIndex
());
48
return
PhaseDefinitions
.
instance
().
get
(project.
getPhase
());
49
}
50
51
}
org.turro.dossier.entity.Project
Definition:
elephant-dossier/src/main/java/org/turro/dossier/entity/Project.java:42
org.turro.dossier.entity.Project.getPhase
int getPhase()
Definition:
elephant-dossier/src/main/java/org/turro/dossier/entity/Project.java:96
org.turro.dossier.entity.Project.setPhase
void setPhase(int phase)
Definition:
elephant-dossier/src/main/java/org/turro/dossier/entity/Project.java:100
org.turro.dossier.project.ProjectPhaseWrapper
Definition:
ProjectPhaseWrapper.java:31
org.turro.dossier.project.ProjectPhaseWrapper.ProjectPhaseWrapper
ProjectPhaseWrapper(Project project)
Definition:
ProjectPhaseWrapper.java:35
org.turro.dossier.project.ProjectPhaseWrapper.doChangeTo
PhaseDefinition doChangeTo(PhaseDefinition newPhase)
Definition:
ProjectPhaseWrapper.java:46
org.turro.dossier.project.ProjectPhaseWrapper.doCheckPhase
PhaseDefinition doCheckPhase(Date now)
Definition:
ProjectPhaseWrapper.java:41
org.turro.phase.PhaseDefinition
Definition:
PhaseDefinition.java:36
org.turro.phase.PhaseDefinition.getIndex
int getIndex()
Definition:
PhaseDefinition.java:73
org.turro.phase.PhaseDefinitions
Definition:
PhaseDefinitions.java:39
org.turro.phase.PhaseDefinitions.instance
static PhaseDefinitions instance()
Definition:
PhaseDefinitions.java:132
org.turro.phase.PhaseDefinitions.get
PhaseDefinition get(int index)
Definition:
PhaseDefinitions.java:41
org.turro.phase.Phase
Definition:
Phase.java:29
org.turro.phase.Phase.current
PhaseDefinition current
Definition:
Phase.java:31
TurroProjects
Public
BrightSide
elephant-dossier
src
main
java
org
turro
dossier
project
ProjectPhaseWrapper.java
Generated on Tue Mar 12 2024 07:01:20 for BrightSide by
1.9.1