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


Java ITextOperationTarget.PASTE属性代码示例

本文整理汇总了Java中org.eclipse.jface.text.ITextOperationTarget.PASTE属性的典型用法代码示例。如果您正苦于以下问题:Java ITextOperationTarget.PASTE属性的具体用法?Java ITextOperationTarget.PASTE怎么用?Java ITextOperationTarget.PASTE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jface.text.ITextOperationTarget的用法示例。


在下文中一共展示了ITextOperationTarget.PASTE属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ClipboardOperationAction

/**
 * Creates the action.
 * @param bundle the resource bundle
 * @param prefix a prefix to be prepended to the various resource keys
 *   (described in <code>ResourceAction</code> constructor), or
 *   <code>null</code> if none
 * @param editor the text editor
 * @param operationCode the operation code
 */
public ClipboardOperationAction(ResourceBundle bundle, String prefix, ITextEditor editor, int operationCode) {
	super(bundle, prefix, editor);
	fOperationCode= operationCode;

	if (operationCode == ITextOperationTarget.CUT) {
		setHelpContextId(IAbstractTextEditorHelpContextIds.CUT_ACTION);
		setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT);
	} else if (operationCode == ITextOperationTarget.COPY) {
		setHelpContextId(IAbstractTextEditorHelpContextIds.COPY_ACTION);
		setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
	} else if (operationCode == ITextOperationTarget.PASTE) {
		setHelpContextId(IAbstractTextEditorHelpContextIds.PASTE_ACTION);
		setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
	} else {
		Assert.isTrue(false, "Invalid operation code"); //$NON-NLS-1$
	}
	update();
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ClipboardOperationAction.java

示例2: internalDoOperation

protected final void internalDoOperation() {
	if (PreferenceConstants.getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_IMPORTS_ON_PASTE) && isSmartInsertMode()) {
		if (fOperationCode == ITextOperationTarget.PASTE) {
			doPasteWithImportsOperation();
		} else {
			doCutCopyWithImportsOperation();
		}
	} else {
		fOperationTarget.doOperation(fOperationCode);
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ClipboardOperationAction.java

示例3: doOperation

/**
 * 重载此方法,实现粘贴、复制前对标记的处理。<br>
 * 已经移出了 默认的复制、粘贴事件键绑定, 参考{@link CellEditorTextViewer#initListener()}
 * @see org.eclipse.jface.text.TextViewer#doOperation(int)
 */
@Override
public void doOperation(int operation) {
	if (operation == ITextOperationTarget.PASTE) {
		parse();
		return;
	}
	if (operation == ITextOperationTarget.COPY) {
		copy();
		return;
	}
	super.doOperation(operation);
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:17,代码来源:SegmentViewer.java

示例4: initializeActions

private void initializeActions() {
	TextViewerAction action = new TextViewerAction(fPatternEditor, ITextOperationTarget.UNDO);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_undo);
	fGlobalActions.put(ITextEditorActionConstants.UNDO, action);

	action = new TextViewerAction(fPatternEditor, ITextOperationTarget.CUT);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_cut);
	fGlobalActions.put(ITextEditorActionConstants.CUT, action);

	action = new TextViewerAction(fPatternEditor, ITextOperationTarget.COPY);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_copy);
	fGlobalActions.put(ITextEditorActionConstants.COPY, action);

	action = new TextViewerAction(fPatternEditor, ITextOperationTarget.PASTE);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_paste);
	fGlobalActions.put(ITextEditorActionConstants.PASTE, action);

	action = new TextViewerAction(fPatternEditor, ITextOperationTarget.SELECT_ALL);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_select_all);
	fGlobalActions.put(ITextEditorActionConstants.SELECT_ALL, action);

	action = new TextViewerAction(fPatternEditor, ISourceViewer.CONTENTASSIST_PROPOSALS);
	action.setText(JSDTTypeScriptUIMessages.EditTemplateDialog_content_assist);
	fGlobalActions.put("ContentAssistProposal", action); //$NON-NLS-1$

	fSelectionActions.add(ITextEditorActionConstants.CUT);
	fSelectionActions.add(ITextEditorActionConstants.COPY);
	fSelectionActions.add(ITextEditorActionConstants.PASTE);

	// create context menu
	MenuManager manager = new MenuManager(null, null);
	manager.setRemoveAllWhenShown(true);
	manager.addMenuListener(new IMenuListener() {
		public void menuAboutToShow(IMenuManager mgr) {
			fillContextMenu(mgr);
		}
	});

	StyledText text = fPatternEditor.getTextWidget();
	Menu menu = manager.createContextMenu(text);
	text.setMenu(menu);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:42,代码来源:EditTemplateDialog.java


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