當前位置: 首頁>>代碼示例>>Java>>正文


Java IActionBars.setGlobalActionHandler方法代碼示例

本文整理匯總了Java中org.eclipse.ui.IActionBars.setGlobalActionHandler方法的典型用法代碼示例。如果您正苦於以下問題:Java IActionBars.setGlobalActionHandler方法的具體用法?Java IActionBars.setGlobalActionHandler怎麽用?Java IActionBars.setGlobalActionHandler使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.IActionBars的用法示例。


在下文中一共展示了IActionBars.setGlobalActionHandler方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setActivePage

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
public void setActivePage(IEditorPart part) {
	if (activeEditorPart == part)
		return;

	activeEditorPart = part;

	IActionBars actionBars = getActionBars();
	if (actionBars != null) {

		ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

		actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), getAction(editor, ITextEditorActionConstants.DELETE));
		actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), getAction(editor, ITextEditorActionConstants.UNDO));
		actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), getAction(editor, ITextEditorActionConstants.REDO));
		actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), getAction(editor, ITextEditorActionConstants.CUT));
		actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), getAction(editor, ITextEditorActionConstants.COPY));
		actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), getAction(editor, ITextEditorActionConstants.PASTE));
		actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), getAction(editor, ITextEditorActionConstants.SELECT_ALL));
		actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), getAction(editor, ITextEditorActionConstants.FIND));
		actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(), getAction(editor, IDEActionFactory.BOOKMARK.getId()));
		actionBars.updateActionBars();
	}
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:24,代碼來源:CompDefEditorContributor.java

示例2: createControl

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
public void createControl(Composite parent) {
	sash = new SashForm(parent, SWT.VERTICAL);
	IActionBars bars = getSite().getActionBars();
	ActionRegistry ar = getActionRegistry();

	bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ar.getAction(ActionFactory.COPY.getId()));
	bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), ar.getAction(ActionFactory.PASTE.getId()));

	OutLineComposite composite = new OutLineComposite(filter, sash, SWT.NONE);

	Control tree = getViewer().createControl(composite.getComposite());
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 10, 1));
	tree.setData(GW_WIDGET_ID,GW_OUTLINE_ELEMENTS_TREE);
	getViewer().setEditDomain(getEditDomain());
	getViewer().setEditPartFactory(gwtpf);
	getViewer().setContents(gWGraph);
	
	getSelectionSynchronizer().addViewer(getViewer());

}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:21,代碼來源:GW4EEditor.java

示例3: init

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
public void init(IPageSite pageSite) {
	super.init(pageSite);

	IActionBars bars = pageSite.getActionBars();

	bars.getToolBarManager().add(getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.DELETE.getId()));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.UNDO.getId()));
	bars.getToolBarManager().add(getActionRegistry().getAction(ActionFactory.REDO.getId()));

	bars.setGlobalActionHandler(ClearEdgeBendpointLayoutAction.ID,
			getActionRegistry().getAction(ClearEdgeBendpointLayoutAction.ID));
	bars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
			getActionRegistry().getAction(ActionFactory.UNDO.getId()));
	bars.setGlobalActionHandler(ActionFactory.REDO.getId(),
			getActionRegistry().getAction(ActionFactory.REDO.getId()));
	bars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
			getActionRegistry().getAction(ActionFactory.DELETE.getId()));
	bars.updateActionBars();

	getViewer().setKeyHandler(keyHandler);

	pageSite.setSelectionProvider(getViewer());
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:25,代碼來源:GW4EEditor.java

