⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newtaskaction.java

📁 It is all about project scheduling. GanttProject is a tool for creating a project schedule by means
💻 JAVA
字号:
package net.sourceforge.ganttproject.action;import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.KeyEvent;import java.net.URL;import javax.swing.AbstractAction;import javax.swing.Action;import javax.swing.ImageIcon;import javax.swing.KeyStroke;import net.sourceforge.ganttproject.GanttProject;import net.sourceforge.ganttproject.IGanttProject;import net.sourceforge.ganttproject.Mediator;import net.sourceforge.ganttproject.language.GanttLanguage;public class NewTaskAction extends AbstractAction implements        GanttLanguage.Listener {    private final IGanttProject myProject;    public NewTaskAction(IGanttProject project) {        myProject = project;        setText(project.getI18n());        putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_T,                Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));        URL iconUrl = this.getClass().getClassLoader().getResource(                "icons/insert_16.gif");        if (iconUrl != null) {            this.putValue(Action.SMALL_ICON, new ImageIcon(iconUrl));        }        project.getI18n().addListener(this);    }    public void actionPerformed(ActionEvent e) {        Mediator.getUndoManager().undoableEdit("New Task", new Runnable() {            public void run() {                myProject.newTask();            }        });    }    public void languageChanged(GanttLanguage.Event event) {        setText(event.getLanguage());    }    /**     * @param language     */    private void setText(GanttLanguage language) {        this.putValue(AbstractAction.NAME, GanttProject.correctLabel(language                .getText("newTask")));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -