eclipse plugin: An attempt to add the usual Save, Undo, Redo, etc...
...buttons on the product's toolbar
This commit is contained in:
parent
8cb38e533e
commit
260f91bb92
2 changed files with 46 additions and 4 deletions
|
@ -691,9 +691,6 @@
|
|||
name="Wesnoth">
|
||||
</perspective>
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.perspectiveExtensions">
|
||||
</extension>
|
||||
<extension
|
||||
point="org.eclipse.ui.elementFactories">
|
||||
<factory
|
||||
|
@ -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
|
||||
|
|
|
@ -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 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor
|
|||
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 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor
|
|||
// 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
|
||||
|
|
Loading…
Add table
Reference in a new issue