示例4: addGraphicalEditorActions

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
private void addGraphicalEditorActions(GraphicalEditorPage activeEditor,
		IActionBars actionBars) {
	// get the registry of actions from jpdl editor
	ActionRegistry registry = (ActionRegistry) activeEditor.getAdapter(ActionRegistry.class);
	
	// set jpdl global action to workbench global action
	for (int i = 0; i < WORKBENCH_ACTION_IDS.length; i++) {
		actionBars.setGlobalActionHandler(WORKBENCH_ACTION_IDS[i], registry
				.getAction(WORKBENCH_ACTION_IDS[i]));
	}
	
	// set the retarget action of jpdl editor to jpdl golbal action
	String[] keys = actionMap.keySet().toArray(new String[actionMap.keySet().size()]);
	for (int i = 0; i < keys.length; i++) {
		actionBars.setGlobalActionHandler(keys[i], registry.getAction(keys[i]));
	}
	actionBars.getToolBarManager().update(true);
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:19,代碼來源:EditorActionBarContributor.java

示例5: fillActionBars

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
@Override
public void fillActionBars(final IActionBars actionBars) {
	if (inViewPart && canEnableOpenAction()) {
		openGroup.fillActionBars(actionBars);
		if (openAndExpandAction == null && openGroup.getOpenAction().isEnabled()) {
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openGroup.getOpenAction());
		} else if (openAndExpandAction != null && openAndExpandAction.isEnabled()) {
			actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAndExpandAction);
		}
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:12,代碼來源:N4JSOpenActions.java

示例6: fillActionBars

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
@Override
public void fillActionBars(final IActionBars actionBars) {
	super.fillActionBars(actionBars);
	actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_PROJECT.getId(), closeAction);
	actionBars.setGlobalActionHandler(IDEActionFactory.CLOSE_UNRELATED_PROJECTS.getId(), closeUnrelatedAction);
	actionBars.setGlobalActionHandler(IDEActionFactory.OPEN_PROJECT.getId(), openAction);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:8,代碼來源:N4JSProjectActionGroup.java

示例7: fillActionBars

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
@Override
public void fillActionBars ( final IActionBars actionBars )
{
    if ( this.openAction.isEnabled () )
    {
        actionBars.setGlobalActionHandler ( ICommonActionConstants.OPEN, this.openAction );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:9,代碼來源:CommonActionProvider.java

示例8: hookGlobalActions

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
private void hookGlobalActions() {
 	IActionBars bars = getViewSite().getActionBars();
	
	bars.setGlobalActionHandler(ActionFactory.COPY.getId(), copyAction);
	bars.setGlobalActionHandler(ActionFactory.CUT.getId(), cutAction);
	bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), pasteAction);
	
/*
	bars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
	bars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
*/
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:13,代碼來源:ProjectExplorerView.java

示例9: restoreSavedActions

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
/**
 * restores the saved actions
 * @param actionbars
 * 					at actionbars 
 */
private void restoreSavedActions(IActionBars actionBars){
	actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), copy);
	actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), paste);
	actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), delete);
	actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(), selectAll);
	actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), cut);
	actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(), find);
	actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undo);
	actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redo);
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:16,代碼來源:CommentBoxLabelEditManager.java

示例10: setActivePage

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
public void setActivePage(IEditorPart part) {
	if (activeEditorPart == part)
		return;

	activeEditorPart = part;

	IActionBars actionBars = getActionBars();
	if (actionBars != null) {

		ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;

		actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
				getAction(editor, ITextEditorActionConstants.DELETE));
		actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
				getAction(editor, ITextEditorActionConstants.UNDO));
		actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(),
				getAction(editor, ITextEditorActionConstants.REDO));
		actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(),
				getAction(editor, ITextEditorActionConstants.CUT));
		actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),
				getAction(editor, ITextEditorActionConstants.COPY));
		actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(),
				getAction(editor, ITextEditorActionConstants.PASTE));
		actionBars.setGlobalActionHandler(ActionFactory.SELECT_ALL.getId(),
				getAction(editor, ITextEditorActionConstants.SELECT_ALL));
		actionBars.setGlobalActionHandler(ActionFactory.FIND.getId(),
				getAction(editor, ITextEditorActionConstants.FIND));
		actionBars.setGlobalActionHandler(IDEActionFactory.BOOKMARK.getId(),
				getAction(editor, IDEActionFactory.BOOKMARK.getId()));
		actionBars.updateActionBars();
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:33,代碼來源:PropEditorContributor.java

示例11: addXmlEditorActions

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
private void addXmlEditorActions(StructuredTextEditor activeEditor,
		IActionBars actionBars) {	
	// set the global actions of jpdl editor are unable.
	String[] keys = actionMap.keySet().toArray(new String[actionMap.keySet().size()]);
	for (int i = 0; i < keys.length; i++) {
		actionBars.setGlobalActionHandler(keys[i], null);
	}
	//set the global actions to xml editor global action
	for (int i = 0; i < WORKBENCH_ACTION_IDS.length; i++) {
		actionBars.setGlobalActionHandler(WORKBENCH_ACTION_IDS[i],activeEditor.getAction(TEXTEDITOR_ACTION_IDS[i]));
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:13,代碼來源:EditorActionBarContributor.java

示例12: fillActionBars

import org.eclipse.ui.IActionBars; //導入方法依賴的package包/類
@Override
public void fillActionBars(IActionBars actionBars) {
    if (openAction.isEnabled()) {
        actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, openAction);
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:7,代碼來源:NavigatorOutlineActionProvider.java


注:本文中的org.eclipse.ui.IActionBars.setGlobalActionHandler方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。