Author: timotei
Date: Sun May 22 22:13:29 2011
New Revision: 49628
URL: http://svn.gna.org/viewcvs/wesnoth?rev=49628&view=rev
Log:
eclipse plugin: An attempt to add the usual
Save, Undo, Redo, etc buttons on the product's
toolbar
Modified:
trunk/utils/java/org.wesnoth/plugin.xml
trunk/utils/java/org.wesnoth/src/org/wesnoth/product/ApplicationActionBarAdvisor.java
Modified: trunk/utils/java/org.wesnoth/plugin.xml
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/org.wesnoth/plugin.xml?rev=49628&r1=49627&r2=49628&view=diff
==============================================================================
--- trunk/utils/java/org.wesnoth/plugin.xml (original)
+++ trunk/utils/java/org.wesnoth/plugin.xml Sun May 22 22:13:29 2011
@@ -692,9 +692,6 @@
</perspective>
</extension>
<extension
- point="org.eclipse.ui.perspectiveExtensions">
- </extension>
- <extension
point="org.eclipse.ui.elementFactories">
<factory
class="org.wesnoth.navigator.WesnothProjectsExplorer"
@@ -741,6 +738,7 @@
value="true">
</persistent>
</extension>
+ <!--
<extension
point="org.eclipse.ui.activities">
<activity
@@ -778,7 +776,6 @@
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.mylyn.tasks.ui.bug.report.*"> </activityPatternBinding>
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.ui.actions.showKeyAssistHandler.*">
</activityPatternBinding>
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.ui.cheatsheets.actions.CheatSheetHelpMenuAction.*">
</activityPatternBinding>
- <!-- This is for real now. I'm really pissed off. Disable the WHOLE
plugin -->
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.mylyn.task.*"> </activityPatternBinding>
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.jdt.*"> </activityPatternBinding>
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.xtend.*"> </activityPatternBinding>
@@ -788,6 +785,7 @@
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.search.*"> </activityPatternBinding>
<activityPatternBinding activityId="org.wesnoth.product.disableextra"
pattern=".*/org.eclipse.ant.*"> </activityPatternBinding>
</extension>
+ -->
<extension
point="org.eclipse.ui.startup">
<startup
Modified:
trunk/utils/java/org.wesnoth/src/org/wesnoth/product/ApplicationActionBarAdvisor.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/java/org.wesnoth/src/org/wesnoth/product/ApplicationActionBarAdvisor.java?rev=49628&r1=49627&r2=49628&view=diff
==============================================================================
---
trunk/utils/java/org.wesnoth/src/org/wesnoth/product/ApplicationActionBarAdvisor.java
(original)
+++
trunk/utils/java/org.wesnoth/src/org/wesnoth/product/ApplicationActionBarAdvisor.java
Sun May 22 22:13:29 2011
@@ -8,7 +8,11 @@
*******************************************************************************/
package org.wesnoth.product;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -26,9 +30,13 @@
private IWorkbenchAction prefAction_;
private IWorkbenchAction newWizardDropDownAction_;
+ private List<IWorkbenchAction> coolBarActions_;
+
public ApplicationActionBarAdvisor(IActionBarConfigurer configurer)
{
super(configurer);
+
+ coolBarActions_ = new ArrayList<IWorkbenchAction>();
}
@Override
@@ -47,6 +55,42 @@
// help menu
aboutAction_ = ActionFactory.ABOUT.create(window);
register(aboutAction_);
+
+ coolBarActions_.add(register(ActionFactory.UNDO.create(window)));
+ coolBarActions_.add(register(ActionFactory.REDO.create(window)));
+
+ coolBarActions_.add(register(ActionFactory.SAVE.create(window)));
+ coolBarActions_.add(register(ActionFactory.SAVE_AS.create(window)));
+ coolBarActions_.add(register(ActionFactory.SAVE_ALL.create(window)));
+
+ coolBarActions_.add(register(ActionFactory.COPY.create(window)));
+ coolBarActions_.add(register(ActionFactory.CUT.create(window)));
+ coolBarActions_.add(register(ActionFactory.PASTE.create(window)));
+
+ coolBarActions_.add(register(ActionFactory.FIND.create(window)));
+
+ coolBarActions_.add(register(ActionFactory.BACK.create(window)));
+
coolBarActions_.add(register(ActionFactory.BACKWARD_HISTORY.create(window)));
+ coolBarActions_.add(register(ActionFactory.FORWARD.create(window)));
+
coolBarActions_.add(register(ActionFactory.FORWARD_HISTORY.create(window)));
+
+ coolBarActions_.add(register(ActionFactory.PRINT.create(window)));
+ }
+
+ private IWorkbenchAction register(IWorkbenchAction action)
+ {
+ super.register(action);
+ return action;
+ }
+
+ @Override
+ protected void fillCoolBar(ICoolBarManager coolBar)
+ {
+ IActionBarConfigurer config = getActionBarConfigurer();
+ System.out.println(config.toString());
+ for(IWorkbenchAction action : coolBarActions_){
+ coolBar.add(action);
+ }
}
@Override
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits