[Jsxe-cvs] SF.net SVN: jsxe: [1117] trunk/jsxe/messages
Status: Inactive
Brought to you by:
ian_lewis
From: <ian...@us...> - 2006-08-08 02:54:03
|
Revision: 1117 Author: ian_lewis Date: 2006-08-07 19:53:51 -0700 (Mon, 07 Aug 2006) ViewCVS: http://svn.sourceforge.net/jsxe/?rev=1117&view=rev Log Message: ----------- Updated actions Modified Paths: -------------- trunk/jsxe/messages/messages trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java Added Paths: ----------- trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java Modified: trunk/jsxe/messages/messages =================================================================== --- trunk/jsxe/messages/messages 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/messages/messages 2006-08-08 02:53:51 UTC (rev 1117) @@ -20,13 +20,6 @@ common.remove=Remove common.moveUp=Move Up common.moveDown=Move Down -common.cut=Cut -common.copy=Copy -common.paste=Paste -common.find=Find -common.findnext=Find Next -common.undo=Undo -common.redo=Redo common.ctrl=Ctrl common.alt=Alt @@ -158,6 +151,11 @@ close-all.label=Close All exit.label=Exit +undo.label=Undo +redo.label=Redo +cut.label=Cut +copy.label=Copy +paste.label=Paste find.label=Find... findnext.label=Find Next Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/CopyAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -53,25 +53,11 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class CopyAction extends LocalizedAction { +public class CopyAction extends ViewSpecificAction { //{{{ CopyAction constructor public CopyAction() { super("copy"); }//}}} - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.copy"); - }//}}} - - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.copy if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".copy", evt); - }//}}} - } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/CutAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -52,25 +52,11 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class CutAction extends LocalizedAction { +public class CutAction extends ViewSpecificAction { //{{{ CutAction constructor public CutAction() { super("cut"); }//}}} - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.cut"); - }//}}} - - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.cut if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".cut", evt); - }//}}} - } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/FindAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -53,20 +53,11 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class FindAction extends LocalizedAction { +public class FindAction extends ViewSpecificAction { //{{{ FindAction constructor public FindAction() { super("find"); }//}}} - - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.find if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".find", evt); - }//}}} } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/FindNextAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -53,20 +53,11 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class FindNextAction extends LocalizedAction { +public class FindNextAction extends ViewSpecificAction { //{{{ FindNextAction constructor public FindNextAction() { super("findnext"); }//}}} - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.findnext if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".findnext", evt); - }//}}} - } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/PasteAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -53,25 +53,11 @@ * @version $Id$ * @since jsXe 0.5 pre1 */ -public class PasteAction extends LocalizedAction { +public class PasteAction extends ViewSpecificAction { //{{{ PasteAction constructor public PasteAction() { super("paste"); }//}}} - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.paste"); - }//}}} - - //{{{ invoke() - public void invoke(TabbedView view, ActionEvent evt) { - /* - invoke the action registered for the current DocumentView named - viewname.paste if there is one. - */ - ActionManager.invokeAction(jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+".paste", evt); - }//}}} - } Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/RedoAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -60,11 +60,6 @@ super("redo"); }//}}} - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.redo"); - }//}}} - //{{{ invoke() public void invoke(TabbedView view, ActionEvent evt) { view.getDocumentBuffer().redo(); Modified: trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java 2006-08-08 00:19:21 UTC (rev 1116) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/UndoAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -59,11 +59,6 @@ super("undo"); }//}}} - //{{{ getLabel() - public String getLabel() { - return Messages.getMessage("common.undo"); - }//}}} - //{{{ invoke() public void invoke(TabbedView view, ActionEvent evt) { view.getDocumentBuffer().undo(); Added: trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java =================================================================== --- trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java (rev 0) +++ trunk/jsxe/src/net/sourceforge/jsxe/action/ViewSpecificAction.java 2006-08-08 02:53:51 UTC (rev 1117) @@ -0,0 +1,81 @@ +/* +ViewSpecificAction.java +:tabSize=4:indentSize=4:noTabs=true: +:folding=explicit:collapseFolds=1: + +Copyright (C) 2006 Ian Lewis (Ian...@me...) + +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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Optionally, you may find a copy of the GNU General Public License +from http://www.fsf.org/copyleft/gpl.txt +*/ + +package net.sourceforge.jsxe.action; + +//{{{ imports + +//{{{ jsXe classes +import net.sourceforge.jsxe.jsXe; +import net.sourceforge.jsxe.JARClassLoader; +import net.sourceforge.jsxe.ActionManager; +import net.sourceforge.jsxe.LocalizedAction; +import net.sourceforge.jsxe.gui.TabbedView; +import net.sourceforge.jsxe.gui.Messages; +//}}} + +//{{{ Java classes +import java.io.IOException; +//}}} + +//{{{ AWT components +import java.awt.event.ActionEvent; +//}}} + +//}}} + +/** + * The ViewSpecificAction is a class that defines actions that are + * view specific. i.e. Actions that are defined by jsXe but whose + * implementation is determined by the currently active view. + * + * @author Ian Lewis (<a href="mailto:Ian...@me...">Ian...@me...</a>) + * @version $Id$ + * @since jsXe 0.5 pre3 + */ +public abstract class ViewSpecificAction extends LocalizedAction { + + //{{{ ViewSpecificAction constructor + public ViewSpecificAction(String name) { + super(name); + }//}}} + + //{{{ invoke() + public void invoke(TabbedView view, ActionEvent evt) { + /* + invoke the action registered for the current DocumentView named + viewname.actionname if there is one. + */ + ActionManager.invokeAction(getViewActionName(view), evt); + }//}}} + + //{{{ getViewActionName() + /** + * Gets the view specific action name for the current DocumentView in the + * given TabbedView. + */ + private String getViewActionName(TabbedView view) { + return jsXe.getPluginLoader().getPluginProperty(view.getDocumentView().getViewPlugin(), JARClassLoader.PLUGIN_NAME)+"."+getName(); + }//}}} +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |