OmegaT プロジェクト単位で稼働時間を記録します。
package name changed
@@ -0,0 +1,19 @@ | ||
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project xmlns="http://www.netbeans.org/ns/project/1"> | |
3 | + <type>org.netbeans.modules.java.j2seproject</type> | |
4 | + <configuration> | |
5 | + <data xmlns="http://www.netbeans.org/ns/j2se-project/3"> | |
6 | + <name>TimeTracker</name> | |
7 | + <source-roots> | |
8 | + <root id="src.src-stubs.dir"/> | |
9 | + <root id="src.dir"/> | |
10 | + </source-roots> | |
11 | + <test-roots> | |
12 | + <root id="test.src.dir"/> | |
13 | + </test-roots> | |
14 | + </data> | |
15 | + <libraries xmlns="http://www.netbeans.org/ns/ant-project-libraries/1"> | |
16 | + <definitions>.\lib\nblibraries.properties</definitions> | |
17 | + </libraries> | |
18 | + </configuration> | |
19 | +</project> |
@@ -1,5 +1,5 @@ | ||
1 | 1 | Manifest-Version: 1.0 |
2 | 2 | OmegaT-Plugin: true |
3 | 3 | |
4 | -Name: org.omegat.plugin.timetracker.TimeTracker | |
4 | +Name: jp.sourceforge.users.yutang.omegat.plugin.timetracker.TimeTracker | |
5 | 5 | OmegaT-Plugin: base |
\ No newline at end of file |
@@ -1,58 +0,0 @@ | ||
1 | -/************************************************************************** | |
2 | - TimeTracker - allow project basis time tracking. | |
3 | - | |
4 | - Copyright (C) 2013 Yu Tang | |
5 | - Home page: http://sourceforge.jp/users/yu-tang/ | |
6 | - Support center: http://sourceforge.jp/users/yu-tang/pf/ | |
7 | - | |
8 | - This file is part of plugin for OmegaT. | |
9 | - http://www.omegat.org/ | |
10 | - | |
11 | - License: GNU GPL version 3 or (at your option) any later version. | |
12 | - | |
13 | - You should have received a copy of the GNU General Public License | |
14 | - along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | - **************************************************************************/ | |
16 | - | |
17 | -package org.omegat.plugin.timetracker; | |
18 | - | |
19 | -import org.omegat.core.CoreEvents; | |
20 | -import org.omegat.core.events.IApplicationEventListener; | |
21 | -import org.omegat.core.events.IProjectEventListener; | |
22 | -import org.omegat.core.events.IProjectEventListener.PROJECT_CHANGE_TYPE.*; | |
23 | - | |
24 | -/** | |
25 | - * allow project basis time tracking | |
26 | - * | |
27 | - * @author Yu Tang | |
28 | - */ | |
29 | -public class TimeTracker implements IApplicationEventListener, IProjectEventListener { | |
30 | - | |
31 | - @SuppressWarnings("LeakingThisInConstructor") | |
32 | - public TimeTracker() { | |
33 | - CoreEvents.registerApplicationEventListener(this); | |
34 | - CoreEvents.registerProjectChangeListener(this); | |
35 | - } | |
36 | - | |
37 | - @Override | |
38 | - public void onApplicationStartup() { | |
39 | - // do some stuff | |
40 | - } | |
41 | - | |
42 | - @Override | |
43 | - public void onApplicationShutdown() { /* do nothing */ } | |
44 | - | |
45 | - @Override | |
46 | - public void onProjectChanged(PROJECT_CHANGE_TYPE eventType) { | |
47 | - switch (eventType) { | |
48 | - case CREATE: | |
49 | - case LOAD: | |
50 | - // do some stuff | |
51 | - break; | |
52 | - case CLOSE: | |
53 | - // do some stuff | |
54 | - break; | |
55 | - } | |
56 | - } | |
57 | - | |
58 | -} | |
\ No newline at end of file |
@@ -1,36 +0,0 @@ | ||
1 | -/************************************************************************** | |
2 | - TimeTracker - allow project basis time tracking. | |
3 | - | |
4 | - Copyright (C) 2013 Yu Tang | |
5 | - Home page: http://sourceforge.jp/users/yu-tang/ | |
6 | - Support center: http://sourceforge.jp/users/yu-tang/ | |
7 | - | |
8 | - This file is part of plugin for OmegaT. | |
9 | - http://www.omegat.org/ | |
10 | - | |
11 | - License: GNU GPL version 3 or (at your option) any later version. | |
12 | - | |
13 | - You should have received a copy of the GNU General Public License | |
14 | - along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | - **************************************************************************/ | |
16 | - | |
17 | -package org.omegat.plugin.timetracker; | |
18 | - | |
19 | -import javax.swing.JOptionPane; | |
20 | - | |
21 | -/** | |
22 | - * | |
23 | - * @author Yu-Tang | |
24 | - */ | |
25 | -public class VersionInfo { | |
26 | - | |
27 | - private static final String APP_NAME = "TimeTracker"; | |
28 | - private static final String APP_VERSION = "0.0"; | |
29 | - private static final String APP_BUILD = "20131026"; | |
30 | - private static final String APP_AUTHOR = "Yu-Tang"; | |
31 | - | |
32 | - public static void main(String[] args) { | |
33 | - JOptionPane.showMessageDialog(null, | |
34 | - APP_NAME + " ver." + APP_VERSION + "." + APP_BUILD + "\nby " + APP_AUTHOR); | |
35 | - } | |
36 | -} |
@@ -0,0 +1,36 @@ | ||
1 | +/************************************************************************** | |
2 | + TimeTracker - allow project basis time tracking. | |
3 | + | |
4 | + Copyright (C) 2013 Yu Tang | |
5 | + Home page: http://sourceforge.jp/users/yu-tang/ | |
6 | + Support center: http://sourceforge.jp/users/yu-tang/ | |
7 | + | |
8 | + This file is part of plugin for OmegaT. | |
9 | + http://www.omegat.org/ | |
10 | + | |
11 | + License: GNU GPL version 3 or (at your option) any later version. | |
12 | + | |
13 | + You should have received a copy of the GNU General Public License | |
14 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | + **************************************************************************/ | |
16 | + | |
17 | +package jp.sourceforge.users.yutang.omegat.plugin.timetracker; | |
18 | + | |
19 | +import javax.swing.JOptionPane; | |
20 | + | |
21 | +/** | |
22 | + * | |
23 | + * @author Yu-Tang | |
24 | + */ | |
25 | +public class VersionInfo { | |
26 | + | |
27 | + private static final String APP_NAME = "TimeTracker"; | |
28 | + private static final String APP_VERSION = "0.0"; | |
29 | + private static final String APP_BUILD = "20131026"; | |
30 | + private static final String APP_AUTHOR = "Yu-Tang"; | |
31 | + | |
32 | + public static void main(String[] args) { | |
33 | + JOptionPane.showMessageDialog(null, | |
34 | + APP_NAME + " ver." + APP_VERSION + "." + APP_BUILD + "\nby " + APP_AUTHOR); | |
35 | + } | |
36 | +} |
@@ -0,0 +1,60 @@ | ||
1 | +/************************************************************************** | |
2 | + TimeTracker - allow project basis time tracking. | |
3 | + | |
4 | + Copyright (C) 2013 Yu Tang | |
5 | + Home page: http://sourceforge.jp/users/yu-tang/ | |
6 | + Support center: http://sourceforge.jp/users/yu-tang/pf/ | |
7 | + | |
8 | + This file is part of plugin for OmegaT. | |
9 | + http://www.omegat.org/ | |
10 | + | |
11 | + License: GNU GPL version 3 or (at your option) any later version. | |
12 | + | |
13 | + You should have received a copy of the GNU General Public License | |
14 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | + **************************************************************************/ | |
16 | + | |
17 | +package jp.sourceforge.users.yutang.omegat.plugin.timetracker; | |
18 | + | |
19 | +import org.omegat.core.CoreEvents; | |
20 | +import org.omegat.core.events.IApplicationEventListener; | |
21 | +import org.omegat.core.events.IProjectEventListener; | |
22 | +import org.omegat.core.events.IProjectEventListener.PROJECT_CHANGE_TYPE.*; | |
23 | + | |
24 | +/** | |
25 | + * allow project basis time tracking | |
26 | + * | |
27 | + * @author Yu Tang | |
28 | + */ | |
29 | +public class TimeTracker implements IApplicationEventListener, IProjectEventListener { | |
30 | + | |
31 | + private Setting setting; | |
32 | + | |
33 | + @SuppressWarnings("LeakingThisInConstructor") | |
34 | + public TimeTracker() { | |
35 | + CoreEvents.registerApplicationEventListener(this); | |
36 | + CoreEvents.registerProjectChangeListener(this); | |
37 | + } | |
38 | + | |
39 | + @Override | |
40 | + public void onApplicationStartup() { | |
41 | + setting = new Setting(); | |
42 | + } | |
43 | + | |
44 | + @Override | |
45 | + public void onApplicationShutdown() { /* do nothing */ } | |
46 | + | |
47 | + @Override | |
48 | + public void onProjectChanged(PROJECT_CHANGE_TYPE eventType) { | |
49 | + switch (eventType) { | |
50 | + case CREATE: | |
51 | + case LOAD: | |
52 | + // do some stuff | |
53 | + break; | |
54 | + case CLOSE: | |
55 | + // do some stuff | |
56 | + break; | |
57 | + } | |
58 | + } | |
59 | + | |
60 | +} | |
\ No newline at end of file |
@@ -0,0 +1,58 @@ | ||
1 | +/************************************************************************** | |
2 | + TimeTracker - allow project basis time tracking. | |
3 | + | |
4 | + Copyright (C) 2013 Yu Tang | |
5 | + Home page: http://sourceforge.jp/users/yu-tang/ | |
6 | + Support center: http://sourceforge.jp/users/yu-tang/ | |
7 | + | |
8 | + This file is part of plugin for OmegaT. | |
9 | + http://www.omegat.org/ | |
10 | + | |
11 | + License: GNU GPL version 3 or (at your option) any later version. | |
12 | + | |
13 | + You should have received a copy of the GNU General Public License | |
14 | + along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | + **************************************************************************/ | |
16 | + | |
17 | +package jp.sourceforge.users.yutang.omegat.plugin.timetracker; | |
18 | + | |
19 | +import java.awt.event.ActionEvent; | |
20 | +import java.awt.event.ActionListener; | |
21 | +import javax.swing.JMenu; | |
22 | +import javax.swing.JMenuItem; | |
23 | +import javax.swing.SwingUtilities; | |
24 | +import org.omegat.core.Core; | |
25 | +import org.openide.awt.Mnemonics; | |
26 | + | |
27 | +/** | |
28 | + * | |
29 | + * @author Yu-Tang | |
30 | + */ | |
31 | +public class Setting implements ActionListener { | |
32 | + | |
33 | + JMenuItem menuItem; | |
34 | + | |
35 | + public Setting() { | |
36 | + // add item to options menu | |
37 | + menuItem = createLocalizedMenuItem("Time Tracker..."); | |
38 | + JMenu toolsMenu = Core.getMainWindow().getMainMenu().getOptionsMenu(); | |
39 | + toolsMenu.add(menuItem); | |
40 | + SwingUtilities.invokeLater(new Runnable() { | |
41 | + @Override | |
42 | + public void run() { | |
43 | + menuItem.addActionListener(Setting.this); | |
44 | + } | |
45 | + }); | |
46 | + } | |
47 | + | |
48 | + private JMenuItem createLocalizedMenuItem(String labelString) { | |
49 | + JMenuItem m = new JMenuItem(); | |
50 | + Mnemonics.setLocalizedText(m, labelString); | |
51 | + return m; | |
52 | + } | |
53 | + | |
54 | + @Override | |
55 | + public void actionPerformed(ActionEvent e) { | |
56 | + // do setting action | |
57 | + } | |
58 | +} | |
\ No newline at end of file |