当前位置: 首页>>代码示例>>Java>>正文


Java RetargetAction类代码示例

本文整理汇总了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));
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:22,代码来源:GUIEditorActionBarContributor.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:30,代码来源:JrxmlEditorContributor.java

示例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;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:PlanActionFactory.java

示例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)
			};
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:OccurrencesSearchMenuAction.java

示例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);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:OccurrencesSearchMenuAction.java

示例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);

}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:25,代码来源:ORMGraphicalEditorActionBarContributor.java

示例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());
	
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:21,代码来源:BODiagramActionBarContributor.java

示例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));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:GW4EEditorActionBarContributor.java

示例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);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:10,代码来源:EditorActionBarContributor.java

示例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;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:12,代码来源:EditorActionBarContributor.java

示例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);
        }
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:11,代码来源:ERDiagramActionBarContributor.java

示例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);
		}
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:11,代码来源:ERDiagramActionBarContributor.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:JrctxEditorContributor.java

示例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());
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:JrctxEditorContributor.java


注:本文中的org.eclipse.ui.actions.RetargetAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。