use of org.eclipse.ui.texteditor.RetargetTextEditorAction in project eclipse.platform.text by eclipse.
the class EncodingActionGroup method fillActionBars.
@Override
public void fillActionBars(IActionBars actionBars) {
IMenuManager menuManager = actionBars.getMenuManager();
IMenuManager editMenu = menuManager.findMenuUsingPath(IWorkbenchActionConstants.M_EDIT);
if (editMenu != null && fRetargetActions.size() > 0) {
MenuManager subMenu = new MenuManager(TextEditorMessages.Editor_ConvertEncoding_submenu_label);
subMenu.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
update();
}
});
Iterator<RetargetTextEditorAction> e = fRetargetActions.iterator();
subMenu.add(e.next());
subMenu.add(new Separator());
while (e.hasNext()) subMenu.add(e.next());
editMenu.add(subMenu);
}
}
use of org.eclipse.ui.texteditor.RetargetTextEditorAction in project eclipse.platform.text by eclipse.
the class EncodingActionGroup method retarget.
/**
* Retargets this action group to the given editor.
*
* @param editor the text editor to which the group should be retargeted
*/
public void retarget(ITextEditor editor) {
fTextEditor = editor;
Iterator<RetargetTextEditorAction> e = fRetargetActions.iterator();
while (e.hasNext()) {
RetargetTextEditorAction a = e.next();
a.setAction(editor == null ? null : editor.getAction(a.getId()));
}
}
use of org.eclipse.ui.texteditor.RetargetTextEditorAction in project dbeaver by dbeaver.
the class SQLEditorContributor method createActions.
private void createActions() {
// Init custom actions
ResourceBundle bundle = DBeaverActivator.getCoreResourceBundle();
contentAssistProposal = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_PROPOSAL));
contentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
contentFormatProposal = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_FORMAT_PROPOSAL));
contentFormatProposal.setActionDefinitionId(CoreCommands.CMD_CONTENT_FORMAT);
contentAssistTip = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_TIP));
contentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
contentAssistInformation = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_INFORMATION));
contentAssistInformation.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_INFORMATION);
}
use of org.eclipse.ui.texteditor.RetargetTextEditorAction in project dbeaver by serge-rider.
the class SQLEditorContributor method createActions.
private void createActions() {
// Init custom actions
ResourceBundle bundle = ResourceBundle.getBundle(SQLEditorMessages.BUNDLE_NAME);
contentAssistProposal = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_PROPOSAL));
contentAssistProposal.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
contentFormatProposal = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_FORMAT_PROPOSAL));
contentFormatProposal.setActionDefinitionId(BaseTextEditorCommands.CMD_CONTENT_FORMAT);
contentAssistTip = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_TIP));
contentAssistTip.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
contentAssistInformation = new RetargetTextEditorAction(bundle, getActionResourcePrefix(ACTION_CONTENT_ASSIST_INFORMATION));
contentAssistInformation.setActionDefinitionId(ITextEditorActionDefinitionIds.SHOW_INFORMATION);
}
Aggregations