/* * Copyright (C) 2006-2007 Gabriel Burca (gburca dash virtmus at ebixio dot com) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package com.ebixio.virtmus.actions; import com.ebixio.virtmus.About; import java.awt.Dialog; import org.openide.DialogDescriptor; import org.openide.DialogDisplayer; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionRegistration; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; @ActionID(id = "com.ebixio.virtmus.actions.AboutAction", category = "Help") @ActionRegistration(displayName = "#CTL_HelpAboutAction", lazy = false) @ActionReference(path = "Menu/Help", position = 102) public final class AboutAction extends CallableSystemAction { @Override public void performAction() { DialogDescriptor dd = new DialogDescriptor(new About(), "About VirtMus", true, null); dd.setOptions(new Object[] {"OK"}); Dialog d = DialogDisplayer.getDefault().createDialog(dd); d.setVisible(true); } @Override public String getName() { return NbBundle.getMessage(AboutAction.class, "CTL_AboutAction"); } @Override protected void initialize() { super.initialize(); // see org.openide.util.actions.SystemAction.iconResource() javadoc for more details putValue("noIconInMenu", Boolean.TRUE); } @Override public HelpCtx getHelpCtx() { return HelpCtx.DEFAULT_HELP; } @Override protected boolean asynchronous() { return false; } }