BrightSide Workbench Full Report + Source Code
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2013 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.plugin.command;
20
21
import
java.util.Collection;
22
import
java.util.Date;
23
import
java.util.HashMap;
24
import
java.util.Map;
25
import
org.turro.action.DefaultPlugin;
26
import
org.turro.action.Plugins;
27
import
org.turro.plugin.contacts.IContact;
28
33
public
abstract
class
CalendarEventPlugin
extends
DefaultPlugin
{
34
35
public
static
final
int
36
CREATE
= 1,
// click or drag on empty cell
37
EDIT = 2,
// click on occupied cell
38
UPDATE = 3;
// drag on occupied cell
39
40
@Override
41
public
String
getName
() {
42
return
"CalendarEvent"
;
43
}
44
45
@Override
46
public
boolean
stopPropagating
() {
47
return
false
;
48
}
49
50
public
IContact
getContact
() {
51
return
(
IContact
)
params
.get(
"contact"
);
52
}
53
54
public
Date
getOldFrom
() {
55
return
(Date)
params
.get(
"oldFrom"
);
56
}
57
58
public
Date
getOldTo
() {
59
return
(Date)
params
.get(
"oldTo"
);
60
}
61
62
public
Date
getFrom
() {
63
return
(Date)
params
.get(
"from"
);
64
}
65
66
public
Date
getTo
() {
67
return
(Date)
params
.get(
"to"
);
68
}
69
70
public
String
getPath
() {
71
return
(String)
params
.get(
"path"
);
72
}
73
74
public
Integer
getMode
() {
75
return
(Integer)
params
.get(
"mode"
);
76
}
77
78
@Override
79
public
void
execute
() {
80
executePlugin
();
81
}
82
83
protected
abstract
void
executePlugin
();
84
85
public
static
Collection<Object>
getCalendarEventFor
(
IContact
contact,
86
Date oldFrom, Date oldTo, Date from, Date to, String path,
int
mode) {
87
Map<String, Object> args =
new
HashMap<>();
88
args.put(
"contact"
, contact);
89
args.put(
"oldFrom"
, oldFrom);
90
args.put(
"oldTo"
, oldTo);
91
args.put(
"from"
, from);
92
args.put(
"to"
, to);
93
args.put(
"path"
, path);
94
args.put(
"mode"
, mode);
95
args =
Plugins
.
execute
(
"CalendarEvent"
, args);
96
return
args.values();
97
}
98
99
}
100
org.turro.action.DefaultPlugin
Definition:
DefaultPlugin.java:27
org.turro.action.Plugins
Definition:
Plugins.java:36
org.turro.action.Plugins.execute
static Map< String, Object > execute(String name, Map params)
Definition:
Plugins.java:44
org.turro.plugin.command.CalendarEventPlugin
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:33
org.turro.plugin.command.CalendarEventPlugin.stopPropagating
boolean stopPropagating()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:46
org.turro.plugin.command.CalendarEventPlugin.getName
String getName()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:41
org.turro.plugin.command.CalendarEventPlugin.getContact
IContact getContact()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:50
org.turro.plugin.command.CalendarEventPlugin.getPath
String getPath()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:70
org.turro.plugin.command.CalendarEventPlugin.executePlugin
abstract void executePlugin()
org.turro.plugin.command.CalendarEventPlugin.params
Map< String, Object > params
Definition:
elephant-plugins/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:43
org.turro.plugin.command.CalendarEventPlugin.getFrom
Date getFrom()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:62
org.turro.plugin.command.CalendarEventPlugin.getTo
Date getTo()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:66
org.turro.plugin.command.CalendarEventPlugin.CREATE
static final int CREATE
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:36
org.turro.plugin.command.CalendarEventPlugin.getOldTo
Date getOldTo()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:58
org.turro.plugin.command.CalendarEventPlugin.execute
void execute()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:79
org.turro.plugin.command.CalendarEventPlugin.getOldFrom
Date getOldFrom()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:54
org.turro.plugin.command.CalendarEventPlugin.getCalendarEventFor
static Collection< Object > getCalendarEventFor(IContact contact, Date oldFrom, Date oldTo, Date from, Date to, String path, int mode)
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:85
org.turro.plugin.command.CalendarEventPlugin.getMode
Integer getMode()
Definition:
elephant/src/main/java/org/turro/plugin/command/CalendarEventPlugin.java:74
org.turro.plugin.contacts.IContact
Definition:
elephant/src/main/java/org/turro/plugin/contacts/IContact.java:33
TurroProjects
Public
Elephant
elephant
src
main
java
org
turro
plugin
command
CalendarEventPlugin.java
Generated on Tue Mar 12 2024 07:01:18 for BrightSide by
1.9.1