本文整理汇总了Java中org.eclipse.ui.actions.RetargetAction类的典型用法代码示例。如果您正苦于以下问题:Java RetargetAction类的具体用法?Java RetargetAction怎么用?Java RetargetAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RetargetAction类属于org.eclipse.ui.actions包,在下文中一共展示了RetargetAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/**
* Create actions managed by this contributor.
*
* @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
*/
protected void buildActions() {
addRetargetAction(new DeleteRetargetAction());
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
IWorkbenchWindow iww = getPage().getWorkbenchWindow();
addRetargetAction((RetargetAction)ActionFactory.COPY.create(iww));
addRetargetAction((RetargetAction)ActionFactory.PASTE.create(iww));
// Registering the zooming actions at the menu bar.
addRetargetAction(new ZoomInRetargetAction());
addRetargetAction(new ZoomOutRetargetAction());
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY,
GEFMessages.ToggleGrid_Label, IAction.AS_CHECK_BOX));
}
示例2: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/**
* Builds the actions.
*
* @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
*/
protected void buildActions(IActionBars bars) {
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
// addRetargetAction(new PrintAction());
addRetargetAction(new ZoomInRetargetAction());
addRetargetAction(new ZoomOutRetargetAction());
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_RULER_VISIBILITY,
Messages.JrxmlEditorContributor_show_ruler, IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(SnapToGuidesAction.ID, Messages.common_snap_to_guides, IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, Messages.common_show_grid,
IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY, Messages.common_snap_to_geometry,
IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(SnapToGridAction.ID, Messages.common_snap_to_grid, IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(SizeGridAction.ID, Messages.JrxmlEditorContributor_grid_size));
List<RetargetAction> ractions = JaspersoftStudioPlugin.getDecoratorManager().buildMenuActions();
for (RetargetAction r : ractions)
addRetargetAction(r);
}
示例3: create
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
@Override
public IWorkbenchAction create(IWorkbenchWindow window) {
if (window == null) {
throw new IllegalArgumentException();
}
String string = "Add " + EPlanUtils.getActivityGroupDisplayName();
String description = "This action will add a new "
+ EPlanUtils.getActivityGroupDisplayName()
+ " to the plan.";
RetargetAction action = new RetargetAction(getId(), string);
action.setToolTipText(string);
action.setDescription(description);
window.getPartService().addPartListener(action);
action.setActionDefinitionId("gov.nasa.ensemble.core.plan.editor.newActivityGroupAction"); //$NON-NLS-1$
action.setImageDescriptor(new ImageDescriptor() {
@Override
public ImageData getImageData() {
return ADD_GROUP_ICON;
}
});
return action;
}
示例4: BasicCompilationUnitEditorActionContributor
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
public BasicCompilationUnitEditorActionContributor() {
fRetargetContentAssist= new RetargetAction(JdtActionConstants.CONTENT_ASSIST, JavaEditorMessages.ContentAssistProposal_label);
fRetargetContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
fRetargetContentAssist.setImageDescriptor(JavaPluginImages.DESC_ELCL_CODE_ASSIST);
fRetargetContentAssist.setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_CODE_ASSIST);
markAsPartListener(fRetargetContentAssist);
fContentAssist= new RetargetTextEditorAction(JavaEditorMessages.getBundleForConstructedKeys(), "ContentAssistProposal."); //$NON-NLS-1$
fContentAssist.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
fContentAssist.setImageDescriptor(JavaPluginImages.DESC_ELCL_CODE_ASSIST);
fContentAssist.setDisabledImageDescriptor(JavaPluginImages.DESC_DLCL_CODE_ASSIST);
fContextInformation= new RetargetTextEditorAction(JavaEditorMessages.getBundleForConstructedKeys(), "ContentAssistContextInformation."); //$NON-NLS-1$
fContextInformation.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION);
fQuickAssistAction= new RetargetTextEditorAction(JavaEditorMessages.getBundleForConstructedKeys(), "CorrectionAssistProposal."); //$NON-NLS-1$
fQuickAssistAction.setActionDefinitionId(ITextEditorActionDefinitionIds.QUICK_ASSIST);
fChangeEncodingAction= new RetargetTextEditorAction(JavaEditorMessages.getBundleForConstructedKeys(), "Editor.ChangeEncodingAction."); //$NON-NLS-1$
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:BasicCompilationUnitEditorActionContributor.java
示例5: init
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void init(IWorkbenchWindow window) {
disposeSubmenuActions(); // paranoia code: double initialization should not happen
if (window != null) {
fPartService= window.getPartService();
if (fPartService != null) {
fRetargetActions= new RetargetAction[] {
createSubmenuAction(fPartService, JdtActionConstants.FIND_OCCURRENCES_IN_FILE, ActionMessages.OccurrencesSearchMenuAction_occurrences_in_file_label, IJavaEditorActionDefinitionIds.SEARCH_OCCURRENCES_IN_FILE),
createSubmenuAction(fPartService, JdtActionConstants.FIND_IMPLEMENT_OCCURRENCES, ActionMessages.OccurrencesSearchMenuAction_implementing_methods_label, IJavaEditorActionDefinitionIds.SEARCH_IMPLEMENT_OCCURRENCES_IN_FILE),
createSubmenuAction(fPartService, JdtActionConstants.FIND_EXCEPTION_OCCURRENCES, ActionMessages.OccurrencesSearchMenuAction_throwing_exception_label, IJavaEditorActionDefinitionIds.SEARCH_EXCEPTION_OCCURRENCES_IN_FILE),
createSubmenuAction(fPartService, JdtActionConstants.FIND_METHOD_EXIT_OCCURRENCES, ActionMessages.OccurrencesSearchMenuAction_method_exits_label, IJavaEditorActionDefinitionIds.SEARCH_METHOD_EXIT_OCCURRENCES),
createSubmenuAction(fPartService, JdtActionConstants.FIND_BREAK_CONTINUE_TARGET_OCCURRENCES, ActionMessages.OccurrencesSearchMenuAction_break_continue_target_label, IJavaEditorActionDefinitionIds.SEARCH_BREAK_CONTINUE_TARGET_OCCURRENCES)
};
}
}
}
示例6: updateActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
private void updateActions() {
IWorkbenchPart activePart= JavaPlugin.getActivePage().getActivePart();
if (!(activePart instanceof JavaEditor))
return;
ISelection javaSelection= getEditorSelection((JavaEditor) activePart);
if (javaSelection == null)
return;
for (int i= 0; i < fRetargetActions.length; i++) {
RetargetAction action= fRetargetActions[i];
IAction actionHandler= action.getActionHandler();
if (actionHandler instanceof SelectionDispatchAction) {
((SelectionDispatchAction) actionHandler).update(javaSelection);
}
}
}
示例7: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected void buildActions() {
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
// add grid icon to grid action
final RetargetAction gridAction =
new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, "", IAction.AS_CHECK_BOX);
gridAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/grid.png"));
gridAction.setToolTipText(TOGGLE_GRID_LABEL);
addRetargetAction(gridAction);
final RetargetAction snapAction =
new RetargetAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY, "", IAction.AS_CHECK_BOX);
snapAction.setImageDescriptor(Activator.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/grid-snap.png"));
snapAction.setToolTipText(TOGGLE_SNAP_TO_GERMETRY_LABEL);
addRetargetAction(snapAction);
}
示例8: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
@Override
protected void buildActions()
{
this.addRetargetAction(new RetargetAction(ActionFactory.SELECT_ALL
.getId(), "selectAll"));
this.addRetargetAction(new UndoRetargetAction());
this.addRetargetAction(new RedoRetargetAction());
this.addRetargetAction(new DeleteRetargetAction());
ZoomInRetargetAction zoomInAction = new ZoomInRetargetAction();
zoomInAction.setImageDescriptor(Activator
.getImageDescriptor(ImageResource.ZOOM_IN));
ZoomOutRetargetAction zoomOutAction = new ZoomOutRetargetAction();
zoomOutAction.setImageDescriptor(Activator
.getImageDescriptor(ImageResource.ZOOM_OUT));
this.addRetargetAction(zoomInAction);
this.addRetargetAction(zoomOutAction);
this.addRetargetAction(new ZoomAdjustRetargetAction());
}
示例9: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
@Override
protected void buildActions() {
IWorkbenchWindow iww = getPage().getWorkbenchWindow();
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
addRetargetAction(new ZoomInRetargetAction());
addRetargetAction(new ZoomOutRetargetAction());
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, GEFMessages.ToggleGrid_Label, IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY, GEFMessages.ToggleSnapToGeometry_Label, IAction.AS_CHECK_BOX));
addRetargetAction(new RetargetAction(ActionFactory.SELECT_ALL.getId(), GEFMessages.SelectAllAction_Label));
addRetargetAction((RetargetAction)ActionFactory.COPY.create(iww));
addRetargetAction((RetargetAction)ActionFactory.PASTE.create(iww));
addRetargetAction(new ClearEdgeBenpointLayoutRetargetAction(iww));
}
示例10: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
private void buildActions(IActionBars actionBars) {
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
RetargetAction showGridAction=new RetargetAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY, "Grid");
showGridAction.setImageDescriptor(Activator.getImageDescriptorFromPlugin("icons/grid.png"));
addRetargetAction(showGridAction);
}
示例11: dispose
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
@Override
public void dispose() {
String[] keys = actionMap.keySet().toArray(new String[actionMap.keySet().size()]);
for (int i = 0; i < keys.length; i++) {
RetargetAction action = (RetargetAction) actionMap.get(keys[i]);
getPage().removePartListener(action);
action.dispose();
}
actionMap.clear();
actionMap = null;
}
示例12: initRetargetActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
public void initRetargetActions(final EditorPart newEditor) {
final Iterator iter = getActionRegistry().getActions();
while (iter.hasNext()) {
final IAction action = (IAction) iter.next();
if (action instanceof RetargetAction) {
((RetargetAction) action).partActivated(newEditor);
}
}
}
示例13: initRetargetActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
public void initRetargetActions(EditorPart newEditor) {
Iterator iter = this.getActionRegistry().getActions();
while (iter.hasNext()) {
IAction action = (IAction) iter.next();
if (action instanceof RetargetAction) {
((RetargetAction) action).partActivated(newEditor);
}
}
}
示例14: buildActions
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/**
* Builds the actions.
*
* @see org.eclipse.gef.ui.actions.ActionBarContributor#buildActions()
*/
protected void buildActions() {
addRetargetAction(new UndoRetargetAction());
addRetargetAction(new RedoRetargetAction());
addRetargetAction(new DeleteRetargetAction());
addRetargetAction(new ZoomInRetargetAction());
addRetargetAction(new ZoomOutRetargetAction());
RetargetAction raction = new RetargetAction(ExportJar.ID, "Export Chart Theme jar");
raction.setImageDescriptor(Activator.getDefault().getImageDescriptor("icons/charttheme_export-16.png"));
addRetargetAction(raction);
}
示例15: addRetargetAction
import org.eclipse.ui.actions.RetargetAction; //导入依赖的package包/类
/**
* Adds the retarded actions.
*
* @param action
* The action to add
*/
protected void addRetargetAction(RetargetAction action) {
addAction(action);
retargetActions.add(action);
getPage().addPartListener(action);
addGlobalActionKey(action.getId());
}