Commit 86377c0d authored by Johannes Roith's avatar Johannes Roith

Remove examples menus/buttons from MultiPageEditorContributor.

parent 79cd1699
......@@ -14,39 +14,18 @@ import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.ui.texteditor.ITextEditorActionConstants;
import org.eclipse.zest.core.viewers.ZoomContributionViewItem;
/**
* Manages the installation/deinstallation of global actions for multi-page
* editors. Responsible for the redirection of global actions to the active
* editor. Multi-page contributor replaces the contributors for the individual
* editors in the multi-page editor.
*/
public class MultiPageEditorContributor extends
MultiPageEditorActionBarContributor {
private IEditorPart activeEditorPart;
private Action sampleAction;
/**
* Creates a multi-page contributor.
*/
public MultiPageEditorContributor() {
super();
createActions();
}
/**
* Returns the action registed with the given text editor.
*
* @return IAction or null if editor is null.
*/
protected IAction getAction(ITextEditor editor, String actionID) {
return (editor == null ? null : editor.getAction(actionID));
}
/*
* (non-JavaDoc) Method declared in
* AbstractMultiPageEditorActionBarContributor.
*/
public void setActivePage(IEditorPart part) {
if (activeEditorPart == part)
return;
......@@ -82,28 +61,4 @@ public class MultiPageEditorContributor extends
}
}
private void createActions() {
sampleAction = new Action() {
public void run() {
MessageDialog.openInformation(null, "CupPlugin",
"Sample Action Executed");
}
};
sampleAction.setText("Sample Action");
sampleAction.setToolTipText("Sample Action tool tip");
sampleAction.setImageDescriptor(PlatformUI.getWorkbench()
.getSharedImages()
.getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK));
}
public void contributeToMenu(IMenuManager manager) {
IMenuManager menu = new MenuManager("Editor &Menu");
manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu);
menu.add(sampleAction);
}
public void contributeToToolBar(IToolBarManager manager) {
manager.add(new Separator());
manager.add(sampleAction);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment