use of org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorActionContributor in project eclipse-integration-commons by spring-projects.
the class EditorToolkit method getContributor.
protected ActionContributorProxy getContributor() {
if (contributor == null) {
IEditorActionBarContributor editorContributor = editorSite.getActionBarContributor();
if (editorContributor instanceof StsTaskEditorActionContributor) {
final StsTaskEditorActionContributor actionContributor = (StsTaskEditorActionContributor) editorContributor;
contributor = new ActionContributorProxy() {
@Override
public void contextMenuAboutToShow(IMenuManager manager, boolean addClipboard) {
actionContributor.contextMenuAboutToShow(manager, addClipboard);
}
@Override
public void forceActionsEnabled() {
actionContributor.forceActionsEnabled();
}
@Override
public ISelectionChangedListener getSelectionChangedListener() {
return actionContributor;
}
@Override
public void updateSelectableActions(ISelection selection) {
actionContributor.updateSelectableActions(selection);
}
};
} else if (editorContributor instanceof TaskEditorActionContributor) {
final TaskEditorActionContributor actionContributor = (TaskEditorActionContributor) editorContributor;
contributor = new ActionContributorProxy() {
@Override
public void contextMenuAboutToShow(IMenuManager manager, boolean addClipboard) {
actionContributor.contextMenuAboutToShow(manager, addClipboard);
}
@Override
public void forceActionsEnabled() {
actionContributor.forceActionsEnabled();
}
@Override
public ISelectionChangedListener getSelectionChangedListener() {
return actionContributor;
}
@Override
public void updateSelectableActions(ISelection selection) {
actionContributor.updateSelectableActions(selection);
}
};
} else {
contributor = new ActionContributorProxy();
}
}
return contributor;
}
Aggregations